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

r/eip, d/eip: add extra computed attributes and BYOIP feature support #6518

Merged
merged 4 commits into from
Nov 19, 2018

Conversation

mhorbul
Copy link
Contributor

@mhorbul mhorbul commented Nov 19, 2018

Fixes #6251
Fixes #4551

supersedes #6463
Credits to @kl4w for data attributes work

Changes proposed in this pull request:

  • add extra computed attributes:
    • association_id
    • domain
    • instance_id
    • network_interface_id
    • network_interface_owner_id
    • private_ip
    • public_ipv4_pool
  • allow to define public_ipv4_pool when EIP gets allocated

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsEip_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccDataSourceAwsEip_ -timeout 120m
=== RUN   TestAccDataSourceAwsEip_Filter
=== PAUSE TestAccDataSourceAwsEip_Filter
=== RUN   TestAccDataSourceAwsEip_Id
=== PAUSE TestAccDataSourceAwsEip_Id
=== RUN   TestAccDataSourceAwsEip_PublicIP_EC2Classic
--- PASS: TestAccDataSourceAwsEip_PublicIP_EC2Classic (7.71s)
=== RUN   TestAccDataSourceAwsEip_PublicIP_VPC
=== PAUSE TestAccDataSourceAwsEip_PublicIP_VPC
=== RUN   TestAccDataSourceAwsEip_Tags
=== PAUSE TestAccDataSourceAwsEip_Tags
=== RUN   TestAccDataSourceAwsEip_NetworkInterface
=== PAUSE TestAccDataSourceAwsEip_NetworkInterface
=== RUN   TestAccDataSourceAwsEip_Instance
=== PAUSE TestAccDataSourceAwsEip_Instance
=== CONT  TestAccDataSourceAwsEip_Filter
=== CONT  TestAccDataSourceAwsEip_NetworkInterface
=== CONT  TestAccDataSourceAwsEip_Instance
=== CONT  TestAccDataSourceAwsEip_PublicIP_VPC
=== CONT  TestAccDataSourceAwsEip_Tags
=== CONT  TestAccDataSourceAwsEip_Id
--- PASS: TestAccDataSourceAwsEip_PublicIP_VPC (6.13s)
--- PASS: TestAccDataSourceAwsEip_Id (6.22s)
--- PASS: TestAccDataSourceAwsEip_Filter (6.40s)
--- PASS: TestAccDataSourceAwsEip_Tags (6.51s)
--- PASS: TestAccDataSourceAwsEip_NetworkInterface (23.00s)
--- PASS: TestAccDataSourceAwsEip_Instance (231.70s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	239.469s
$ make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsEip_PublicIpv4Pool_' AWS_REGION=us-east-1  AWS_EC2_EIP_PUBLIC_IPV4_POOL=ipv4pool-ec2-xxxxxxx
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSEIP_PublicIpv4Pool_ -timeout 120m
=== RUN   TestAccAWSEIP_PublicIpv4Pool_default
=== PAUSE TestAccAWSEIP_PublicIpv4Pool_default
=== RUN   TestAccAWSEIP_PublicIpv4Pool_custom
=== PAUSE TestAccAWSEIP_PublicIpv4Pool_custom
=== CONT  TestAccAWSEIP_PublicIpv4Pool_default
=== CONT  TestAccAWSEIP_PublicIpv4Pool_custom
--- PASS: TestAccAWSEIP_PublicIpv4Pool_custom (11.02s)
--- PASS: TestAccAWSEIP_PublicIpv4Pool_default (11.12s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       11.160s

@ghost ghost added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 19, 2018
@kpumuk
Copy link

kpumuk commented Nov 19, 2018

Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this @mhorbul, this is looking pretty good. Also, thanks for rebasing this on the existing commits from the other pull request. A few tweaks and this should be able to get in. Please let us know if you have questions or do not have time to implement the feedback.

aws/resource_aws_eip.go Outdated Show resolved Hide resolved
aws/resource_aws_eip.go Show resolved Hide resolved
aws/resource_aws_eip_test.go Outdated Show resolved Hide resolved
aws/resource_aws_eip_test.go Outdated Show resolved Hide resolved
aws/resource_aws_eip_test.go Show resolved Hide resolved
website/docs/r/eip.html.markdown Outdated Show resolved Hide resolved
website/docs/r/eip.html.markdown Outdated Show resolved Hide resolved
@mhorbul
Copy link
Contributor Author

mhorbul commented Nov 19, 2018

@bflad Thank you for the feedback.

@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 19, 2018
@bflad bflad added this to the v1.46.0 milestone Nov 19, 2018
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks so much @mhorbul 🚀

--- PASS: TestAccAWSEIP_disappears (4.82s)
--- PASS: TestAccAWSEIP_basic (6.28s)
--- PASS: TestAccAWSEIP_PublicIpv4Pool_default (6.38s)
--- PASS: TestAccDataSourceAwsEip_Id (8.02s)
--- PASS: TestAccDataSourceAwsEip_PublicIP_VPC (8.07s)
--- PASS: TestAccDataSourceAwsEip_Filter (8.52s)
--- PASS: TestAccDataSourceAwsEip_Tags (10.98s)
--- PASS: TestAccAWSEIP_tags (11.09s)
--- PASS: TestAccDataSourceAwsEip_PublicIP_EC2Classic (16.28s)
--- PASS: TestAccAWSEIP_twoEIPsOneNetworkInterface (27.45s)
--- PASS: TestAccAWSEIP_network_interface (28.22s)
--- PASS: TestAccDataSourceAwsEip_NetworkInterface (28.60s)
--- PASS: TestAccAWSEIP_importVpc (33.78s)
--- PASS: TestAccAWSEIP_associated_user_private_ip (137.23s)
--- PASS: TestAccDataSourceAwsEip_Instance (150.10s)
--- PASS: TestAccAWSEIP_instance (182.89s)
--- PASS: TestAccAWSEIP_importEc2Classic (232.48s)
--- PASS: TestAccAWSEIP_classic_disassociate (291.84s)

@bflad bflad merged commit 01491a1 into hashicorp:master Nov 19, 2018
bflad added a commit that referenced this pull request Nov 19, 2018
@bflad
Copy link
Member

bflad commented Nov 20, 2018

This has been released in version 1.46.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
@mhorbul mhorbul deleted the byoip-support-for-eip branch April 2, 2020 17:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Support for EC2 Bring Your Own IP Addresses aws_eip_association data source
4 participants