diff --git a/.github/workflows/scheduled-test.yml b/.github/workflows/scheduled-test.yml index c1c443a..153af40 100644 --- a/.github/workflows/scheduled-test.yml +++ b/.github/workflows/scheduled-test.yml @@ -15,9 +15,16 @@ jobs: uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: 1.18 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 - name: Install Terraform uses: hashicorp/setup-terraform@v3 @@ -41,6 +48,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + - name: Set up Terraform uses: hashicorp/setup-terraform@v3 with: diff --git a/README.md b/README.md index 34f01e2..d42f490 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ No modules. ```hcl module "example-com" { source = "locus313/aws-route53/module" - version = "1.0.4" + version = "1.0.5" enabled = true primary_domain = "example.com" diff --git a/cert.tf b/cert.tf index d41c277..9ad1b65 100644 --- a/cert.tf +++ b/cert.tf @@ -4,6 +4,8 @@ resource "aws_acm_certificate" "records_wr" { provider = aws.acm domain_name = each.key validation_method = "DNS" + + depends_on = [aws_route53_zone.this] } resource "aws_acm_certificate_validation" "records_wr" { @@ -12,4 +14,6 @@ resource "aws_acm_certificate_validation" "records_wr" { provider = aws.acm certificate_arn = aws_acm_certificate.records_wr[each.key].arn validation_record_fqdns = [for record in aws_route53_record.records_wr_validation : record.fqdn] + + depends_on = [aws_route53_zone.this] } diff --git a/compliance/features/example.feature b/compliance/features/example.feature index 82ef987..a3b9495 100644 --- a/compliance/features/example.feature +++ b/compliance/features/example.feature @@ -1,11 +1,11 @@ Feature: Route 53 Compliance Scenario: Ensure all A records have the correct TTL - Given I have AWS Route53 Record defined + Given I have aws_route53_record defined When its type is "A" Then its ttl must be 3600 Scenario: Ensure all CNAME records have the correct TTL - Given I have AWS Route53 Record defined + Given I have aws_route53_record defined When its type is "CNAME" Then its ttl must be 3600 diff --git a/example/main.tf b/example/main.tf index 9c6464a..db725e8 100644 --- a/example/main.tf +++ b/example/main.tf @@ -1,46 +1,45 @@ -module "example-com" { +module "lo5t-dev" { source = "locus313/aws-route53/module" - version = "1.0.4" + version = "1.0.5" enabled = true - primary_domain = "example.com" + primary_domain = "lo5t.dev" records_wr = { - "support.example.com" = "https://example.atlassian.net/servicedesk/customer/portals" } records_a = { - "example.com" = ["12.23.45.56"] + "lo5t.dev" = ["12.23.45.56"] } records_aaaa = { - "example.com" = ["::ffff:c17:2d38"] + "lo5t.dev" = ["::ffff:c17:2d38"] } records_caa = { - "example.com" = ["0 issue \"letsencrypt.org\""] + "lo5t.dev" = ["0 issue \"letsencrypt.org\""] } records_cname = { - "calendar.example.com" = ["ghs.googlehosted.com"] - "docs.example.com" = ["ghs.googlehosted.com"] - "ftp.example.com" = ["example.com"] - "mail.example.com" = ["ghs.googlehosted.com"] - "sites.example.com" = ["ghs.googlehosted.com"] - "www.example.com" = ["example.com"] + "calendar.lo5t.dev" = ["ghs.googlehosted.com"] + "docs.lo5t.dev" = ["ghs.googlehosted.com"] + "ftp.lo5t.dev" = ["lo5t.dev"] + "mail.lo5t.dev" = ["ghs.googlehosted.com"] + "sites.lo5t.dev" = ["ghs.googlehosted.com"] + "www.lo5t.dev" = ["lo5t.dev"] } records_mx = { - "example.com" = ["10 aspmx.l.google.com","20 alt1.aspmx.l.google.com","30 alt2.aspmx.l.google.com","40 aspmx2.googlemail.com","50 aspmx3.googlemail.com"] + "lo5t.dev" = ["10 aspmx.l.google.com","20 alt1.aspmx.l.google.com","30 alt2.aspmx.l.google.com","40 aspmx2.googlemail.com","50 aspmx3.googlemail.com"] } records_txt = { - "example.com" = ["v=spf1 include:_spf.google.com ~all"] - "google._domainkey.example.com" = ["v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3gtOkCHXv+kDJBpIkr1lq1Ywd4B8FJGPceSv9s7yhUtCk8pKwifLmSKWNEyOvuK5oxIms+4Vc9Pu46bi/wehi5zJynzhkOrzYXdOX6+m4Nb8NbFWr0zZqsM+pDGmYzRjeczY/+txXnOegcbxL+967bIRisnlH2CRD91h1t0NJwsvvN23T5MAMaeJr726piDdE\"\"C6P2nF1apYbGXp0DZGz/RvtpCGjASjlpejA8I/xLclZOBn4Ir9pk8gajRSG48D21UKJ3d+PFzYEj9X5n1p1i2trjCqkdyCzU+f3vTUxma5F7fQncKYIeRJwVNbmR03IYfGuicCu13hnVP36aT5yuQIDAQAB"] + "lo5t.dev" = ["v=spf1 include:_spf.google.com ~all"] + "google._domainkey.lo5t.dev" = ["v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3gtOkCHXv+kDJBpIkr1lq1Ywd4B8FJGPceSv9s7yhUtCk8pKwifLmSKWNEyOvuK5oxIms+4Vc9Pu46bi/wehi5zJynzhkOrzYXdOX6+m4Nb8NbFWr0zZqsM+pDGmYzRjeczY/+txXnOegcbxL+967bIRisnlH2CRD91h1t0NJwsvvN23T5MAMaeJr726piDdE\"\"C6P2nF1apYbGXp0DZGz/RvtpCGjASjlpejA8I/xLclZOBn4Ir9pk8gajRSG48D21UKJ3d+PFzYEj9X5n1p1i2trjCqkdyCzU+f3vTUxma5F7fQncKYIeRJwVNbmR03IYfGuicCu13hnVP36aT5yuQIDAQAB"] } records_ns = { - "clusters.example.com" = ["ns-128.awsdns-16.com","ns-1533.awsdns-63.org","ns-1554.awsdns-02.co.uk","ns-956.awsdns-55.net"] - "envs.example.com" = ["ns-1103.awsdns-09.org","ns-1587.awsdns-06.co.uk","ns-378.awsdns-47.com","ns-693.awsdns-22.net"] + "clusters.lo5t.dev" = ["ns-128.awsdns-16.com","ns-1533.awsdns-63.org","ns-1554.awsdns-02.co.uk","ns-956.awsdns-55.net"] + "envs.lo5t.dev" = ["ns-1103.awsdns-09.org","ns-1587.awsdns-06.co.uk","ns-378.awsdns-47.com","ns-693.awsdns-22.net"] } } diff --git a/example/outputs.tf b/example/outputs.tf index 533085e..4980399 100644 --- a/example/outputs.tf +++ b/example/outputs.tf @@ -1,9 +1,9 @@ output "zone_id" { description = "Zone ID of Route53 zone" - value = module.example-com[0].this_route53_zone_zone_id + value = module.lo5t-dev.this_route53_zone_zone_id } output "name_servers" { description = "Name servers of Route53 zone" - value = module.example-com[0].this_route53_zone_name_servers + value = module.lo5t-dev.this_route53_zone_name_servers }