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: inspector2_enabler fails to create due to incorrect resource type #33348

Conversation

0xfabio
Copy link

@0xfabio 0xfabio commented Sep 7, 2023

Description

This is the PR for the fix implemented by @irth in this comment

Relations

Closes #32334

Output from Acceptance Testing

We have tested this locally and without the fix creating the following resource failed.
This is a similar terraform resource also used in the testAccEnablerConfig_basic acceptance test, but unfortunately we can currently not run the acceptance test with our current setup.

resource "aws_inspector2_enabler" "this" {
  account_ids    = [var.aws_account_id]
  resource_types = ["EC2", "ECR"]
}

Output with version 5.15.0:

aws_inspector2_enabler.this: Creating...
aws_inspector2_enabler.this: Still creating... [10s elapsed]
aws_inspector2_enabler.this: Still creating... [20s elapsed]
aws_inspector2_enabler.this: Still creating... [30s elapsed]
aws_inspector2_enabler.this: Still creating... [40s elapsed]
aws_inspector2_enabler.this: Still creating... [50s elapsed]

│ Error: updating Amazon Inspector Enabler (535981463186-EC2:ECR): operation error Inspector2: Disable, https response error StatusCode: 400, RequestID: ****, ValidationException: 1 validation error detected: Value at 'resourceTypes' failed to satisfy constraint: Member must satisfy constraint: [Member must satisfy enum value set: [LAMBDA_CODE, LAMBDA, ECR, EC2]]

│   with aws_inspector2_enabler.this,
│   on main.tf line 46, in resource "aws_inspector2_enabler" "this":
│   46: resource "aws_inspector2_enabler" "this" {

Output with this fix:

aws_inspector2_enabler.this: Creating...
aws_inspector2_enabler.this: Still creating... [10s elapsed]
aws_inspector2_enabler.this: Still creating... [20s elapsed]
aws_inspector2_enabler.this: Still creating... [30s elapsed]
aws_inspector2_enabler.this: Still creating... [40s elapsed]
aws_inspector2_enabler.this: Still creating... [50s elapsed]
aws_inspector2_enabler.this: Still creating... [1m0s elapsed]
aws_inspector2_enabler.this: Still creating... [1m10s elapsed]
aws_inspector2_enabler.this: Creation complete after 1m14s [id=535981463186-EC2:ECR]

@github-actions
Copy link

github-actions bot commented Sep 7, 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/XS Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/inspector2 Issues and PRs that pertain to the inspector2 service. labels Sep 7, 2023
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Hey @0xfabio 👋 Thank you very much for your contribution! At times, our maintainers need to make direct edits to pull requests in order to help get it ready to be merged. Your current settings do not allow maintainers to make such edits. To help facilitate this, update your pull request to allow such edits as described in GitHub's Allowing changes to a pull request branch created from a fork documentation. (If you're using a fork owned by an organization, your organization may not allow you to change this setting. If that is the case, let us know.)

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 7, 2023
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Thank you for your contribution! 🚀

Please note that the CHANGELOG.md file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the Contributing Guide for additional pull request review items.

Remove any changes to the CHANGELOG.md file and commit them in this pull request to prevent delays with reviewing and potentially merging this pull request.

@0xfabio 0xfabio force-pushed the fix-inspector2-enabler-resource-type-constant branch from 89ca099 to b6ea639 Compare September 7, 2023 10:55
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 7, 2023
@aschleifer
Copy link

Is there any estimation when this fix could be merged? It works and would help us to integrate AWS Inspector without having to do some hacky workarounds.

@ewbankkit ewbankkit self-assigned this Oct 13, 2023
@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 Oct 13, 2023
@ewbankkit
Copy link
Contributor

@0xfabio Thanks for the contribution 🎉 👏.
As I am unable to push to this fork, in order to get this PR merged quickly I copied the commits over to #33935.
In general everything was great.

@0xfabio
Copy link
Author

0xfabio commented Oct 17, 2023

@ewbankkit Thanks for getting this merged 👍

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 Nov 17, 2023
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. documentation Introduces or discusses updates to documentation. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. provider Pertains to the provider itself, rather than any interaction with AWS. service/inspector2 Issues and PRs that pertain to the inspector2 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_inspector2_enabler fails to create on 5.6.0 due to incorrect resource type constant
4 participants