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 Amazon Managed Prometheus managed scraper resource #34749

Merged
merged 23 commits into from
Jan 4, 2024

Conversation

bonclay7
Copy link
Contributor

@bonclay7 bonclay7 commented Dec 5, 2023

Description

This PR adds the newly announced managed collector for Amazon Managed Service for Prometheus
https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector.html

In another PR, I'll submit a data source for fetching a service managed default scrape configuration to use with this new resource

Relations

Closes #34733.
Closes #34868.

Output from Acceptance Testing

% make testacc TESTS=TestAccAMPScraper PKG=amp 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 20 -run='TestAccAMPScraper'  -timeout 360m
=== RUN   TestAccAMPScraper_basic
=== PAUSE TestAccAMPScraper_basic
=== RUN   TestAccAMPScraper_disappears
=== PAUSE TestAccAMPScraper_disappears
=== RUN   TestAccAMPScraper_tags
=== PAUSE TestAccAMPScraper_tags
=== RUN   TestAccAMPScraper_alias
=== PAUSE TestAccAMPScraper_alias
=== CONT  TestAccAMPScraper_basic
=== CONT  TestAccAMPScraper_tags
=== CONT  TestAccAMPScraper_alias
=== CONT  TestAccAMPScraper_disappears
--- PASS: TestAccAMPScraper_disappears (2692.16s)
--- PASS: TestAccAMPScraper_basic (2733.34s)
--- PASS: TestAccAMPScraper_alias (2945.51s)
--- PASS: TestAccAMPScraper_tags (2981.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	2985.308s
...

Copy link

github-actions bot commented Dec 5, 2023

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/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. generators Relates to code generators. service/amp Issues and PRs that pertain to the amp service. labels Dec 5, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 5, 2023
Copy link

github-actions bot commented Dec 5, 2023

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

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 @bonclay7 👋

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 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 Dec 6, 2023
@bonclay7
Copy link
Contributor Author

bonclay7 commented Dec 14, 2023

Acceptance tests with plugin framework + go sdk v2

make build && make testacc TESTS=TestAccAMPScraper PKG=amp          <region:us-east-1>
==> Checking that code complies with gofmt requirements...
go install
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 20 -run='TestAccAMPScraper'  -timeout 360m
=== RUN   TestAccAMPScraper_basic
=== PAUSE TestAccAMPScraper_basic
=== RUN   TestAccAMPScraper_disappears
=== PAUSE TestAccAMPScraper_disappears
=== RUN   TestAccAMPScraper_tags
=== PAUSE TestAccAMPScraper_tags
=== RUN   TestAccAMPScraper_alias
=== PAUSE TestAccAMPScraper_alias
=== RUN   TestAccAMPScraper_security_groups
=== PAUSE TestAccAMPScraper_security_groups
=== CONT  TestAccAMPScraper_basic
=== CONT  TestAccAMPScraper_alias
=== CONT  TestAccAMPScraper_tags
=== CONT  TestAccAMPScraper_disappears
=== CONT  TestAccAMPScraper_security_groups
--- PASS: TestAccAMPScraper_tags (2501.32s)
--- PASS: TestAccAMPScraper_security_groups (2524.70s)
--- PASS: TestAccAMPScraper_basic (2606.98s)
--- PASS: TestAccAMPScraper_disappears (2743.01s)
--- PASS: TestAccAMPScraper_alias (2875.76s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/amp        2878.990s

@bonclay7
Copy link
Contributor Author

Hi @justinretzolk, any feedback on this PR?

@breathingdust breathingdust added the partner Contribution from a partner. label Dec 20, 2023
@ewbankkit ewbankkit added the new-resource Introduces a new resource. label Jan 3, 2024
@github-actions github-actions bot added the client-connections Pertains to the AWS Client and service connections. label Jan 3, 2024
@ewbankkit ewbankkit self-assigned this Jan 3, 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 Jan 3, 2024
# Conflicts:
#	go.mod
#	go.sum
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 🚀.

% make testacc TESTARGS='-run=TestAccAMPWorkspace_\|TestAccAMPWorkspaceDataSource_\|TestAccAMPWorkspacesDataSource_' PKG=amp ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 2  -run=TestAccAMPWorkspace_\|TestAccAMPWorkspaceDataSource_\|TestAccAMPWorkspacesDataSource_ -timeout 360m
=== RUN   TestAccAMPWorkspaceDataSource_basic
--- PASS: TestAccAMPWorkspaceDataSource_basic (17.65s)
=== RUN   TestAccAMPWorkspace_basic
=== PAUSE TestAccAMPWorkspace_basic
=== RUN   TestAccAMPWorkspace_disappears
=== PAUSE TestAccAMPWorkspace_disappears
=== RUN   TestAccAMPWorkspace_kms
=== PAUSE TestAccAMPWorkspace_kms
=== RUN   TestAccAMPWorkspace_tags
=== PAUSE TestAccAMPWorkspace_tags
=== RUN   TestAccAMPWorkspace_alias
=== PAUSE TestAccAMPWorkspace_alias
=== RUN   TestAccAMPWorkspace_loggingConfiguration
=== PAUSE TestAccAMPWorkspace_loggingConfiguration
=== RUN   TestAccAMPWorkspacesDataSource_basic
--- PASS: TestAccAMPWorkspacesDataSource_basic (26.43s)
=== RUN   TestAccAMPWorkspacesDataSource_aliasPrefix
--- PASS: TestAccAMPWorkspacesDataSource_aliasPrefix (16.51s)
=== CONT  TestAccAMPWorkspace_basic
=== CONT  TestAccAMPWorkspace_tags
--- PASS: TestAccAMPWorkspace_basic (22.12s)
=== CONT  TestAccAMPWorkspace_loggingConfiguration
--- PASS: TestAccAMPWorkspace_tags (46.48s)
=== CONT  TestAccAMPWorkspace_kms
--- PASS: TestAccAMPWorkspace_kms (19.55s)
=== CONT  TestAccAMPWorkspace_alias
--- PASS: TestAccAMPWorkspace_loggingConfiguration (64.99s)
=== CONT  TestAccAMPWorkspace_disappears
--- PASS: TestAccAMPWorkspace_disappears (17.72s)
--- PASS: TestAccAMPWorkspace_alias (58.52s)
PASS
% make testacc TESTARGS='-run=TestAccAMPAlertManagerDefinition_\|TestAccAMPRuleGroupNamespace_' PKG=amp ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 2  -run=TestAccAMPAlertManagerDefinition_\|TestAccAMPRuleGroupNamespace_ -timeout 360m
=== RUN   TestAccAMPAlertManagerDefinition_basic
=== PAUSE TestAccAMPAlertManagerDefinition_basic
=== RUN   TestAccAMPAlertManagerDefinition_disappears
=== PAUSE TestAccAMPAlertManagerDefinition_disappears
=== RUN   TestAccAMPRuleGroupNamespace_basic
=== PAUSE TestAccAMPRuleGroupNamespace_basic
=== RUN   TestAccAMPRuleGroupNamespace_disappears
=== PAUSE TestAccAMPRuleGroupNamespace_disappears
=== CONT  TestAccAMPAlertManagerDefinition_basic
=== CONT  TestAccAMPRuleGroupNamespace_basic
--- PASS: TestAccAMPRuleGroupNamespace_basic (233.29s)
=== CONT  TestAccAMPRuleGroupNamespace_disappears
--- PASS: TestAccAMPAlertManagerDefinition_basic (267.71s)
=== CONT  TestAccAMPAlertManagerDefinition_disappears
--- PASS: TestAccAMPAlertManagerDefinition_disappears (117.33s)
--- PASS: TestAccAMPRuleGroupNamespace_disappears (152.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	391.482s
% make testacc TESTARGS='-run=TestAccAMPScraper_basic' PKG=amp
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 20  -run=TestAccAMPScraper_basic -timeout 360m
=== RUN   TestAccAMPScraper_basic
=== PAUSE TestAccAMPScraper_basic
=== CONT  TestAccAMPScraper_basic
--- PASS: TestAccAMPScraper_basic (2227.37s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	2232.542s
% make testacc TESTARGS='-run=TestAccAMPScraper_alias\|TestAccAMPScraper_securityGroups' PKG=amp ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 2  -run=TestAccAMPScraper_alias\|TestAccAMPScraper_securityGroups -timeout 360m
=== RUN   TestAccAMPScraper_alias
=== PAUSE TestAccAMPScraper_alias
=== RUN   TestAccAMPScraper_securityGroups
=== PAUSE TestAccAMPScraper_securityGroups
=== CONT  TestAccAMPScraper_alias
=== CONT  TestAccAMPScraper_securityGroups
--- PASS: TestAccAMPScraper_alias (2286.95s)
--- PASS: TestAccAMPScraper_securityGroups (2306.16s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	2311.988s
% make testacc TESTARGS='-run=TestAccAMPScraper_disappears\|TestAccAMPScraper_tags' PKG=amp ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amp/... -v -count 1 -parallel 2  -run=TestAccAMPScraper_disappears\|TestAccAMPScraper_tags -timeout 360m
=== RUN   TestAccAMPScraper_disappears
=== PAUSE TestAccAMPScraper_disappears
=== RUN   TestAccAMPScraper_tags
=== PAUSE TestAccAMPScraper_tags
=== CONT  TestAccAMPScraper_disappears
=== CONT  TestAccAMPScraper_tags
--- PASS: TestAccAMPScraper_disappears (2167.50s)
--- PASS: TestAccAMPScraper_tags (2190.34s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/amp	2195.614s

@ewbankkit
Copy link
Contributor

@bonclay7 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 9a2129b into hashicorp:main Jan 4, 2024
50 checks passed
@github-actions github-actions bot added this to the v5.32.0 milestone Jan 4, 2024
@bonclay7 bonclay7 deleted the f-amp-managed-scraper branch January 8, 2024 15:02
Copy link

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

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 Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
client-connections Pertains to the AWS Client and service connections. documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. generators Relates to code generators. new-resource Introduces a new resource. partner Contribution from a partner. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/amp Issues and PRs that pertain to the amp service. size/XL 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
5 participants