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_api_gateway_deployment: Add triggers argument #13054

Merged
merged 1 commit into from
May 1, 2020

Conversation

bflad
Copy link
Member

@bflad bflad commented Apr 28, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #162
Reference: #13055 (aws_apigatewayv2_deployment resource)
Reference: https://www.terraform.io/docs/providers/null/resource.html#triggers
Reference: https://www.terraform.io/docs/providers/random/#resource-quot-keepers-quot-
Reference: https://www.terraform.io/docs/providers/time/#resource-quot-triggers-quot-

Release note for CHANGELOG:

* resource/aws_api_gateway_deployment: Add `triggers` argument

Since it does not appear there will be functionality added anytime soon in the Terraform core to support resource configuration that automatically triggers resource recreation when referenced resources are updated, this introduces a triggers map argument similar to those utilized by the null, random, and time providers. This can be used by operators to automatically force a new resource (redeployment) using key/value criteria of their choosing. Its usage is fairly advanced, so caveats are added to the documentation.

We do not intend to add this class of argument to all Terraform AWS Provider resources due to its complexity and potentially awkward configuration, however, this is a pragmatic compromise for this particular resource which does not fit well into Terraform's usual provisioning model.

Output from acceptance testing:

--- PASS: TestAccAWSAPIGatewayDeployment_basic (24.67s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageDescription (24.72s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName (86.00s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName_EmptyString (128.10s)
--- PASS: TestAccAWSAPIGatewayDeployment_disappears_RestApi (157.14s)
--- PASS: TestAccAWSAPIGatewayDeployment_Triggers (204.69s)
--- PASS: TestAccAWSAPIGatewayDeployment_Description (250.19s)
--- PASS: TestAccAWSAPIGatewayDeployment_Variables (432.41s)

Reference: #162
Reference: https://www.terraform.io/docs/providers/null/resource.html#triggers
Reference: https://www.terraform.io/docs/providers/random/#resource-quot-keepers-quot-
Reference: https://www.terraform.io/docs/providers/time/#resource-quot-triggers-quot-

Since it does not appear there will be functionality added anytime soon in the Terraform core to support resource configuration that automatically triggers resource recreation when referenced resources are updated, this introduces a `triggers` map argument similar to those utilized by the `null`, `random`, and `time` providers. This can be used by operators to automatically force a new resource (redeployment) using key/value criteria of their choosing. Its usage is fairly advanced, so caveats are added to the documentation.

We do not intend to add this class of argument to all Terraform AWS Provider resources due to its complexity and potentially awkward configuration, however, this is a pragmatic compromise for this particular resource which does not fit well into Terraform's usual provisioning model.

Output from acceptance testing:

```
--- PASS: TestAccAWSAPIGatewayDeployment_basic (24.67s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageDescription (24.72s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName (86.00s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName_EmptyString (128.10s)
--- PASS: TestAccAWSAPIGatewayDeployment_disappears_RestApi (157.14s)
--- PASS: TestAccAWSAPIGatewayDeployment_Triggers (204.69s)
--- PASS: TestAccAWSAPIGatewayDeployment_Description (250.19s)
--- PASS: TestAccAWSAPIGatewayDeployment_Variables (432.41s)
```
@bflad bflad requested a review from a team April 28, 2020 01:08
@ghost ghost added size/M Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. service/apigateway Issues and PRs that pertain to the apigateway service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 28, 2020
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 28, 2020
bflad added a commit that referenced this pull request Apr 28, 2020
Reference: #12961
Reference: #13054 (aws_api_gateway_deployment resource)
Reference: https://www.terraform.io/docs/providers/null/resource.html#triggers
Reference: https://www.terraform.io/docs/providers/random/#resource-quot-keepers-quot-
Reference: https://www.terraform.io/docs/providers/time/#resource-quot-triggers-quot-

Since it does not appear there will be functionality added anytime soon in the Terraform core to support resource configuration that automatically triggers resource recreation when referenced resources are updated, this introduces a `triggers` map argument similar to those utilized by the `null`, `random`, and `time` providers. This can be used by operators to automatically force a new resource (redeployment) using key/value criteria of their choosing. Its usage is fairly advanced, so caveats are added to the documentation.

We do not intend to add this class of argument to all Terraform AWS Provider resources due to its complexity and potentially awkward configuration, however, this is a pragmatic compromise for this particular resource which does not fit well into Terraform's usual provisioning model.

Output from acceptance testing:

```
--- PASS: TestAccAWSAPIGatewayV2Deployment_disappears (23.05s)
--- PASS: TestAccAWSAPIGatewayV2Deployment_basic (41.80s)
--- PASS: TestAccAWSAPIGatewayV2Deployment_Triggers (70.95s)
```
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

--- PASS: TestAccAWSAPIGatewayDeployment_disappears_RestApi (20.96s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageDescription (37.45s)
--- PASS: TestAccAWSAPIGatewayDeployment_basic (65.87s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName_EmptyString (66.05s)
--- PASS: TestAccAWSAPIGatewayDeployment_Triggers (139.26s)
--- PASS: TestAccAWSAPIGatewayDeployment_Description (219.51s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName (263.62s)
--- PASS: TestAccAWSAPIGatewayDeployment_Variables (400.31s)

@bflad bflad added this to the v2.61.0 milestone May 1, 2020
bflad added a commit that referenced this pull request May 1, 2020
Reference: #12961
Reference: #13054 (aws_api_gateway_deployment resource)
Reference: https://www.terraform.io/docs/providers/null/resource.html#triggers
Reference: https://www.terraform.io/docs/providers/random/#resource-quot-keepers-quot-
Reference: https://www.terraform.io/docs/providers/time/#resource-quot-triggers-quot-

Since it does not appear there will be functionality added anytime soon in the Terraform core to support resource configuration that automatically triggers resource recreation when referenced resources are updated, this introduces a `triggers` map argument similar to those utilized by the `null`, `random`, and `time` providers. This can be used by operators to automatically force a new resource (redeployment) using key/value criteria of their choosing. Its usage is fairly advanced, so caveats are added to the documentation.

We do not intend to add this class of argument to all Terraform AWS Provider resources due to its complexity and potentially awkward configuration, however, this is a pragmatic compromise for this particular resource which does not fit well into Terraform's usual provisioning model.

Output from acceptance testing:

```
--- PASS: TestAccAWSAPIGatewayV2Deployment_disappears (23.05s)
--- PASS: TestAccAWSAPIGatewayV2Deployment_basic (41.80s)
--- PASS: TestAccAWSAPIGatewayV2Deployment_Triggers (70.95s)
```
@bflad bflad merged commit 6e4fe82 into master May 1, 2020
@bflad bflad deleted the f-apigateway-triggers branch May 1, 2020 17:30
bflad added a commit that referenced this pull request May 1, 2020
bflad added a commit that referenced this pull request May 4, 2020
@ghost
Copy link

ghost commented May 8, 2020

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this pull request May 28, 2020
…#13054)

Reference: hashicorp#162
Reference: https://www.terraform.io/docs/providers/null/resource.html#triggers
Reference: https://www.terraform.io/docs/providers/random/#resource-quot-keepers-quot-
Reference: https://www.terraform.io/docs/providers/time/#resource-quot-triggers-quot-

Since it does not appear there will be functionality added anytime soon in the Terraform core to support resource configuration that automatically triggers resource recreation when referenced resources are updated, this introduces a `triggers` map argument similar to those utilized by the `null`, `random`, and `time` providers. This can be used by operators to automatically force a new resource (redeployment) using key/value criteria of their choosing. Its usage is fairly advanced, so caveats are added to the documentation.

We do not intend to add this class of argument to all Terraform AWS Provider resources due to its complexity and potentially awkward configuration, however, this is a pragmatic compromise for this particular resource which does not fit well into Terraform's usual provisioning model.

Output from acceptance testing:

```
--- PASS: TestAccAWSAPIGatewayDeployment_basic (24.67s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageDescription (24.72s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName (86.00s)
--- PASS: TestAccAWSAPIGatewayDeployment_StageName_EmptyString (128.10s)
--- PASS: TestAccAWSAPIGatewayDeployment_disappears_RestApi (157.14s)
--- PASS: TestAccAWSAPIGatewayDeployment_Triggers (204.69s)
--- PASS: TestAccAWSAPIGatewayDeployment_Description (250.19s)
--- PASS: TestAccAWSAPIGatewayDeployment_Variables (432.41s)
```
@ghost
Copy link

ghost commented Jun 1, 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 Jun 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_api_gateway_deployment doesn't get updated after changes
2 participants