Skip to content
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

resource/aws_dx_lag: Deprecate number_of_connections #3367

Merged
merged 1 commit into from
Feb 14, 2018

Conversation

radeksimko
Copy link
Member

This is to address the following test failures:

=== RUN   TestAccAwsDxConnectionAssociation_basic
--- FAIL: TestAccAwsDxConnectionAssociation_basic (17.22s)
    testing.go:513: Step 0 error: After applying this step and refreshing, the plan was not empty:
        
        DIFF:
        
        DESTROY/CREATE: aws_dx_connection_association.test
          connection_id: "dxcon-fft4eqt7" => "dxcon-fft4eqt7"
          lag_id:        "dxlag-fgktz5h3" => "<computed>" (forces new resource)
        DESTROY/CREATE: aws_dx_lag.test
          arn:                   "arn:aws:directconnect:us-west-2:*******:dxlag/dxlag-fgktz5h3" => "<computed>"
          connections_bandwidth: "1Gbps" => "1Gbps"
          force_destroy:         "true" => "true"
          location:              "EqSe2" => "EqSe2"
          name:                  "tf-dx-t90nd" => "tf-dx-t90nd"
          number_of_connections: "2" => "1" (forces new resource)

=== RUN   TestAccAwsDxConnectionAssociation_multiConns
--- FAIL: TestAccAwsDxConnectionAssociation_multiConns (17.12s)
    testing.go:513: Step 0 error: After applying this step and refreshing, the plan was not empty:
        
        DIFF:
        
        DESTROY/CREATE: aws_dx_connection_association.test1
          connection_id: "dxcon-ffzd1kty" => "dxcon-ffzd1kty"
          lag_id:        "dxlag-fh87u1zp" => "<computed>" (forces new resource)
        DESTROY/CREATE: aws_dx_connection_association.test2
          connection_id: "dxcon-fgeqoh9q" => "dxcon-fgeqoh9q"
          lag_id:        "dxlag-fh87u1zp" => "<computed>" (forces new resource)
        DESTROY/CREATE: aws_dx_lag.test
          arn:                   "arn:aws:directconnect:us-west-2:*******:dxlag/dxlag-fh87u1zp" => "<computed>"
          connections_bandwidth: "1Gbps" => "1Gbps"
          force_destroy:         "true" => "true"
          location:              "EqSe2" => "EqSe2"
          name:                  "tf-dx-3a2u0" => "tf-dx-3a2u0"
          number_of_connections: "3" => "1" (forces new resource)

The story is that AWS provisions connections & associations automatically per number_of_connections (as it's passed to the API). This makes further management of connections tricky because any new non-default connection created via aws_dx_connection_association will cause Amazon to bump number_of_connections and cause drift as the number of connections no longer matches the initial number.

Unfortunately there's no way to avoid automated provisioning as NumberOfConnections is a required field in the API and has to be > 0. For that reason I decided to apply similar approach we already apply in some other resources (e.g. route table) and that is to plan removal of these default connections & associations.

I didn't implement that as part of this PR though, because that would be a breaking change. The goal is to inform the user about how we're going to tackle it going forward and avoid the drift for now.

Test results

=== RUN   TestAccAwsDxConnectionAssociation_basic
--- PASS: TestAccAwsDxConnectionAssociation_basic (47.35s)
=== RUN   TestAccAwsDxConnectionAssociation_multiConns
--- PASS: TestAccAwsDxConnectionAssociation_multiConns (46.58s)
=== RUN   TestAccAwsDxConnection_basic
--- PASS: TestAccAwsDxConnection_basic (39.48s)
=== RUN   TestAccAwsDxConnection_tags
--- PASS: TestAccAwsDxConnection_tags (61.83s)
=== RUN   TestAccAwsDxLag_basic
--- PASS: TestAccAwsDxLag_basic (92.54s)
=== RUN   TestAccAwsDxLag_tags
--- PASS: TestAccAwsDxLag_tags (118.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	406.689s

@radeksimko radeksimko added bug Addresses a defect in current functionality. service/directconnect Issues and PRs that pertain to the directconnect service. labels Feb 14, 2018
@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Feb 14, 2018
@bflad bflad added this to the v1.10.0 milestone Feb 14, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

=== RUN   TestAccAwsDxConnection_basic
--- PASS: TestAccAwsDxConnection_basic (17.76s)
=== RUN   TestAccAwsDxConnectionAssociation_basic
--- PASS: TestAccAwsDxConnectionAssociation_basic (23.07s)
=== RUN   TestAccAwsDxLag_basic
--- PASS: TestAccAwsDxLag_basic (24.97s)
=== RUN   TestAccAwsDxConnection_tags
--- PASS: TestAccAwsDxConnection_tags (27.81s)
=== RUN   TestAccAwsDxConnectionAssociation_multiConns
--- PASS: TestAccAwsDxConnectionAssociation_multiConns (31.00s)
=== RUN   TestAccAwsDxLag_tags
--- PASS: TestAccAwsDxLag_tags (38.52s)

@radeksimko radeksimko merged commit 3d0ac5d into master Feb 14, 2018
@radeksimko radeksimko deleted the b-dx-lag-ignore-default-conn branch February 14, 2018 19:36
@bflad
Copy link
Contributor

bflad commented Feb 27, 2018

This has been released in version 1.10.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 7, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/directconnect Issues and PRs that pertain to the directconnect service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants