From c20cf2333219d6825c0201f78f3181dd7a0800c9 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Sun, 10 Nov 2024 09:14:55 -0800 Subject: [PATCH 1/4] Updates tests for compatibility with latest terraform provider --- tests/cross_account/main.tf | 4 ++-- tests/share/main.tf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cross_account/main.tf b/tests/cross_account/main.tf index e3a0ecb..924f45c 100644 --- a/tests/cross_account/main.tf +++ b/tests/cross_account/main.tf @@ -42,7 +42,7 @@ module "share" { } module "vpc" { - source = "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v3.16.1" + source = "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.15.0" name = "tardigrade-ram-${random_string.this.result}" cidr = "10.0.0.0/16" @@ -90,7 +90,7 @@ resource "random_string" "this" { length = 6 upper = false special = false - number = false + numeric = false } output "share" { diff --git a/tests/share/main.tf b/tests/share/main.tf index 4fff183..16f25f8 100644 --- a/tests/share/main.tf +++ b/tests/share/main.tf @@ -23,7 +23,7 @@ module "share" { } module "vpc" { - source = "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v3.16.1" + source = "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.15.0" name = "tardigrade-ram-${random_string.this.result}" cidr = "10.0.0.0/16" @@ -71,7 +71,7 @@ resource "random_string" "this" { length = 6 upper = false special = false - number = false + numeric = false } output "share" { From 6a23568bdfe1071f657b885a017c35c44b25eacc Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Sun, 10 Nov 2024 09:15:14 -0800 Subject: [PATCH 2/4] Removes sleep due to inability to reproduce error in recent aws provider versions --- modules/cross_account_principal_association/versions.tf | 2 +- modules/principal_association/main.tf | 5 ----- modules/principal_association/versions.tf | 2 +- modules/resource_association/versions.tf | 2 +- modules/share_accepter/versions.tf | 2 +- versions.tf | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/cross_account_principal_association/versions.tf b/modules/cross_account_principal_association/versions.tf index c3c64f9..f1657a4 100644 --- a/modules/cross_account_principal_association/versions.tf +++ b/modules/cross_account_principal_association/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 3.0" + version = ">= 5.37.0" configuration_aliases = [aws.owner] } } diff --git a/modules/principal_association/main.tf b/modules/principal_association/main.tf index 72d14c5..b5bdfbe 100644 --- a/modules/principal_association/main.tf +++ b/modules/principal_association/main.tf @@ -1,9 +1,4 @@ resource "aws_ram_principal_association" "this" { principal = var.principal resource_share_arn = var.resource_share_arn - - # The invitation sometime takes a few seconds to propagate - provisioner "local-exec" { - command = "python -c 'import time; time.sleep(10)'" - } } diff --git a/modules/principal_association/versions.tf b/modules/principal_association/versions.tf index 34260e6..d280ead 100644 --- a/modules/principal_association/versions.tf +++ b/modules/principal_association/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 3.0" + version = ">= 5.37.0" } } } diff --git a/modules/resource_association/versions.tf b/modules/resource_association/versions.tf index 34260e6..d280ead 100644 --- a/modules/resource_association/versions.tf +++ b/modules/resource_association/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 3.0" + version = ">= 5.37.0" } } } diff --git a/modules/share_accepter/versions.tf b/modules/share_accepter/versions.tf index 34260e6..d280ead 100644 --- a/modules/share_accepter/versions.tf +++ b/modules/share_accepter/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 3.0" + version = ">= 5.37.0" } } } diff --git a/versions.tf b/versions.tf index 34260e6..d280ead 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 3.0" + version = ">= 5.37.0" } } } From 26942c9c131ab784b937ad71bfeaa09d68e9b7bd Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Sun, 10 Nov 2024 09:28:03 -0800 Subject: [PATCH 3/4] Removes unnecessary resources from cross-account test --- tests/cross_account/main.tf | 52 ------------------------------------- 1 file changed, 52 deletions(-) diff --git a/tests/cross_account/main.tf b/tests/cross_account/main.tf index 924f45c..a2f7441 100644 --- a/tests/cross_account/main.tf +++ b/tests/cross_account/main.tf @@ -29,63 +29,11 @@ module "share" { allow_external_principals = true - resources = [ - { - name = "resolver-rule" - resource_arn = aws_route53_resolver_rule.this.arn - } - ] - tags = { Environment = "testing" } } -module "vpc" { - source = "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.15.0" - - name = "tardigrade-ram-${random_string.this.result}" - cidr = "10.0.0.0/16" - azs = ["us-east-1a", "us-east-1b"] - private_subnets = ["10.0.1.0/24", "10.0.2.0/24"] -} - -resource "aws_security_group" "this" { - name = "empty_sg" - description = "empty_sg for testing" - vpc_id = module.vpc.vpc_id -} - -resource "aws_route53_resolver_endpoint" "this" { - name = "tardigrade-resolver-${random_string.this.result}" - direction = "OUTBOUND" - - security_group_ids = [ - aws_security_group.this.id, - ] - - ip_address { - subnet_id = module.vpc.private_subnets[0] - ip = "10.0.1.4" - } - - ip_address { - subnet_id = module.vpc.private_subnets[1] - ip = "10.0.2.8" - } -} - -resource "aws_route53_resolver_rule" "this" { - domain_name = "${random_string.this.result}.com" - name = "tardigrate-rr-${random_string.this.result}" - rule_type = "FORWARD" - resolver_endpoint_id = aws_route53_resolver_endpoint.this.id - - target_ip { - ip = "123.45.67.89" - } -} - resource "random_string" "this" { length = 6 upper = false From afddad5d1794c8fc67fd2007eea9909851a9d477 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Sun, 10 Nov 2024 09:29:31 -0800 Subject: [PATCH 4/4] Bumps version to 4.1.0 --- .bumpversion.cfg | 2 +- README.md | 4 ++-- modules/cross_account_principal_association/README.md | 4 ++-- modules/principal_association/README.md | 4 ++-- modules/resource_association/README.md | 4 ++-- modules/share_accepter/README.md | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0e34519..62f89c2 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 4.0.0 +current_version = 4.1.0 commit = True message = Bumps version to {new_version} tag = False diff --git a/README.md b/README.md index 29b1721..da98ab0 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ provider configs for the tests require that you use a profiles with the names `r | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13 | -| [aws](#requirement\_aws) | >= 3.0 | +| [aws](#requirement\_aws) | >= 5.37.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.0 | +| [aws](#provider\_aws) | >= 5.37.0 | ## Resources diff --git a/modules/cross_account_principal_association/README.md b/modules/cross_account_principal_association/README.md index 0090662..f7a267f 100644 --- a/modules/cross_account_principal_association/README.md +++ b/modules/cross_account_principal_association/README.md @@ -6,13 +6,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.15 | -| [aws](#requirement\_aws) | >= 3.0 | +| [aws](#requirement\_aws) | >= 5.37.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.0 | +| [aws](#provider\_aws) | >= 5.37.0 | ## Resources diff --git a/modules/principal_association/README.md b/modules/principal_association/README.md index e0b7f66..c1f1960 100644 --- a/modules/principal_association/README.md +++ b/modules/principal_association/README.md @@ -6,13 +6,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13 | -| [aws](#requirement\_aws) | >= 3.0 | +| [aws](#requirement\_aws) | >= 5.37.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.0 | +| [aws](#provider\_aws) | >= 5.37.0 | ## Resources diff --git a/modules/resource_association/README.md b/modules/resource_association/README.md index a0bb5da..66408ab 100644 --- a/modules/resource_association/README.md +++ b/modules/resource_association/README.md @@ -6,13 +6,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13 | -| [aws](#requirement\_aws) | >= 3.0 | +| [aws](#requirement\_aws) | >= 5.37.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.0 | +| [aws](#provider\_aws) | >= 5.37.0 | ## Resources diff --git a/modules/share_accepter/README.md b/modules/share_accepter/README.md index a7ca70a..223b749 100644 --- a/modules/share_accepter/README.md +++ b/modules/share_accepter/README.md @@ -6,13 +6,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13 | -| [aws](#requirement\_aws) | >= 3.0 | +| [aws](#requirement\_aws) | >= 5.37.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.0 | +| [aws](#provider\_aws) | >= 5.37.0 | ## Resources