Skip to content

Commit

Permalink
Revert "[hashicorp#9209] Fix dx gateway association proposal so it wo…
Browse files Browse the repository at this point in the history
…rks even if expired"

This reverts commit c13b25c.
  • Loading branch information
Kit Ewbank authored and ewbankkit committed Feb 12, 2021
1 parent a3fd7a5 commit 9c77cd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 3 additions & 6 deletions aws/resource_aws_dx_gateway_association_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ func resourceAwsDxGatewayAssociationProposal() *schema.Resource {
return false
}

if proposal == nil {
return true
}

return aws.StringValue(proposal.ProposalState) == directconnect.GatewayAssociationProposalStateRequested
return proposal != nil && aws.StringValue(proposal.ProposalState) == directconnect.GatewayAssociationProposalStateRequested
}),
),

Expand Down Expand Up @@ -108,7 +104,8 @@ func resourceAwsDxGatewayAssociationProposalRead(d *schema.ResourceData, meta in
}

if proposal == nil {
//The resource may have expired, return the last known state
log.Printf("[WARN] Direct Connect Gateway Association Proposal (%s) not found, removing from state", d.Id())
d.SetId("")
return nil
}

Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/dx_gateway_association_proposal.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ description: |-

Manages a Direct Connect Gateway Association Proposal, typically for enabling cross-account associations. For single account associations, see the [`aws_dx_gateway_association` resource](/docs/providers/aws/r/dx_gateway_association.html).

~> **NOTE:** The proposal expires after some time so the resource keeps returning the last known state. If you need to create it again you have to taint it.

## Example Usage

```hcl
Expand Down

0 comments on commit 9c77cd2

Please sign in to comment.