Skip to content
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

feat!: Bump Terraform AWS Provider version to 5.0 #941

Merged
merged 3 commits into from
May 30, 2023

Conversation

virgofx
Copy link
Contributor

@virgofx virgofx commented May 27, 2023

Description

Use domain attribute instead of deprecate vpc argument

The vpc attribute has been deprecated and starting with AWS Terraform Provider v5.0 this will report a deprecation warning. The new domain parameter has similar functionality while removing EC2-classic support. This pull request fixes the deprecation warnings when using this provider with the Terraform AWS >= 5.0 provider.

Motivation and Context

To fix deprecation warnings and provide consistency with AWS 5.x provider

│ Warning: Argument is deprecated
│
│   with module.account_baseline.module.vpc_main.aws_eip.nat,
│   on .terraform\modules\account_baseline.vpc_main\main.tf line 1044, in resource "aws_eip" "nat":
│ 1044:   vpc = true
│
│ use domain attribute instead

Breaking Changes

The domain parameter for resource aws_eip is introduced with AWS terraform provider 5.0. Thus, this is a breaking change in that it requires consumers to have an updated AWS provider newer than the current pinned 4.35. However, we should be able to release a new major version to support 5.0. See the accompanying documentation updates.

How Has This Been Tested?

Did not test fully yet. In the process of testing locally.

The `vpc` attribute has been deprecated and starting
with AWS Terraform Provider v5.0 this will report
a deprecation warning. The new `domain` parameter
has similar functionality while removing EC2-classic
support.
@virgofx virgofx changed the title Create 5.0 Major release to support AWS Terraform Provider 5.0 fix: Remove deprecation warning and create new major release to support AWS Terraform Provider 5.0 May 27, 2023
@antonbabenko antonbabenko changed the title fix: Remove deprecation warning and create new major release to support AWS Terraform Provider 5.0 feat!: Bump Terraform AWS Provider version to 5.0 May 30, 2023
@virgofx
Copy link
Contributor Author

virgofx commented May 30, 2023

@antonbabenko Thanks for the pull request adds. I just noticed the failures and was about to update similarly. Looks good, thanks!

@bryantbiggs
Copy link
Member

tested on https://github.com/terraform-aws-modules/terraform-aws-vpc/tree/master/examples/complete - resulted in a no-op

no upgrade required since there are no user facing changes - the breaking change is only due to the major change on the provider (v4.x to v5.0).

@bryantbiggs bryantbiggs merged commit 2517eb9 into terraform-aws-modules:master May 30, 2023
antonbabenko pushed a commit that referenced this pull request May 30, 2023
## [5.0.0](v4.0.2...v5.0.0) (2023-05-30)

### ⚠ BREAKING CHANGES

* Bump Terraform AWS Provider version to 5.0 (#941)

### Features

* Bump Terraform AWS Provider version to 5.0 ([#941](#941)) ([2517eb9](2517eb9))
@antonbabenko
Copy link
Member

This PR is included in version 5.0.0 🎉

@virgofx
Copy link
Contributor Author

virgofx commented May 30, 2023

Confirmed 5.0.0 works no deprecation warnings 🎉

@khosro-copper
Copy link

Same! works fine for me. Thanks!

@estahn
Copy link

estahn commented May 31, 2023

Nice!

@antonbabenko I assume the other modules need to be upgraded first to make this fully usable?

@antonbabenko
Copy link
Member

@estahn All Terraform AWS modules are independent, and the provider's version can be upgraded if necessary. In many cases, we don't specify the maximum version of the provider, so it should work right away without any changes. Or what do you mean? :)

@estahn
Copy link

estahn commented May 31, 2023

Or what do you mean? :)

@antonbabenko I might be missing something. I did the following:

some.tf

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "5.0.0"

  ...
}

terraform init -upgrade:

Initializing Terraform Cloud...
Upgrading modules...
Downloading registry.terraform.io/terraform-aws-modules/security-group/aws 4.17.2 for app_api_sg...
- app_api_sg in .terraform/modules/app_api_sg
Downloading registry.terraform.io/terraform-aws-modules/rds-aurora/aws 8.1.1 for rds...
- rds in .terraform/modules/rds
Downloading registry.terraform.io/terraform-aws-modules/rds-proxy/aws 2.1.2 for rds_proxy...
- rds_proxy in .terraform/modules/rds_proxy
Downloading registry.terraform.io/terraform-aws-modules/security-group/aws 4.17.2 for rds_proxy_sg...
- rds_proxy_sg in .terraform/modules/rds_proxy_sg
Downloading registry.terraform.io/terraform-aws-modules/vpc/aws 5.0.0 for vpc...
- vpc in .terraform/modules/vpc
Downloading registry.terraform.io/terraform-aws-modules/security-group/aws 4.17.2 for vpc_endpoints_sg...
- vpc_endpoints_sg in .terraform/modules/vpc_endpoints_sg

Initializing provider plugins...
- Finding hashicorp/aws versions matching ">= 3.29.0, >= 3.38.0, >= 4.0.0, ~> 4.61, >= 5.0.0"...
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints >= 3.29.0, >= 3.38.0, >= 4.0.0, ~> 4.61, >= 5.0.0
╵

@bryantbiggs
Copy link
Member

@estahn one of your dependencies has a pin that prevents v5.0 from being reached ~> 4.61, which means Terraform is unable to find a suitable version of the provider to use

@estahn
Copy link

estahn commented May 31, 2023

@estahn one of your dependencies has a pin that prevents v5.0 from being reached ~> 4.61, which means Terraform is unable to find a suitable version of the provider to use

Right, I guess that would be this one: https://github.com/terraform-aws-modules/terraform-aws-rds-aurora/blob/fa04ae1d361d81d1ea043b89e51ff1ff0bf8ceca/versions.tf#L7

It's showing ~> 4.67 now, since I upgraded to terraform-aws-rds-aurora@8.2.0.

The versions qualifier was changed from >= to ~> here: https://github.com/terraform-aws-modules/terraform-aws-rds-aurora/blob/e054f77c700128c206b0912c51712313981d6fae/versions.tf

@github-actions
Copy link

github-actions bot commented Jul 1, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants