Following the addition of aws_dx_gateway and aws_dx_gateway_assocation resources, it would very useful to have access to an 'aws_dx_gateway' DataSource to allow for dynamic and variable based configurations. Particularly relevant in a multi regions/accounts scenario. See example below.
# Global role
resource "aws_dx_gateway" "test" {
name = "${var.dxgw_name}"
amazon_side_asn = "${ ... }"
}
# Regional role
data "aws_dx_gateway" "test" {
count = "${var.is_aws_dx_enable ? 1 : 0}"
name = "${var.dxgw_name}"
}
resource "aws_vpn_gateway" "test" {
vpc_id = "${aws_vpc.test.id}"
}
resource "aws_dx_gateway_association" "test" {
count = "${var.is_aws_dx_enable ? 1 : 0}"
dx_gateway_id = "${data.aws_dx_gateway.test.id}"
vpn_gateway_id = "${aws_vpn_gateway.test.id}"
}
https://github.com/terraform-providers/terraform-provider-aws/pull/2861
I can submit a pull request for this today or tomorrow. 👍
Pull request submitted: #4988
A new aws_dx_gateway data source has been merged and will release with version 1.25.0 of the AWS provider, likely tomorrow.
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!
Most helpful comment
A new
aws_dx_gatewaydata source has been merged and will release with version 1.25.0 of the AWS provider, likely tomorrow.