Terraform-provider-aws: New DataSource: aws_dx_gateway

Created on 26 Jun 2018  ·  5Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

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.

New or Affected Resource(s)

  • aws_dx_gateway
  • aws_dx_gateway_assocation

Potential Terraform Configuration

# 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}"
}

References

  • https://github.com/terraform-providers/terraform-provider-aws/pull/2861

  • https://github.com/terraform-providers/terraform-provider-aws/pull/4896
  • new-data-source servicdirectconnect

    Most helpful comment

    A new aws_dx_gateway data source has been merged and will release with version 1.25.0 of the AWS provider, likely tomorrow.

    All 5 comments

    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!

    Was this page helpful?
    0 / 5 - 0 ratings

    Related issues

    gothrek22 picture gothrek22  ·  3Comments

    reedloden picture reedloden  ·  3Comments

    dvishniakov picture dvishniakov  ·  3Comments

    hashibot picture hashibot  ·  3Comments

    hashibot picture hashibot  ·  3Comments