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

Add support for tagging aws_dx_lag and aws_dx_connection resources #2990

Merged
merged 4 commits into from
Feb 13, 2018

Conversation

ewbankkit
Copy link
Contributor

Fixes #2989.

Acceptance tests:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxLag_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsDxLag_ -timeout 120m
=== RUN   TestAccAwsDxLag_basic
--- PASS: TestAccAwsDxLag_basic (38.46s)
=== RUN   TestAccAwsDxLag_tags
--- PASS: TestAccAwsDxLag_tags (50.75s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	89.222s
make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxConnection_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsDxConnection_ -timeout 120m
=== RUN   TestAccAwsDxConnection_basic
--- PASS: TestAccAwsDxConnection_basic (25.39s)
=== RUN   TestAccAwsDxConnection_tags
--- PASS: TestAccAwsDxConnection_tags (39.78s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	65.177s

@ewbankkit
Copy link
Contributor Author

  • Added arn as an attribute to aws_dx_lag and aws_dx_connection as this is required for the tagging operations
  • Added some extra error checking for non-existent/already deleted LAGs and connections

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

Hi @ewbankkit
this looks overall very good. Just one question about connection state and a bunch of nitpicks, the former being a blocker.

log.Printf("[WARN] Direct Connect connection (%s) not found, removing from state", d.Id())
d.SetId("")
return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

I'd be ok with removing the resource from state if it's in ConnectionStateDeleted, but I think we should keep it in the state if it's still ConnectionStateDeleting or ConnectionStateRejected. The deletion may not finish successfully and rejection != deleted resource, AFAIK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, agreed. I'll fix.

bandwidth = "1Gbps"
location = "EqSe2"
}
`, n)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Usage = "original"
}
}
`, n)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Usage = "changed"
}
}
`, n)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

}
terminalStates := map[string]bool{
directconnect.LagStateDeleted: true,
directconnect.LagStateDeleting: true,
Copy link
Member

Choose a reason for hiding this comment

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

As above, I think it would be safer to only catch LagStateDeleted here.

number_of_connections = 2
force_destroy = true
}
`, n)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Usage = "original"
}
}
`, n)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Usage = "changed"
}
}
`, n)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@radeksimko radeksimko added the waiting-response Maintainers are waiting on response from community or contributor. label Feb 12, 2018
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Feb 13, 2018
@ewbankkit
Copy link
Contributor Author

Re-ran acceptance tests after the change to aws/resource_aws_dx_connection.go:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxConnection_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsDxConnection_ -timeout 120m
=== RUN   TestAccAwsDxConnection_basic
--- PASS: TestAccAwsDxConnection_basic (26.48s)
=== RUN   TestAccAwsDxConnection_tags
--- PASS: TestAccAwsDxConnection_tags (45.95s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	81.800s

@radeksimko radeksimko removed the waiting-response Maintainers are waiting on response from community or contributor. label Feb 13, 2018
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Feb 13, 2018
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

I just removed the check for Deleting state in LAG too, as discussed and pushed to your branch so we can get this in. I hope you don't mind.

👍

@radeksimko radeksimko merged commit 1787b2b into hashicorp:master Feb 13, 2018
@bflad bflad added this to the v1.10.0 milestone Feb 27, 2018
@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.

@ewbankkit ewbankkit deleted the issue-2989 branch August 3, 2018 14:16
@ghost
Copy link

ghost commented Apr 4, 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 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/directconnect Issues and PRs that pertain to the directconnect service. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for tagging Direct Connect resources
4 participants