Skip to content

Commit

Permalink
Merge branch 'feature/tests' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanvaughn committed Dec 9, 2024
2 parents 23a2b52 + 57938c4 commit d1ad84f
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 167 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: "Test OE Mastodon AWS Pattern Terraform Module"
name: "Test OE Jitsi AWS Pattern Terraform Module"

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
schedule:
- cron: "15 10 * * 1"
- cron: "15 11 * * 1"

env:
# verbosity setting for Terraform logs
Expand Down
64 changes: 28 additions & 36 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ terraform {
required_version = ">= 1.0"
}

resource "aws_cloudformation_stack" "oe_patterns_mastodon" {
resource "aws_cloudformation_stack" "oe_patterns_jitsi" {
name = var.stack_name

template_url = "https://s3.amazonaws.com/awsmp-fulfillment-cf-templates-prod/d0a98067-9a26-440a-858e-00193a953934/3d2a4601d523496687e522acdcc4b774.template"
template_url = "https://s3.amazonaws.com/awsmp-fulfillment-cf-templates-prod/ac194df3-6564-4b73-933a-99a8d35dac92/3b86fffdeec24745a6806725c543a514.template"

capabilities = ["CAPABILITY_NAMED_IAM"]

Expand All @@ -22,39 +22,31 @@ resource "aws_cloudformation_stack" "oe_patterns_mastodon" {
}

parameters = {
AlbCertificateArn = var.alb_certificate_arn
AlbIngressCidr = var.alb_ingress_cidr
AsgDesiredCapacity = var.asg_desired_capacity
AsgInstanceType = var.asg_instance_type
AsgKeyName = var.asg_key_name
AsgMaxSize = var.asg_max_size
AsgMinSize = var.asg_min_size
AsgReprovisionString = var.asg_reprovision_string
AssetsBucketName = var.assets_bucket_name
DbBackupRetentionPeriod = var.db_backup_retention_period
DbInstanceClass = var.db_instance_class
DbSecretArn = var.db_secret_arn
DbSnapshotIdentifier = var.db_snapshot_identifier
DnsHostname = var.dns_hostname
DnsRoute53HostedZoneName = var.dns_route53_hosted_zone_name
Name = var.name
OpenSearchServiceCreateServiceLinkedRole = var.open_search_service_create_service_linked_role
OpenSearchServiceEbsVolumeSize = var.open_search_service_ebs_volume_size
OpenSearchServiceNodeType = var.open_search_service_node_type
RedisClusterCacheNodeType = var.redis_cluster_cache_node_type
RedisClusterNumCacheNodes = var.redis_cluster_num_cache_nodes
SesCreateDomainIdentity = var.ses_create_domain_identity
SesInstanceUserAccessKeySerial = var.ses_instance_user_access_key_serial
VpcCidr = var.vpc_cidr
VpcId = var.vpc_id
VpcNatGatewayPerSubnet = var.vpc_nat_gateway_per_subnet
VpcPrivateSubnet1Cidr = var.vpc_private_subnet1_cidr
VpcPrivateSubnet1Id = var.vpc_private_subnet1_id
VpcPrivateSubnet2Cidr = var.vpc_private_subnet2_cidr
VpcPrivateSubnet2Id = var.vpc_private_subnet2_id
VpcPublicSubnet1Cidr = var.vpc_public_subnet1_cidr
VpcPublicSubnet1Id = var.vpc_public_subnet1_id
VpcPublicSubnet2Cidr = var.vpc_public_subnet2_cidr
VpcPublicSubnet2Id = var.vpc_public_subnet2_id
AlbCertificateArn = var.alb_certificate_arn
AlbIngressCidr = var.alb_ingress_cidr
AsgDesiredCapacity = var.asg_desired_capacity
AsgInstanceType = var.asg_instance_type
AsgKeyName = var.asg_key_name
AsgMaxSize = var.asg_max_size
AsgMinSize = var.asg_min_size
AsgReprovisionString = var.asg_reprovision_string
AssetsBucketName = var.assets_bucket_name
CustomConfigJsParameterArn = var.custom_config_js_parameter_arn
CustomDotEnvParameterArn = var.custom_dot_env_parameter_arn
CustomInterfaceConfigJsParameterArn = var.custom_interface_config_js_parameter_arn
DnsHostname = var.dns_hostname
DnsRoute53HostedZoneName = var.dns_route53_hosted_zone_name
JitsiArn = var.jitsi_arn
VpcCidr = var.vpc_cidr
VpcId = var.vpc_id
VpcNatGatewayPerSubnet = var.vpc_nat_gateway_per_subnet
VpcPrivateSubnet1Cidr = var.vpc_private_subnet1_cidr
VpcPrivateSubnet1Id = var.vpc_private_subnet1_id
VpcPrivateSubnet2Cidr = var.vpc_private_subnet2_cidr
VpcPrivateSubnet2Id = var.vpc_private_subnet2_id
VpcPublicSubnet1Cidr = var.vpc_public_subnet1_cidr
VpcPublicSubnet1Id = var.vpc_public_subnet1_id
VpcPublicSubnet2Cidr = var.vpc_public_subnet2_cidr
VpcPublicSubnet2Id = var.vpc_public_subnet2_id
}
}
12 changes: 4 additions & 8 deletions tests/mastodon.tftest.hcl → tests/jitsi.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@ run "setup_tests" {
}
}

run "provision_mastodon" {
run "provision_jitsi" {
command = apply

variables {
alb_certificate_arn = "arn:aws:acm:us-east-1:343218188409:certificate/ef859721-e16e-4fcd-9d10-8dfb188bd15a"
alb_ingress_cidr = "0.0.0.0/0"
dns_hostname = "${run.setup_tests.stack_prefix}-mastodon-test.test.patterns.ordinaryexperts.com"
dns_hostname = "${run.setup_tests.stack_prefix}-jitsi-test.test.patterns.ordinaryexperts.com"
dns_route53_hosted_zone_name = "test.patterns.ordinaryexperts.com"
# role already exists in test account
open_search_service_create_service_linked_role = false
# domain identity already exists in test account
ses_create_domain_identity = false
stack_name = "${run.setup_tests.stack_prefix}-mastodon-test"
stack_name = "${run.setup_tests.stack_prefix}-jitsi-test"
}

# Check that the DNS Site URL output is correct
assert {
condition = output.dns_site_url_output == "https://${run.setup_tests.stack_prefix}-mastodon-test.test.patterns.ordinaryexperts.com"
condition = output.dns_site_url_output == "https://${run.setup_tests.stack_prefix}-jitsi-test.test.patterns.ordinaryexperts.com"
error_message = "Invalid DNS Site URL output"
}
}
Loading

0 comments on commit d1ad84f

Please sign in to comment.