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

Fixed deprecated warning, using network_interface_id instead #156

Merged
merged 3 commits into from
Apr 27, 2022
Merged

Fixed deprecated warning, using network_interface_id instead #156

merged 3 commits into from
Apr 27, 2022

Conversation

ktasper
Copy link
Contributor

@ktasper ktasper commented Apr 26, 2022

what

Using the current version you get a deprecated warning:

│ Warning: Argument is deprecated
│ 
│   with module.dynamic-subnets.aws_route.nat_instance,
│   on .terraform/modules/dynamic-subnets/nat-instance.tf line 130, in resource "aws_route" "nat_instance":
│  130:   instance_id            = element(aws_instance.nat_instance.*.id, count.index)
│ 
│ Use network_interface_id instead

I have updated the code to use the recommended network_interface_id, as a result I have also had to point it to primary_network_interface_id.

@ktasper ktasper requested review from a team as code owners April 26, 2022 09:29
@ktasper ktasper requested review from srhopkins and brcnblc April 26, 2022 09:29
@Gowiem
Copy link
Member

Gowiem commented Apr 26, 2022

@ktasper Thanks for the fix. Can you please lookup when network_interface_id was introduced / when instance_id was deprecated? We'll need to check if we need to bump the required version of the AWS provider alongside these changes because I could see this not being backwards compatible.

@Gowiem
Copy link
Member

Gowiem commented Apr 26, 2022

/test all

@Gowiem Gowiem added the patch A minor, backward compatible change label Apr 26, 2022
@Gowiem Gowiem self-requested a review April 26, 2022 16:44
@ktasper
Copy link
Contributor Author

ktasper commented Apr 26, 2022

@ktasper Thanks for the fix. Can you please lookup when network_interface_id was introduced / when instance_id was deprecated? We'll need to check if we need to bump the required version of the AWS provider alongside these changes because I could see this not being backwards compatible.

Sure.It was deprecated this release:

I cannot see when network_interface_id was added but a git blame [shows commits from 2017-03-14:] (https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/ec2/vpc_route.go#L128)

ee1410d3a86 resource_aws_route.go                      (Paul Stack              2017-03-14 12:41:40 +0200 128)                  "network_interface_id": {

Not sure if that helps.

@Gowiem
Copy link
Member

Gowiem commented Apr 27, 2022

@ktasper That's great. network_interface_id has been around forever as you've found and instance_id is deprecated only in 4.0+ which is fine. I think that makes this a very backwards compatible change, so we should be good to just merge. I'll do so after tests pass.

@Gowiem
Copy link
Member

Gowiem commented Apr 27, 2022

/test all

@Gowiem Gowiem merged commit 03b3277 into cloudposse:master Apr 27, 2022
@Gowiem
Copy link
Member

Gowiem commented Apr 27, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants