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_synthetics_canary: Handle asynchronous IAM eventual consistency error on creation #18404

Merged
merged 2 commits into from
Mar 26, 2021

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Mar 25, 2021

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 #18101

Will followup this pull request with another that updates the Contributing Guide documentation with this atypical type of logic.

Previously:

=== CONT  TestAccAWSSyntheticsCanary_basic
resource_aws_synthetics_canary_test.go:82: Step 1/3 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-s9t49btk) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 8e3169db-124d-4c5a-ac0e-d9f382cf737f; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_basic (16.37s)

=== CONT  TestAccAWSSyntheticsCanary_runtimeVersion
resource_aws_synthetics_canary_test.go:156: Step 1/3 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-nenvizbg) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ffcb7edb-c77e-43f2-8a0a-1183e92f0f8c; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_runtimeVersion (16.85s)

=== CONT  TestAccAWSSyntheticsCanary_startCanary_codeChanges
resource_aws_synthetics_canary_test.go:239: Step 1/3 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-7c9erovn) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 1c4bacd4-3134-4df3-8e82-2538e155b524; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_startCanary_codeChanges (16.92s)

=== CONT  TestAccAWSSyntheticsCanary_startCanary
resource_aws_synthetics_canary_test.go:190: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-gzn0ksyz) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: afa63236-ac58-4cec-9c93-67192216f734; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_startCanary (17.91s)

=== CONT  TestAccAWSSyntheticsCanary_s3
resource_aws_synthetics_canary_test.go:281: Step 1/2 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-rhjz4908) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ea96e8db-b243-499e-b6e9-54e5d30c7604; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_s3 (16.68s)

=== CONT  TestAccAWSSyntheticsCanary_runConfig
resource_aws_synthetics_canary_test.go:326: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-qy4r4rep) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: aee1cc0e-6f2d-4f8d-8720-91aa25333dcc; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_runConfig (15.30s)

=== CONT  TestAccAWSSyntheticsCanary_runConfigTracing
resource_aws_synthetics_canary_test.go:373: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-44kmj0af) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 653d7e28-e3a6-4d5d-8da0-818cb7debb9a; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_runConfigTracing (14.80s)

=== CONT  TestAccAWSSyntheticsCanary_vpc
resource_aws_synthetics_canary_test.go:416: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-278kyhh1) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 9e377590-2ea9-42db-8340-f181964fd388; Proxy: null)
on terraform_plugin_test.tf line 150, in resource "aws_synthetics_canary" "test":
150: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_vpc (15.25s)

=== CONT  TestAccAWSSyntheticsCanary_tags
resource_aws_synthetics_canary_test.go:466: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-8thffpcs) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 60d2ea31-fdcb-4c4e-85ec-eecda075d58c; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_tags (15.32s)

=== CONT  TestAccAWSSyntheticsCanary_disappears
resource_aws_synthetics_canary_test.go:513: Step 1/1 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-yelzrxeu) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 398f9321-06ea-4019-ba08-37594ec32f04; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_disappears (15.34s)

Output from acceptance testing:

--- PASS: TestAccAWSSyntheticsCanary_basic (105.78s)
--- PASS: TestAccAWSSyntheticsCanary_disappears (59.55s)
--- PASS: TestAccAWSSyntheticsCanary_runConfig (114.95s)
--- PASS: TestAccAWSSyntheticsCanary_runConfigTracing (94.08s)
--- PASS: TestAccAWSSyntheticsCanary_runtimeVersion (89.12s)
--- PASS: TestAccAWSSyntheticsCanary_s3 (72.90s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary (124.81s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary_codeChanges (111.66s)
--- PASS: TestAccAWSSyntheticsCanary_tags (115.10s)
--- PASS: TestAccAWSSyntheticsCanary_vpc (678.91s)

@bflad bflad added the bug Addresses a defect in current functionality. label Mar 25, 2021
@bflad bflad requested a review from a team as a code owner March 25, 2021 14:58
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/synthetics Issues and PRs that pertain to the synthetics service. labels Mar 25, 2021
bflad added a commit that referenced this pull request Mar 25, 2021
bflad added 2 commits March 25, 2021 12:09
…istency error on creation

Reference: #18101

Previously:

```
=== CONT  TestAccAWSSyntheticsCanary_basic
resource_aws_synthetics_canary_test.go:82: Step 1/3 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-s9t49btk) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 8e3169db-124d-4c5a-ac0e-d9f382cf737f; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_basic (16.37s)

=== CONT  TestAccAWSSyntheticsCanary_runtimeVersion
resource_aws_synthetics_canary_test.go:156: Step 1/3 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-nenvizbg) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ffcb7edb-c77e-43f2-8a0a-1183e92f0f8c; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_runtimeVersion (16.85s)

=== CONT  TestAccAWSSyntheticsCanary_startCanary_codeChanges
resource_aws_synthetics_canary_test.go:239: Step 1/3 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-7c9erovn) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 1c4bacd4-3134-4df3-8e82-2538e155b524; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_startCanary_codeChanges (16.92s)

=== CONT  TestAccAWSSyntheticsCanary_startCanary
resource_aws_synthetics_canary_test.go:190: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-gzn0ksyz) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: afa63236-ac58-4cec-9c93-67192216f734; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_startCanary (17.91s)

=== CONT  TestAccAWSSyntheticsCanary_s3
resource_aws_synthetics_canary_test.go:281: Step 1/2 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-rhjz4908) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ea96e8db-b243-499e-b6e9-54e5d30c7604; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_s3 (16.68s)

=== CONT  TestAccAWSSyntheticsCanary_runConfig
resource_aws_synthetics_canary_test.go:326: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-qy4r4rep) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: aee1cc0e-6f2d-4f8d-8720-91aa25333dcc; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_runConfig (15.30s)

=== CONT  TestAccAWSSyntheticsCanary_runConfigTracing
resource_aws_synthetics_canary_test.go:373: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-44kmj0af) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 653d7e28-e3a6-4d5d-8da0-818cb7debb9a; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_runConfigTracing (14.80s)

=== CONT  TestAccAWSSyntheticsCanary_vpc
resource_aws_synthetics_canary_test.go:416: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-278kyhh1) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 9e377590-2ea9-42db-8340-f181964fd388; Proxy: null)
on terraform_plugin_test.tf line 150, in resource "aws_synthetics_canary" "test":
150: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_vpc (15.25s)

=== CONT  TestAccAWSSyntheticsCanary_tags
resource_aws_synthetics_canary_test.go:466: Step 1/4 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-8thffpcs) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 60d2ea31-fdcb-4c4e-85ec-eecda075d58c; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_tags (15.32s)

=== CONT  TestAccAWSSyntheticsCanary_disappears
resource_aws_synthetics_canary_test.go:513: Step 1/1 error: Error running apply: exit status 1
Error: error waiting for Synthetics Canary (tf-acc-test-yelzrxeu) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 398f9321-06ea-4019-ba08-37594ec32f04; Proxy: null)
on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test":
92: resource "aws_synthetics_canary" "test" {
--- FAIL: TestAccAWSSyntheticsCanary_disappears (15.34s)
```

Output from acceptance testing:

```
--- PASS: TestAccAWSSyntheticsCanary_basic (105.78s)
--- PASS: TestAccAWSSyntheticsCanary_disappears (59.55s)
--- PASS: TestAccAWSSyntheticsCanary_runConfig (114.95s)
--- PASS: TestAccAWSSyntheticsCanary_runConfigTracing (94.08s)
--- PASS: TestAccAWSSyntheticsCanary_runtimeVersion (89.12s)
--- PASS: TestAccAWSSyntheticsCanary_s3 (72.90s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary (124.81s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary_codeChanges (111.66s)
--- PASS: TestAccAWSSyntheticsCanary_tags (115.10s)
--- PASS: TestAccAWSSyntheticsCanary_vpc (678.91s)
```
@bflad bflad force-pushed the b-aws_synthetics_canary-iam-retries branch from f571087 to 5614ebc Compare March 25, 2021 16:09
@YakDriver YakDriver self-assigned this Mar 25, 2021
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Looks great! 🎉

Acceptance tests in GovCloud:

--- PASS: TestAccAWSSyntheticsCanary_s3 (50.18s)
--- PASS: TestAccAWSSyntheticsCanary_disappears (72.50s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary (89.30s)
--- PASS: TestAccAWSSyntheticsCanary_runtimeVersion (96.55s)
--- PASS: TestAccAWSSyntheticsCanary_runConfig (101.21s)
--- PASS: TestAccAWSSyntheticsCanary_tags (101.57s)
--- PASS: TestAccAWSSyntheticsCanary_runConfigTracing (110.28s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary_codeChanges (111.21s)
--- PASS: TestAccAWSSyntheticsCanary_basic (112.19s)
--- PASS: TestAccAWSSyntheticsCanary_vpc (1805.03s)

Acceptance tests in commercial:

--- PASS: TestAccAWSSyntheticsCanary_disappears (52.49s)
--- PASS: TestAccAWSSyntheticsCanary_s3 (57.75s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary_codeChanges (76.90s)
--- PASS: TestAccAWSSyntheticsCanary_basic (78.14s)
--- PASS: TestAccAWSSyntheticsCanary_startCanary (85.62s)
--- PASS: TestAccAWSSyntheticsCanary_tags (92.02s)
--- PASS: TestAccAWSSyntheticsCanary_runConfigTracing (92.93s)
--- PASS: TestAccAWSSyntheticsCanary_runConfig (94.17s)
--- PASS: TestAccAWSSyntheticsCanary_vpc (656.99s)

@bflad bflad merged commit cfebb8d into main Mar 26, 2021
@bflad bflad deleted the b-aws_synthetics_canary-iam-retries branch March 26, 2021 17:18
@github-actions github-actions bot added this to the v3.35.0 milestone Mar 26, 2021
github-actions bot pushed a commit that referenced this pull request Mar 26, 2021
@ghost
Copy link

ghost commented Apr 1, 2021

This has been released in version 3.35.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!

bflad added a commit that referenced this pull request Apr 2, 2021
@ghost
Copy link

ghost commented Apr 26, 2021

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 as resolved and limited conversation to collaborators Apr 26, 2021
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/synthetics Issues and PRs that pertain to the synthetics service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resource/aws_synthetics_canary: Implement Retries for IAM Eventual Consistency Error
2 participants