generated from clowdhaus/terraform-aws-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 56
feat!: Upgrade AWS provider and min required Terraform version to 6.12 and 1.5.7 respectively
#45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bryantbiggs
merged 10 commits into
terraform-aws-modules:master
from
magreenbaum:feat/aws_v6
Oct 24, 2025
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a72bb22
upgrade to v6
magreenbaum 2d3e562
add upgrade docs
magreenbaum 46a14b4
pre-commit adjustment
magreenbaum 82f3b48
update versions
magreenbaum 8b23b4e
readme
magreenbaum 620c54c
Merge branch 'master' into feat/aws_v6
magreenbaum 0803822
Apply suggestion from @antonbabenko
magreenbaum 281e123
Apply suggestion from @antonbabenko
magreenbaum ebccb46
feedback changes
magreenbaum 6aaefdc
run pre-commit
magreenbaum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # Upgrade from v1.x to v2.x | ||
|
|
||
| Please consult the `examples` directory for reference example configurations. If you find a bug, please open an issue with supporting configuration to reproduce. | ||
|
|
||
| ## List of backwards incompatible changes | ||
|
|
||
| - Terraform `v1.5.7` is now minimum supported version | ||
| - AWS provider `v6.12` is now minimum supported version | ||
| - `security_group_rules` has been split into `security_group_ingress_rules` and `security_group_egress_rules` to better match the AWS API and allow for more flexibility in defining security group rules. | ||
|
|
||
| ## Additional changes | ||
|
|
||
| ### Added | ||
|
|
||
| - Support for `region` parameter to specify the AWS region for the resources created if different from the provider region. | ||
|
|
||
| ### Modified | ||
|
|
||
| - Variable definitions now contain detailed `object` types in place of the previously used any type. | ||
|
|
||
| ### Variable and output changes | ||
|
|
||
| 1. Removed variables: | ||
|
|
||
| - `security_group_rules` | ||
|
|
||
| 2. Renamed variables: | ||
|
|
||
| - None | ||
|
|
||
| 3. Added variables: | ||
|
|
||
| - `security_group_ingress_rules` | ||
| - `security_group_egress_rules` | ||
|
|
||
| 4. Removed outputs: | ||
|
|
||
| - None | ||
|
|
||
| 5. Renamed outputs: | ||
|
|
||
| - None | ||
|
|
||
| 6. Added outputs: | ||
|
|
||
| - None | ||
|
|
||
| ## Upgrade Migrations | ||
|
|
||
| ### Before 2.x Example | ||
|
|
||
| ```hcl | ||
| module "efs" { | ||
| source = "terraform-aws-modules/efs" | ||
| version = "~> 1.0" | ||
|
|
||
| # Truncated for brevity ... | ||
|
|
||
| # Security Groups | ||
| security_group_rules = { | ||
| vpc = { | ||
| # relying on the defaults provided for EFS/NFS (2049/TCP + ingress) | ||
| description = "NFS ingress from VPC private subnets" | ||
| cidr_blocks = module.vpc.private_subnets_cidr_blocks | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### After 2.x Example | ||
|
|
||
| ```hcl | ||
| module "efs" { | ||
| source = "terraform-aws-modules/efs" | ||
magreenbaum marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| version = "~> 2.0" | ||
|
|
||
| # Truncated for brevity ... | ||
|
|
||
| # Security Groups | ||
| security_group_ingress_rules = { | ||
| vpc_1 = { | ||
| # relying on the defaults provided for EFS/NFS (2049/TCP + ingress) | ||
| description = "NFS ingress from VPC private subnets" | ||
| cidr_ipv4 = element(module.vpc.private_subnets_cidr_blocks, 0) | ||
| } | ||
| vpc_2 = { | ||
| # relying on the defaults provided for EFS/NFS (2049/TCP + ingress) | ||
| description = "NFS ingress from VPC private subnets" | ||
| cidr_ipv4 = element(module.vpc.private_subnets_cidr_blocks, 1) | ||
| } | ||
| vpc_3 = { | ||
| # relying on the defaults provided for EFS/NFS (2049/TCP + ingress) | ||
| description = "NFS ingress from VPC private subnets" | ||
| cidr_ipv4 = element(module.vpc.private_subnets_cidr_blocks, 2) | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### State Changes | ||
|
|
||
| Due to the change from `aws_security_group_rule` to `aws_vpc_security_group_ingress_rule` and `aws_vpc_security_group_egress_rule`, the following reference state changes are required to maintain the current security group rules. (Note: these are different resources so they cannot be moved with `terraform mv ...`) | ||
|
|
||
| ```sh | ||
| terraform state rm 'module.efs.aws_security_group_rule.this["vpc"]' | ||
| terraform state import 'module.efs.aws_vpc_security_group_ingress_rule.this["vpc_1"]' 'sg-xxx' | ||
| terraform state import 'module.efs.aws_vpc_security_group_ingress_rule.this["vpc_2"]' 'sg-xxx' | ||
| terraform state import 'module.efs.aws_vpc_security_group_ingress_rule.this["vpc_3"]' 'sg-xxx' | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| terraform { | ||
| required_version = ">= 1.0" | ||
| required_version = ">= 1.5.7" | ||
|
|
||
| required_providers { | ||
| aws = { | ||
| source = "hashicorp/aws" | ||
| version = ">= 5.35" | ||
| version = ">= 6.12" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.