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

aws_vpc: Add arn as an attribute for aws_vpc #5300

Merged
merged 1 commit into from
Jul 23, 2018

Conversation

MattMcNam
Copy link
Contributor

Fixes #5027

Changes proposed in this pull request:

  • Add arn attribute to aws_default_vpc resource, aws_vpc resource and data source

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=\(TestAccAWS\(Default\)?Vpc\|TestAccDataSourceAwsVpc\)_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=\(TestAccAWS\(Default\)?Vpc\|TestAccDataSourceAwsVpc\)_ -timeout 120m
=== RUN   TestAccAWSVpc_coreMismatchedDiffs
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (68.49s)
=== RUN   TestAccDataSourceAwsVpc_basic
--- PASS: TestAccDataSourceAwsVpc_basic (131.73s)
=== RUN   TestAccDataSourceAwsVpc_ipv6Associated
--- PASS: TestAccDataSourceAwsVpc_ipv6Associated (95.52s)
=== RUN   TestAccDataSourceAwsVpc_multipleCidr
--- PASS: TestAccDataSourceAwsVpc_multipleCidr (115.77s)
=== RUN   TestAccAWSVpc_importBasic
--- PASS: TestAccAWSVpc_importBasic (79.07s)
=== RUN   TestAccAWSDefaultVpc_basic
--- PASS: TestAccAWSDefaultVpc_basic (40.26s)
=== RUN   TestAccAWSVpc_basic
--- PASS: TestAccAWSVpc_basic (43.60s)
=== RUN   TestAccAWSVpc_enableIpv6
--- PASS: TestAccAWSVpc_enableIpv6 (124.12s)
=== RUN   TestAccAWSVpc_dedicatedTenancy
--- PASS: TestAccAWSVpc_dedicatedTenancy (46.50s)
=== RUN   TestAccAWSVpc_modifyTenancy
--- PASS: TestAccAWSVpc_modifyTenancy (119.07s)
=== RUN   TestAccAWSVpc_tags
--- PASS: TestAccAWSVpc_tags (78.43s)
=== RUN   TestAccAWSVpc_update
--- PASS: TestAccAWSVpc_update (79.10s)
=== RUN   TestAccAWSVpc_bothDnsOptionsSet
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (20.37s)
=== RUN   TestAccAWSVpc_DisabledDnsSupport
--- PASS: TestAccAWSVpc_DisabledDnsSupport (41.94s)
=== RUN   TestAccAWSVpc_classiclinkOptionSet
--- PASS: TestAccAWSVpc_classiclinkOptionSet (44.46s)
=== RUN   TestAccAWSVpc_classiclinkDnsSupportOptionSet
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (43.84s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1172.322s

Output from Terraform test:

$ cat main.tf
provider "aws" {
  profile = "personal"
  region  = "eu-west-1"
}

# Externally created VPC to test data source
data "aws_vpc" "external" {
  id = "vpc-4ce9b52a"
}
output "data_source" {
  value = "${data.aws_vpc.external.arn}"
}

# Default VPC
resource "aws_default_vpc" "default" {}
output "default_vpc" {
  value = "${aws_default_vpc.default.arn}"
}

# Terraform managed
resource "aws_vpc" "foo" {
  cidr_block = "11.0.0.0/16"
}
output "terraform_vpc" {
  value = "${aws_vpc.foo.arn}"
}

...

data_source = arn:aws:ec2:eu-west-1:328265934943:vpc/vpc-4ce9b52a
default_vpc = arn:aws:ec2:eu-west-1:328265934943:vpc/vpc-93510cf7
terraform_vpc = arn:aws:ec2:eu-west-1:328265934943:vpc/vpc-63e8b405

@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Jul 23, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels Jul 23, 2018
@bflad bflad added this to the v1.29.0 milestone Jul 23, 2018
Copy link
Contributor

@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.

Looks great, @MattMcNam! Thanks! 🚀

16 tests passed (all tests)
=== RUN   TestAccAWSDefaultVpc_basic
--- PASS: TestAccAWSDefaultVpc_basic (14.16s)
=== RUN   TestAccAWSVpc_basic
--- PASS: TestAccAWSVpc_basic (17.48s)
=== RUN   TestAccAWSVpc_dedicatedTenancy
--- PASS: TestAccAWSVpc_dedicatedTenancy (18.44s)
=== RUN   TestAccDataSourceAwsVpc_ipv6Associated
--- PASS: TestAccDataSourceAwsVpc_ipv6Associated (23.69s)
=== RUN   TestAccAWSVpc_importBasic
--- PASS: TestAccAWSVpc_importBasic (23.64s)
=== RUN   TestAccAWSVpc_coreMismatchedDiffs
--- PASS: TestAccAWSVpc_coreMismatchedDiffs (27.73s)
=== RUN   TestAccAWSVpc_classiclinkDnsSupportOptionSet
--- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (28.32s)
=== RUN   TestAccAWSVpc_update
--- PASS: TestAccAWSVpc_update (28.99s)
=== RUN   TestAccAWSVpc_bothDnsOptionsSet
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (34.42s)
=== RUN   TestAccDataSourceAwsVpc_multipleCidr
--- PASS: TestAccDataSourceAwsVpc_multipleCidr (34.69s)
=== RUN   TestAccAWSVpc_classiclinkOptionSet
--- PASS: TestAccAWSVpc_classiclinkOptionSet (35.57s)
=== RUN   TestAccAWSVpc_DisabledDnsSupport
--- PASS: TestAccAWSVpc_DisabledDnsSupport (36.94s)
=== RUN   TestAccAWSVpc_tags
--- PASS: TestAccAWSVpc_tags (38.42s)
=== RUN   TestAccDataSourceAwsVpc_basic
--- PASS: TestAccDataSourceAwsVpc_basic (39.21s)
=== RUN   TestAccAWSVpc_enableIpv6
--- PASS: TestAccAWSVpc_enableIpv6 (40.11s)
=== RUN   TestAccAWSVpc_modifyTenancy
--- PASS: TestAccAWSVpc_modifyTenancy (46.84s)

@bflad bflad merged commit 32c6614 into hashicorp:master Jul 23, 2018
@bflad
Copy link
Contributor

bflad commented Jul 23, 2018

Ha after I merged this, I realize I neglected to mention that documentation was missing in:

  • website/docs/d/vpc.html.markdown
  • website/docs/r/vpc.html.markdown
  • website/docs/r/default_vpc.html.markdown

I'll go ahead an get the attribute added in the documentation right now so its not lost. Sorry about that!

bflad added a commit that referenced this pull request Jul 23, 2018
bflad added a commit that referenced this pull request Jul 23, 2018
@MattMcNam
Copy link
Contributor Author

Ah of course, completely slipped my mind. Thanks @bflad!

@MattMcNam MattMcNam deleted the aws_vpc_arn branch July 23, 2018 18:31
bflad added a commit that referenced this pull request Jul 25, 2018
@bflad
Copy link
Contributor

bflad commented Jul 26, 2018

This has been released in version 1.29.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 4, 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 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add arn as an attribute for aws_vpc
2 participants