From 50fe83e43f9ec0b4d9c7bd929df70047bb0f44c4 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 10 Jul 2020 16:51:16 -0400 Subject: [PATCH] service/directconnect: Remove vpn_gateway_id arguments Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/13398 Changes: ``` * resource/aws_dx_gateway_association: Remove `vpn_gateway_id` argument * resource/aws_dx_gateway_association_proposal: Remove `vpn_gateway_id` argument ``` Output from acceptance testing: ``` --- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewaySingleAccount (2063.56s) --- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewayCrossAccount (2556.75s) --- PASS: TestAccAwsDxGatewayAssociation_multiVpnGatewaysSingleAccount (2668.06s) --- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewaySingleAccount (2674.09s) --- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewayCrossAccount (2677.20s) --- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewaySingleAccount (3612.36s) --- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewayCrossAccount (3856.32s) --- PASS: TestAccAwsDxGatewayAssociationProposal_basicVpnGateway (88.64s) --- PASS: TestAccAwsDxGatewayAssociationProposal_disappears (96.50s) --- PASS: TestAccAwsDxGatewayAssociationProposal_AllowedPrefixes (121.18s) --- PASS: TestAccAwsDxGatewayAssociationProposal_basicTransitGateway (182.42s) ``` --- aws/resource_aws_dx_gateway_association.go | 43 ++++----------- ...urce_aws_dx_gateway_association_migrate.go | 1 - ...rce_aws_dx_gateway_association_proposal.go | 33 ++---------- ...ws_dx_gateway_association_proposal_test.go | 45 ---------------- ...esource_aws_dx_gateway_association_test.go | 45 ---------------- website/docs/guides/version-3-upgrade.html.md | 54 +++++++++++++++++++ .../r/dx_gateway_association.html.markdown | 4 +- ...gateway_association_proposal.html.markdown | 5 +- 8 files changed, 70 insertions(+), 160 deletions(-) diff --git a/aws/resource_aws_dx_gateway_association.go b/aws/resource_aws_dx_gateway_association.go index 0509e5e5836..f87846964d9 100644 --- a/aws/resource_aws_dx_gateway_association.go +++ b/aws/resource_aws_dx_gateway_association.go @@ -1,7 +1,6 @@ package aws import ( - "errors" "fmt" "log" "strings" @@ -49,7 +48,7 @@ func resourceAwsDxGatewayAssociation() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - ConflictsWith: []string{"associated_gateway_owner_account_id", "proposal_id", "vpn_gateway_id"}, + ConflictsWith: []string{"associated_gateway_owner_account_id", "proposal_id"}, }, "associated_gateway_owner_account_id": { @@ -58,7 +57,7 @@ func resourceAwsDxGatewayAssociation() *schema.Resource { Computed: true, ForceNew: true, ValidateFunc: validateAwsAccountId, - ConflictsWith: []string{"associated_gateway_id", "vpn_gateway_id"}, + ConflictsWith: []string{"associated_gateway_id"}, }, "associated_gateway_type": { @@ -86,15 +85,7 @@ func resourceAwsDxGatewayAssociation() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - ConflictsWith: []string{"associated_gateway_id", "vpn_gateway_id"}, - }, - - "vpn_gateway_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"associated_gateway_id", "associated_gateway_owner_account_id", "proposal_id"}, - Deprecated: "use 'associated_gateway_id' argument instead", + ConflictsWith: []string{"associated_gateway_id"}, }, }, @@ -111,7 +102,6 @@ func resourceAwsDxGatewayAssociationCreate(d *schema.ResourceData, meta interfac dxgwId := d.Get("dx_gateway_id").(string) gwIdRaw, gwIdOk := d.GetOk("associated_gateway_id") - vgwIdRaw, vgwIdOk := d.GetOk("vpn_gateway_id") gwAcctIdRaw, gwAcctIdOk := d.GetOk("associated_gateway_owner_account_id") proposalIdRaw, proposalIdOk := d.GetOk("proposal_id") @@ -120,8 +110,8 @@ func resourceAwsDxGatewayAssociationCreate(d *schema.ResourceData, meta interfac if !(gwAcctIdOk && proposalIdOk) { return fmt.Errorf("associated_gateway_owner_account_id and proposal_id must be configured") } - } else if !(gwIdOk || vgwIdOk) { - return fmt.Errorf("either associated_gateway_owner_account_id and proposal_id or one of associated_gateway_id or vpn_gateway_id must be configured") + } else if !gwIdOk { + return fmt.Errorf("either associated_gateway_owner_account_id and proposal_id, or associated_gateway_id, must be configured") } associationId := "" @@ -143,17 +133,12 @@ func resourceAwsDxGatewayAssociationCreate(d *schema.ResourceData, meta interfac associationId = aws.StringValue(resp.DirectConnectGatewayAssociation.AssociationId) d.SetId(dxGatewayAssociationId(dxgwId, aws.StringValue(resp.DirectConnectGatewayAssociation.AssociatedGateway.Id))) } else { + gwId := gwIdRaw.(string) + req := &directconnect.CreateDirectConnectGatewayAssociationInput{ AddAllowedPrefixesToDirectConnectGateway: expandDxRouteFilterPrefixes(d.Get("allowed_prefixes").(*schema.Set)), DirectConnectGatewayId: aws.String(dxgwId), - } - gwId := "" - if gwIdOk { - gwId = gwIdRaw.(string) - req.GatewayId = aws.String(gwId) - } else { - gwId = vgwIdRaw.(string) - req.VirtualGatewayId = aws.String(gwId) + GatewayId: aws.String(gwId), } log.Printf("[DEBUG] Creating Direct Connect gateway association: %#v", req) @@ -196,11 +181,7 @@ func resourceAwsDxGatewayAssociationRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("error setting allowed_prefixes: %s", err) } - if _, ok := d.GetOk("vpn_gateway_id"); ok { - d.Set("vpn_gateway_id", assoc.VirtualGatewayId) - } else { - d.Set("associated_gateway_id", assoc.AssociatedGateway.Id) - } + d.Set("associated_gateway_id", assoc.AssociatedGateway.Id) d.Set("associated_gateway_owner_account_id", assoc.AssociatedGateway.OwnerAccount) d.Set("associated_gateway_type", assoc.AssociatedGateway.Type) d.Set("dx_gateway_association_id", assoc.AssociationId) @@ -213,12 +194,6 @@ func resourceAwsDxGatewayAssociationRead(d *schema.ResourceData, meta interface{ func resourceAwsDxGatewayAssociationUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).dxconn - _, gwIdOk := d.GetOk("associated_gateway_id") - _, vgwIdOk := d.GetOk("vpn_gateway_id") - if !gwIdOk && !vgwIdOk { - return errors.New("one of associated_gateway_id or vpn_gateway_id must be configured") - } - if d.HasChange("allowed_prefixes") { associationId := d.Get("dx_gateway_association_id").(string) diff --git a/aws/resource_aws_dx_gateway_association_migrate.go b/aws/resource_aws_dx_gateway_association_migrate.go index 8986f1d80ac..48c1ba38623 100644 --- a/aws/resource_aws_dx_gateway_association_migrate.go +++ b/aws/resource_aws_dx_gateway_association_migrate.go @@ -69,7 +69,6 @@ func resourceAwsDxGatewayAssociationResourceV0() *schema.Resource { Optional: true, ForceNew: true, ConflictsWith: []string{"associated_gateway_id", "associated_gateway_owner_account_id", "proposal_id"}, - Deprecated: "use 'associated_gateway_id' argument instead", }, }, } diff --git a/aws/resource_aws_dx_gateway_association_proposal.go b/aws/resource_aws_dx_gateway_association_proposal.go index 26b463a579b..ec864f6cad6 100644 --- a/aws/resource_aws_dx_gateway_association_proposal.go +++ b/aws/resource_aws_dx_gateway_association_proposal.go @@ -43,10 +43,9 @@ func resourceAwsDxGatewayAssociationProposal() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, }, "associated_gateway_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"vpn_gateway_id"}, + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "associated_gateway_owner_account_id": { Type: schema.TypeString, @@ -67,13 +66,6 @@ func resourceAwsDxGatewayAssociationProposal() *schema.Resource { ForceNew: true, ValidateFunc: validateAwsAccountId, }, - "vpn_gateway_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"associated_gateway_id"}, - Deprecated: "use 'associated_gateway_id' argument instead", - }, }, } } @@ -86,20 +78,9 @@ func resourceAwsDxGatewayAssociationProposalCreate(d *schema.ResourceData, meta AddAllowedPrefixesToDirectConnectGateway: allowedPrefixes, DirectConnectGatewayId: aws.String(d.Get("dx_gateway_id").(string)), DirectConnectGatewayOwnerAccount: aws.String(d.Get("dx_gateway_owner_account_id").(string)), - } - var gwID string - if v, ok := d.GetOk("vpn_gateway_id"); ok { - gwID = v.(string) - } else if v, ok := d.GetOk("associated_gateway_id"); ok { - gwID = v.(string) + GatewayId: aws.String(d.Get("associated_gateway_id").(string)), } - if gwID == "" { - return fmt.Errorf("gateway id not provided, one of associated_gateway_id or vpn_gateway_id must be configured") - } - - input.GatewayId = aws.String(gwID) - log.Printf("[DEBUG] Creating Direct Connect Gateway Association Proposal: %s", input) output, err := conn.CreateDirectConnectGatewayAssociationProposal(input) @@ -141,11 +122,7 @@ func resourceAwsDxGatewayAssociationProposalRead(d *schema.ResourceData, meta in return fmt.Errorf("error setting allowed_prefixes: %s", err) } - if _, ok := d.GetOk("vpn_gateway_id"); ok { - d.Set("vpn_gateway_id", aws.StringValue(proposal.AssociatedGateway.Id)) - } else { - d.Set("associated_gateway_id", aws.StringValue(proposal.AssociatedGateway.Id)) - } + d.Set("associated_gateway_id", aws.StringValue(proposal.AssociatedGateway.Id)) d.Set("associated_gateway_owner_account_id", proposal.AssociatedGateway.OwnerAccount) d.Set("associated_gateway_type", proposal.AssociatedGateway.Type) d.Set("dx_gateway_id", aws.StringValue(proposal.DirectConnectGatewayId)) diff --git a/aws/resource_aws_dx_gateway_association_proposal_test.go b/aws/resource_aws_dx_gateway_association_proposal_test.go index fea243c4846..ba5449a341a 100644 --- a/aws/resource_aws_dx_gateway_association_proposal_test.go +++ b/aws/resource_aws_dx_gateway_association_proposal_test.go @@ -78,39 +78,6 @@ func testSweepDirectConnectGatewayAssociationProposals(region string) error { return nil } -func TestAccAwsDxGatewayAssociationProposal_VpnGatewayId(t *testing.T) { - var proposal1 directconnect.GatewayAssociationProposal - var providers []*schema.Provider - rBgpAsn := randIntRange(64512, 65534) - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_dx_gateway_association_proposal.test" - resourceNameDxGw := "aws_dx_gateway.test" - resourceNameVgw := "aws_vpn_gateway.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - testAccAlternateAccountPreCheck(t) - }, - ProviderFactories: testAccProviderFactories(&providers), - CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDxGatewayAssociationProposalConfig_vpnGatewayId(rName, rBgpAsn), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxGatewayAssociationProposalExists(resourceName, &proposal1), - resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), - resource.TestCheckResourceAttrPair(resourceName, "vpn_gateway_id", resourceNameVgw, "id"), - resource.TestCheckNoResourceAttr(resourceName, "associated_gateway_id"), - testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), - resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "virtualPrivateGateway"), - resource.TestCheckResourceAttr(resourceName, "allowed_prefixes.#", "1"), - ), - }, - }, - }) -} - func TestAccAwsDxGatewayAssociationProposal_basicVpnGateway(t *testing.T) { var proposal1 directconnect.GatewayAssociationProposal var providers []*schema.Provider @@ -134,7 +101,6 @@ func TestAccAwsDxGatewayAssociationProposal_basicVpnGateway(t *testing.T) { testAccCheckAwsDxGatewayAssociationProposalExists(resourceName, &proposal1), resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), resource.TestCheckResourceAttrPair(resourceName, "associated_gateway_id", resourceNameVgw, "id"), - resource.TestCheckNoResourceAttr(resourceName, "vpn_gateway_id"), testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "virtualPrivateGateway"), resource.TestCheckResourceAttr(resourceName, "allowed_prefixes.#", "1"), @@ -173,7 +139,6 @@ func TestAccAwsDxGatewayAssociationProposal_basicTransitGateway(t *testing.T) { testAccCheckAwsDxGatewayAssociationProposalExists(resourceName, &proposal1), resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), resource.TestCheckResourceAttrPair(resourceName, "associated_gateway_id", resourceNameTgw, "id"), - resource.TestCheckNoResourceAttr(resourceName, "vpn_gateway_id"), testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "transitGateway"), resource.TestCheckResourceAttr(resourceName, "allowed_prefixes.#", "2"), @@ -358,16 +323,6 @@ resource "aws_vpn_gateway" "test" { `, rName, rBgpAsn) } -func testAccDxGatewayAssociationProposalConfig_vpnGatewayId(rName string, rBgpAsn int) string { - return testAccDxGatewayAssociationProposalConfigBase_vpnGateway(rName, rBgpAsn) + fmt.Sprintf(` -resource "aws_dx_gateway_association_proposal" "test" { - dx_gateway_id = "${aws_dx_gateway.test.id}" - dx_gateway_owner_account_id = "${aws_dx_gateway.test.owner_account_id}" - vpn_gateway_id = "${aws_vpn_gateway.test.id}" -} -`) -} - func testAccDxGatewayAssociationProposalConfig_basicVpnGateway(rName string, rBgpAsn int) string { return testAccDxGatewayAssociationProposalConfigBase_vpnGateway(rName, rBgpAsn) + fmt.Sprintf(` resource "aws_dx_gateway_association_proposal" "test" { diff --git a/aws/resource_aws_dx_gateway_association_test.go b/aws/resource_aws_dx_gateway_association_test.go index 916a1a97e34..7c578966202 100644 --- a/aws/resource_aws_dx_gateway_association_test.go +++ b/aws/resource_aws_dx_gateway_association_test.go @@ -182,38 +182,6 @@ func testSweepDirectConnectGatewayAssociations(region string) error { return nil } -func TestAccAwsDxGatewayAssociation_deprecatedSingleAccount(t *testing.T) { - resourceName := "aws_dx_gateway_association.test" - resourceNameDxGw := "aws_dx_gateway.test" - resourceNameVgw := "aws_vpn_gateway.test" - rName := fmt.Sprintf("terraform-testacc-dxgwassoc-%d", acctest.RandInt()) - rBgpAsn := randIntRange(64512, 65534) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDxGatewayAssociationConfig_deprecatedSingleAccount(rName, rBgpAsn), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxGatewayAssociationExists(resourceName), - resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), - resource.TestCheckResourceAttrPair(resourceName, "vpn_gateway_id", resourceNameVgw, "id"), - resource.TestCheckResourceAttrSet(resourceName, "dx_gateway_association_id"), - resource.TestCheckNoResourceAttr(resourceName, "associated_gateway_id"), - resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "virtualPrivateGateway"), - testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), - testAccCheckResourceAttrAccountID(resourceName, "dx_gateway_owner_account_id"), - resource.TestCheckResourceAttr(resourceName, "allowed_prefixes.#", "1"), - tfawsresource.TestCheckTypeSetElemAttr(resourceName, "allowed_prefixes.*", "10.255.255.0/28"), - testAccCheckAwsDxGatewayAssociationStateUpgradeV0(resourceName), - ), - }, - }, - }) -} - func TestAccAwsDxGatewayAssociation_basicVpnGatewaySingleAccount(t *testing.T) { resourceName := "aws_dx_gateway_association.test" resourceNameDxGw := "aws_dx_gateway.test" @@ -233,7 +201,6 @@ func TestAccAwsDxGatewayAssociation_basicVpnGatewaySingleAccount(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), resource.TestCheckResourceAttrPair(resourceName, "associated_gateway_id", resourceNameVgw, "id"), resource.TestCheckResourceAttrSet(resourceName, "dx_gateway_association_id"), - resource.TestCheckNoResourceAttr(resourceName, "vpn_gateway_id"), resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "virtualPrivateGateway"), testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), testAccCheckResourceAttrAccountID(resourceName, "dx_gateway_owner_account_id"), @@ -281,7 +248,6 @@ func TestAccAwsDxGatewayAssociation_basicVpnGatewayCrossAccount(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), resource.TestCheckResourceAttrPair(resourceName, "associated_gateway_id", resourceNameVgw, "id"), resource.TestCheckResourceAttrSet(resourceName, "dx_gateway_association_id"), - resource.TestCheckNoResourceAttr(resourceName, "vpn_gateway_id"), resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "virtualPrivateGateway"), testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), // dx_gateway_owner_account_id is the "aws.alternate" provider's account ID. @@ -313,7 +279,6 @@ func TestAccAwsDxGatewayAssociation_basicTransitGatewaySingleAccount(t *testing. resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), resource.TestCheckResourceAttrPair(resourceName, "associated_gateway_id", resourceNameTgw, "id"), resource.TestCheckResourceAttrSet(resourceName, "dx_gateway_association_id"), - resource.TestCheckNoResourceAttr(resourceName, "vpn_gateway_id"), resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "transitGateway"), testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), testAccCheckResourceAttrAccountID(resourceName, "dx_gateway_owner_account_id"), @@ -362,7 +327,6 @@ func TestAccAwsDxGatewayAssociation_basicTransitGatewayCrossAccount(t *testing.T resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", resourceNameDxGw, "id"), resource.TestCheckResourceAttrPair(resourceName, "associated_gateway_id", resourceNameTgw, "id"), resource.TestCheckResourceAttrSet(resourceName, "dx_gateway_association_id"), - resource.TestCheckNoResourceAttr(resourceName, "vpn_gateway_id"), resource.TestCheckResourceAttr(resourceName, "associated_gateway_type", "transitGateway"), testAccCheckResourceAttrAccountID(resourceName, "associated_gateway_owner_account_id"), // dx_gateway_owner_account_id is the "aws.alternate" provider's account ID. @@ -615,15 +579,6 @@ resource "aws_dx_gateway" "test" { `, rName, rBgpAsn) } -func testAccDxGatewayAssociationConfig_deprecatedSingleAccount(rName string, rBgpAsn int) string { - return testAccDxGatewayAssociationConfigBase_vpnGatewaySingleAccount(rName, rBgpAsn) + fmt.Sprintf(` -resource "aws_dx_gateway_association" "test" { - dx_gateway_id = "${aws_dx_gateway.test.id}" - vpn_gateway_id = "${aws_vpn_gateway_attachment.test.vpn_gateway_id}" -} -`) -} - func testAccDxGatewayAssociationConfig_basicVpnGatewaySingleAccount(rName string, rBgpAsn int) string { return testAccDxGatewayAssociationConfigBase_vpnGatewaySingleAccount(rName, rBgpAsn) + fmt.Sprintf(` resource "aws_dx_gateway_association" "test" { diff --git a/website/docs/guides/version-3-upgrade.html.md b/website/docs/guides/version-3-upgrade.html.md index c0a4bf9b1c2..b9e89a9658b 100644 --- a/website/docs/guides/version-3-upgrade.html.md +++ b/website/docs/guides/version-3-upgrade.html.md @@ -21,6 +21,8 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) - [Data Source: aws_availability_zones](#data-source-aws_availability_zones) - [Data Source: aws_lambda_invocation](#data-source-aws_lambda_invocation) +- [Resource: aws_dx_gateway_association](#resource-aws_dx_gateway_association) +- [Resource: aws_dx_gateway_association_proposal](#resource-aws_dx_gateway_association_proposal) - [Resource: aws_emr_cluster](#resource-aws_emr_cluster) @@ -121,6 +123,58 @@ output "lambda_result" { } ``` +## Resource: aws_dx_gateway_association + +### vpn_gateway_id Argument Removal + +Switch your Terraform configuration to the `associated_gateway_id` argument instead. + +For example, given this previous configuration: + +```hcl +resource "aws_dx_gateway_association" "example" { + # ... other configuration ... + + vpn_gateway_id = aws_vpn_gateway.example.id +} +``` + +An updated configuration: + +```hcl +resource "aws_dx_gateway_association" "example" { + # ... other configuration ... + + associated_gateway_id = aws_vpn_gateway.example.id +} +``` + +## Resource: aws_dx_gateway_association_proposal + +### vpn_gateway_id Argument Removal + +Switch your Terraform configuration to the `associated_gateway_id` argument instead. + +For example, given this previous configuration: + +```hcl +resource "aws_dx_gateway_association_proposal" "example" { + # ... other configuration ... + + vpn_gateway_id = aws_vpn_gateway.example.id +} +``` + +An updated configuration: + +```hcl +resource "aws_dx_gateway_association_proposal" "example" { + # ... other configuration ... + + associated_gateway_id = aws_vpn_gateway.example.id +} +``` + ## Resource: aws_emr_cluster ### core_instance_count Argument Removal diff --git a/website/docs/r/dx_gateway_association.html.markdown b/website/docs/r/dx_gateway_association.html.markdown index 76113a95256..39279911ba7 100644 --- a/website/docs/r/dx_gateway_association.html.markdown +++ b/website/docs/r/dx_gateway_association.html.markdown @@ -90,15 +90,13 @@ A full example of how to create a VPN Gateway in one AWS account, create a Direc ## Argument Reference -~> **NOTE:** `dx_gateway_id` plus one of `associated_gateway_id`, or `vpn_gateway_id` must be specified for single account Direct Connect gateway associations. +~> **NOTE:** `dx_gateway_id` and `associated_gateway_id` must be specified for single account Direct Connect gateway associations. The following arguments are supported: * `dx_gateway_id` - (Required) The ID of the Direct Connect gateway. * `associated_gateway_id` - (Optional) The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. Used for single account Direct Connect gateway associations. -* `vpn_gateway_id` - (Optional) *Deprecated:* Use `associated_gateway_id` instead. The ID of the VGW with which to associate the gateway. -Used for single account Direct Connect gateway associations. * `associated_gateway_owner_account_id` - (Optional) The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway. Used for cross-account Direct Connect gateway associations. * `proposal_id` - (Optional) The ID of the Direct Connect gateway association proposal. diff --git a/website/docs/r/dx_gateway_association_proposal.html.markdown b/website/docs/r/dx_gateway_association_proposal.html.markdown index 630ab642302..df36b18ffe6 100644 --- a/website/docs/r/dx_gateway_association_proposal.html.markdown +++ b/website/docs/r/dx_gateway_association_proposal.html.markdown @@ -24,14 +24,11 @@ A full example of how to create a VPN Gateway in one AWS account, create a Direc ## Argument Reference -~> **NOTE:** One of `associated_gateway_id`, or `vpn_gateway_id` must be specified. - The following arguments are supported: +* `associated_gateway_id` - (Required) The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. * `dx_gateway_id` - (Required) Direct Connect Gateway identifier. * `dx_gateway_owner_account_id` - (Required) AWS Account identifier of the Direct Connect Gateway's owner. -* `associated_gateway_id` - (Optional) The ID of the VGW or transit gateway with which to associate the Direct Connect gateway. -* `vpn_gateway_id` - (Optional) *Deprecated:* Use `associated_gateway_id` instead. Virtual Gateway identifier to associate with the Direct Connect Gateway. * `allowed_prefixes` - (Optional) VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured. ## Attributes Reference