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

Fix: aws_synthetics_canary generate correct timeout_in_seconds if not set in run_config #35177

Merged
merged 7 commits into from
Sep 5, 2024

Conversation

SebastianSlaby
Copy link
Contributor

@SebastianSlaby SebastianSlaby commented Jan 8, 2024

Description

Currently, if run_config is set but the value of timeout_in_seconds is not, it will default to 840. This causes issues when the rate is set to anything below 14 minutes, as the timeout can not be higher than the frequency of the synthetic canary.

This PR changes the behavior. so the value is computed by the AWS SDK based on the schedule.

relevant AWS SDK type

Relations

Closes #35176

References

Output from Acceptance Testing

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsCanary'  -timeout 360m
=== RUN   TestAccSyntheticsCanary_basic
=== PAUSE TestAccSyntheticsCanary_basic
=== RUN   TestAccSyntheticsCanary_artifactEncryption
=== PAUSE TestAccSyntheticsCanary_artifactEncryption
=== RUN   TestAccSyntheticsCanary_runtimeVersion
=== PAUSE TestAccSyntheticsCanary_runtimeVersion
=== RUN   TestAccSyntheticsCanary_rate
=== PAUSE TestAccSyntheticsCanary_rate
=== RUN   TestAccSyntheticsCanary_startCanary
=== PAUSE TestAccSyntheticsCanary_startCanary
=== RUN   TestAccSyntheticsCanary_StartCanary_codeChanges
=== PAUSE TestAccSyntheticsCanary_StartCanary_codeChanges
=== RUN   TestAccSyntheticsCanary_s3
=== PAUSE TestAccSyntheticsCanary_s3
=== RUN   TestAccSyntheticsCanary_run
=== PAUSE TestAccSyntheticsCanary_run
=== RUN   TestAccSyntheticsCanary_runTracing
=== PAUSE TestAccSyntheticsCanary_runTracing
=== RUN   TestAccSyntheticsCanary_runEnvironmentVariables
=== PAUSE TestAccSyntheticsCanary_runEnvironmentVariables
=== RUN   TestAccSyntheticsCanary_vpc
=== PAUSE TestAccSyntheticsCanary_vpc
=== RUN   TestAccSyntheticsCanary_tags
=== PAUSE TestAccSyntheticsCanary_tags
=== RUN   TestAccSyntheticsCanary_disappears
=== PAUSE TestAccSyntheticsCanary_disappears
=== CONT  TestAccSyntheticsCanary_basic
=== CONT  TestAccSyntheticsCanary_run
=== CONT  TestAccSyntheticsCanary_vpc
=== CONT  TestAccSyntheticsCanary_runTracing
=== CONT  TestAccSyntheticsCanary_tags
=== CONT  TestAccSyntheticsCanary_disappears
=== CONT  TestAccSyntheticsCanary_startCanary
=== CONT  TestAccSyntheticsCanary_s3
=== CONT  TestAccSyntheticsCanary_StartCanary_codeChanges
=== CONT  TestAccSyntheticsCanary_runtimeVersion
=== CONT  TestAccSyntheticsCanary_artifactEncryption
=== CONT  TestAccSyntheticsCanary_rate
=== CONT  TestAccSyntheticsCanary_runEnvironmentVariables
--- PASS: TestAccSyntheticsCanary_s3 (85.64s)
=== NAME  TestAccSyntheticsCanary_startCanary
    canary_test.go:225: Step 2/4 error running import: ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.
        
          map[string]string{
        - 	"status":                  "RUNNING",
        + 	"status":                  "STOPPED",
        - 	"timeline.0.last_stopped": "",
        + 	"timeline.0.last_stopped": "2024-01-07T23:21:01Z",
          }
=== NAME  TestAccSyntheticsCanary_StartCanary_codeChanges
    canary_test.go:274: Step 2/3 error running import: ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.
        
          map[string]string{
        - 	"status":                  "RUNNING",
        + 	"status":                  "STOPPED",
        - 	"timeline.0.last_stopped": "",
        + 	"timeline.0.last_stopped": "2024-01-07T23:21:00Z",
          }
--- PASS: TestAccSyntheticsCanary_disappears (100.44s)
--- FAIL: TestAccSyntheticsCanary_StartCanary_codeChanges (103.86s)
--- FAIL: TestAccSyntheticsCanary_startCanary (107.47s)
--- PASS: TestAccSyntheticsCanary_runEnvironmentVariables (122.34s)
--- PASS: TestAccSyntheticsCanary_artifactEncryption (136.41s)
--- PASS: TestAccSyntheticsCanary_runtimeVersion (148.83s)
--- PASS: TestAccSyntheticsCanary_tags (152.20s)
--- PASS: TestAccSyntheticsCanary_basic (155.53s)
--- PASS: TestAccSyntheticsCanary_runTracing (160.07s)
--- PASS: TestAccSyntheticsCanary_run (170.39s)
--- PASS: TestAccSyntheticsCanary_rate (234.31s)


...

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
Copy link

github-actions bot commented Jan 8, 2024

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/synthetics Issues and PRs that pertain to the synthetics service. size/M Managed by automation to categorize the size of a PR. labels Jan 8, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 8, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @SebastianSlaby 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 8, 2024
@jar-b jar-b self-assigned this Sep 5, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 5, 2024

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
```console
% make testacc PKG=synthetics TESTS=TestAccSyntheticsCanary_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsCanary_'  -timeout 360m

--- PASS: TestAccSyntheticsCanary_tags (88.14s)
--- PASS: TestAccSyntheticsCanary_runtimeVersion (133.21s)
--- PASS: TestAccSyntheticsCanary_run (168.45s)
--- PASS: TestAccSyntheticsCanary_artifactEncryption (181.53s)
--- PASS: TestAccSyntheticsCanary_startCanary (195.63s)
--- PASS: TestAccSyntheticsCanary_runTracing (220.42s)
--- PASS: TestAccSyntheticsCanary_runEnvironmentVariables (236.81s)
--- PASS: TestAccSyntheticsCanary_disappears (239.22s)
--- PASS: TestAccSyntheticsCanary_s3 (523.47s)
--- PASS: TestAccSyntheticsCanary_StartCanary_codeChanges (573.71s)
--- PASS: TestAccSyntheticsCanary_basic (579.43s)
--- PASS: TestAccSyntheticsCanary_rate (644.30s)
--- PASS: TestAccSyntheticsCanary_vpc (2152.74s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/synthetics 2158.743s

```
@jar-b jar-b requested a review from a team as a code owner September 5, 2024 17:06

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

% make testacc PKG=synthetics TESTS=TestAccSyntheticsCanary_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/synthetics/... -v -count 1 -parallel 20 -run='TestAccSyntheticsCanary_'  -timeout 360m

--- PASS: TestAccSyntheticsCanary_tags (88.14s)
--- PASS: TestAccSyntheticsCanary_runtimeVersion (133.21s)
--- PASS: TestAccSyntheticsCanary_run (168.45s)
--- PASS: TestAccSyntheticsCanary_artifactEncryption (181.53s)
--- PASS: TestAccSyntheticsCanary_startCanary (195.63s)
--- PASS: TestAccSyntheticsCanary_runTracing (220.42s)
--- PASS: TestAccSyntheticsCanary_runEnvironmentVariables (236.81s)
--- PASS: TestAccSyntheticsCanary_disappears (239.22s)
--- PASS: TestAccSyntheticsCanary_s3 (523.47s)
--- PASS: TestAccSyntheticsCanary_StartCanary_codeChanges (573.71s)
--- PASS: TestAccSyntheticsCanary_basic (579.43s)
--- PASS: TestAccSyntheticsCanary_rate (644.30s)
--- PASS: TestAccSyntheticsCanary_vpc (2152.74s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/synthetics 2158.743s

@jar-b
Copy link
Member

jar-b commented Sep 5, 2024

Thanks for your contribution, @SebastianSlaby! 👍

@jar-b jar-b merged commit 362643d into hashicorp:main Sep 5, 2024
33 checks passed
@github-actions github-actions bot added this to the v5.66.0 milestone Sep 5, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

This functionality has been released in v5.66.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. Thank you!

Copy link

github-actions bot commented Oct 7, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2024
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. 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.

[Bug]: aws_synthetics_canary timeout_in_seconds is always 840 if run_config is specified
3 participants