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

r/aws_applicationinsights_application: ACTIVE is a valid create target status #36615

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Mar 27, 2024

Description

In some configurations with auto_config_enabled = true, intermittent errors are observed waiting for application creation.

│ Error: waiting for ApplicationInsights Application (example) create: unexpected state 'ACTIVE', wanted target 'NOT_CONFIGURED'. last error: %!s(<nil>)

The current assumption is that all applications enter a NOT_CONFIGURED lifecycle status upon initial creation (which is why this succeeds most of the time in minimal configurations such as our acceptance test), but in some instances can proceed into an ACTIVE status before the create waiter has polled for and observed a NOT_CONFIGURED status. The AWS documentation on the LifeCycle argument is limited, so while we cannot be certain about the expected values in the lifecycle flow, there is enough evidence from issue reports and manual testing to indicate ACTIVE should be considered a valid target state.

Relations

Closes #27277

References

Output from Acceptance Testing

% make testacc PKG=applicationinsights TESTS=TestAccApplicationInsightsApplication_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/applicationinsights/... -v -count 1 -parallel 20 -run='TestAccApplicationInsightsApplication_'  -timeout 360m

--- PASS: TestAccApplicationInsightsApplication_disappears (22.83s)
--- PASS: TestAccApplicationInsightsApplication_autoConfig (25.47s)
--- PASS: TestAccApplicationInsightsApplication_basic (34.21s)
--- PASS: TestAccApplicationInsightsApplication_tags (43.17s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/applicationinsights        48.867s

Copy link

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 size/XS Managed by automation to categorize the size of a PR. service/applicationinsights Issues and PRs that pertain to the applicationinsights service. labels Mar 27, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 27, 2024
…t status

In some configurations with `auto_config_enabled = true`, intermittent errors are observed waiting for application creation.

```
│ Error: waiting for ApplicationInsights Application (example) create: unexpected state 'ACTIVE', wanted target 'NOT_CONFIGURED'. last error: %!s(<nil>)
```

The current assumption is that all applications enter a `NOT_CONFIGURED` lifecycle status upon initial creation (which is why this succeeds most of the time in minimal configurations such as our acceptance test), but in some instances can proceed into an `ACTIVE` status before the create waiter has polled for and observed a `NOT_CONFIGURED` status. The AWS documentation on the [LifeCycle argument](https://docs.aws.amazon.com/cloudwatch/latest/APIReference/API_ApplicationInfo.html#appinsights-Type-ApplicationInfo-LifeCycle) is limited, so while we cannot be certain about the expected values in the lifecycle flow, there is enough evidence from issue reports and manual testing to indicate `ACTIVE` should be considered a valid target state.

```console
% make testacc PKG=applicationinsights TESTS=TestAccApplicationInsightsApplication_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/applicationinsights/... -v -count 1 -parallel 20 -run='TestAccApplicationInsightsApplication_'  -timeout 360m

--- PASS: TestAccApplicationInsightsApplication_disappears (22.83s)
--- PASS: TestAccApplicationInsightsApplication_autoConfig (25.47s)
--- PASS: TestAccApplicationInsightsApplication_basic (34.21s)
--- PASS: TestAccApplicationInsightsApplication_tags (43.17s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/applicationinsights        48.867s
```
@jar-b jar-b force-pushed the b-applicationinsights_application-active-status branch from 7bcc6d3 to d211c1c Compare March 27, 2024 19:45
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Mar 27, 2024
@jar-b jar-b merged commit 3faa961 into main Mar 27, 2024
44 checks passed
@jar-b jar-b deleted the b-applicationinsights_application-active-status branch March 27, 2024 20:27
@github-actions github-actions bot added this to the v5.43.0 milestone Mar 27, 2024
github-actions bot pushed a commit that referenced this pull request Mar 27, 2024
Copy link

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

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 28, 2024
Copy link

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 Apr 28, 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/applicationinsights Issues and PRs that pertain to the applicationinsights service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aws_applicationinsights_application unexpected state with auto_config_enabled=true
2 participants