-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add 'aws_dx_hosted_public_virtual_interface'/'aws_dx_hosted_public_virtual_interface_accepter' resources #3254
Conversation
Acceptance tests require an active Direct Connect connection which should be specified via the
|
Add 'aws_dx_hosted_public_virtual_interface_accepter' resource.
Rebased to remove conflicts. |
Confirming acceptance tests in $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxHostedPublicVirtualInterface_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsDxHostedPublicVirtualInterface_ -timeout 120m
=== RUN TestAccAwsDxHostedPublicVirtualInterface_basic
--- PASS: TestAccAwsDxHostedPublicVirtualInterface_basic (35.80s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 35.814s |
Changes after code review on #3253. $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxHostedPublicVirtualInterface_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsDxHostedPublicVirtualInterface_ -timeout 120m
=== RUN TestAccAwsDxHostedPublicVirtualInterface_basic
--- PASS: TestAccAwsDxHostedPublicVirtualInterface_basic (44.49s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 57.978s |
Changes after additional code review on #3255. $ terraform apply
aws_dx_hosted_public_virtual_interface.creator: Creating...
address_family: "" => "ipv4"
amazon_address: "" => "175.45.176.2/30"
arn: "" => "<computed>"
bgp_asn: "" => "65352"
bgp_auth_key: "" => "<computed>"
connection_id: "" => "dxcon-ffffffff"
customer_address: "" => "175.45.176.1/30"
name: "" => "vif-foo"
owner_account_id: "" => "000000000000"
route_filter_prefixes.#: "" => "2"
route_filter_prefixes.1752038751: "" => "210.52.109.0/24"
route_filter_prefixes.4290081960: "" => "175.45.176.0/22"
vlan: "" => "4094"
aws_dx_hosted_public_virtual_interface.creator: Still creating... (10s elapsed)
aws_dx_hosted_public_virtual_interface.creator: Creation complete after 13s (ID: dxvif-ffffffff)
aws_dx_hosted_public_virtual_interface_accepter.accepter: Creating...
arn: "" => "<computed>"
tags.%: "" => "1"
tags.Side: "" => "Accepter"
virtual_interface_id: "" => "dxvif-ffffffff"
aws_dx_hosted_public_virtual_interface_accepter.accepter: Still creating... (10s elapsed)
aws_dx_hosted_public_virtual_interface_accepter.accepter: Creation complete after 12s (ID: dxvif-ffffffff)
Apply complete! Resources: 2 added, 0 changed, 0 destroyed. $ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.aws_caller_identity.accepter: Refreshing state...
aws_dx_hosted_public_virtual_interface.creator: Refreshing state... (ID: dxvif-ffffffff)
aws_dx_hosted_public_virtual_interface_accepter.accepter: Refreshing state... (ID: dxvif-ffffffff)
------------------------------------------------------------------------
No changes. Infrastructure is up-to-date. $ terraform destroy
data.aws_caller_identity.accepter: Refreshing state...
aws_dx_hosted_public_virtual_interface.creator: Refreshing state... (ID: dxvif-ffffffff)
aws_dx_hosted_public_virtual_interface_accepter.accepter: Refreshing state... (ID: dxvif-ffffffff)
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
- destroy
Terraform will perform the following actions:
- aws_dx_hosted_public_virtual_interface.creator
- aws_dx_hosted_public_virtual_interface_accepter.accepter
Plan: 0 to add, 0 to change, 2 to destroy.
Do you really want to destroy?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
aws_dx_hosted_public_virtual_interface_accepter.accepter: Destroying... (ID: dxvif-ffffffff)
aws_dx_hosted_public_virtual_interface_accepter.accepter: Destruction complete after 0s
aws_dx_hosted_public_virtual_interface.creator: Destroying... (ID: dxvif-ffffffff)
aws_dx_hosted_public_virtual_interface.creator: Still destroying... (ID: dxvif-ffffffff, 10s elapsed)
aws_dx_hosted_public_virtual_interface.creator: Destruction complete after 11s
Destroy complete! Resources: 2 destroyed. |
Acceptance tests in ´eu-central-1` $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxHostedPublicVirtualInterface_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsDxHostedPublicVirtualInterface_ -timeout 120m
=== RUN TestAccAwsDxHostedPublicVirtualInterface_basic
--- PASS: TestAccAwsDxHostedPublicVirtualInterface_basic (48.61s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 48.620s |
Here is a small test case provider "aws" {
max_retries = 3
region = "eu-central-1"
profile = "connect"
}
provider "aws" {
max_retries = 3
region = "eu-central-1"
profile = "devops"
alias = "accepter"
}
variable "connection_id" {
default = "dxcon-zzzzzzzz"
}
data "aws_caller_identity" "accepter" {
provider = "aws.accepter"
}
resource "aws_dx_hosted_public_virtual_interface" "test" {
connection_id = "${var.connection_id}"
owner_account_id = "${data.aws_caller_identity.accepter.account_id}"
name = "vif-test"
vlan = 1
address_family = "ipv4"
bgp_asn = 65001
customer_address = "175.45.176.1/30"
amazon_address = "175.45.176.2/30"
route_filter_prefixes = [
"210.52.109.0/24",
"175.45.176.0/22",
]
}
resource "aws_dx_hosted_public_virtual_interface_accepter" "test" {
virtual_interface_id = "${aws_dx_hosted_public_virtual_interface.test.id}"
provider = "aws.accepter"
} $ terraform apply
data.aws_caller_identity.accepter: Refreshing state...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_dx_hosted_public_virtual_interface.test
id: <computed>
address_family: "ipv4"
amazon_address: "175.45.176.2/30"
arn: <computed>
bgp_asn: "65001"
bgp_auth_key: <computed>
connection_id: "dxcon-zzzzzzzz"
customer_address: "175.45.176.1/30"
name: "vif-test"
owner_account_id: "012345678901"
route_filter_prefixes.#: "2"
route_filter_prefixes.1752038751: "210.52.109.0/24"
route_filter_prefixes.4290081960: "175.45.176.0/22"
vlan: "1"
+ aws_dx_hosted_public_virtual_interface_accepter.test
id: <computed>
arn: <computed>
virtual_interface_id: "${aws_dx_hosted_public_virtual_interface.test.id}"
Plan: 2 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_dx_hosted_public_virtual_interface.test: Creating...
address_family: "" => "ipv4"
amazon_address: "" => "175.45.176.2/30"
arn: "" => "<computed>"
bgp_asn: "" => "65001"
bgp_auth_key: "" => "<computed>"
connection_id: "" => "dxcon-zzzzzzzz"
customer_address: "" => "175.45.176.1/30"
name: "" => "vif-test"
owner_account_id: "" => "012345678901"
route_filter_prefixes.#: "" => "2"
route_filter_prefixes.1752038751: "" => "210.52.109.0/24"
route_filter_prefixes.4290081960: "" => "175.45.176.0/22"
vlan: "" => "1"
aws_dx_hosted_public_virtual_interface.test: Still creating... (10s elapsed)
aws_dx_hosted_public_virtual_interface.test: Creation complete after 11s (ID: dxvif-fgpr4aja)
aws_dx_hosted_public_virtual_interface_accepter.test: Creating...
arn: "" => "<computed>"
virtual_interface_id: "" => "dxvif-fgpr4aja"
aws_dx_hosted_public_virtual_interface_accepter.test: Still creating... (10s elapsed)
aws_dx_hosted_public_virtual_interface_accepter.test: Creation complete after 11s (ID: dxvif-fgpr4aja)
Apply complete! Resources: 2 added, 0 changed, 0 destroyed. $ terraform apply
data.aws_caller_identity.accepter: Refreshing state...
aws_dx_hosted_public_virtual_interface.test: Refreshing state... (ID: dxvif-fgpr4aja)
aws_dx_hosted_public_virtual_interface_accepter.test: Refreshing state... (ID: dxvif-fgpr4aja)
Apply complete! Resources: 0 added, 0 changed, 0 destroyed. $ terraform destroy
data.aws_caller_identity.accepter: Refreshing state...
aws_dx_hosted_public_virtual_interface.test: Refreshing state... (ID: dxvif-fgpr4aja)
aws_dx_hosted_public_virtual_interface_accepter.test: Refreshing state... (ID: dxvif-fgpr4aja)
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
- destroy
Terraform will perform the following actions:
- aws_dx_hosted_public_virtual_interface.test
- aws_dx_hosted_public_virtual_interface_accepter.test
Plan: 0 to add, 0 to change, 2 to destroy.
Do you really want to destroy?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
aws_dx_hosted_public_virtual_interface_accepter.test: Destroying... (ID: dxvif-fgpr4aja)
aws_dx_hosted_public_virtual_interface_accepter.test: Destruction complete after 0s
aws_dx_hosted_public_virtual_interface.test: Destroying... (ID: dxvif-fgpr4aja)
aws_dx_hosted_public_virtual_interface.test: Still destroying... (ID: dxvif-fgpr4aja, 10s elapsed)
aws_dx_hosted_public_virtual_interface.test: Destruction complete after 11s
Destroy complete! Resources: 2 destroyed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @ewbankkit thanks for all your work here! 🚀
This has been released in version 1.25.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes #3250.
aws/dx_vif.go
and changes toaws/utils*.go
shared with:aws/tagsDX*.go
copied from: