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

inspector2: First resource aws_inspector2_organization_configuration #27000

Merged
merged 12 commits into from
Sep 27, 2022

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented Sep 27, 2022

Description

By itself, this functionality will not be useful. However, it's paving the way for additional resources.

Adds aws_inspector2_organziation_configuration for auto enabling EC2 and/or ECR scans for accounts you add to the inspector org.

Relations

Relates #22330

References

Output from Acceptance Testing

% make testacc TESTS="TestAccInspector2OrganizationConfiguration_serial" PKG=inspector2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/inspector2/... -v -count 1 -parallel 20 -run='TestAccInspector2OrganizationConfiguration_serial'  -timeout 180m
=== RUN   TestAccInspector2OrganizationConfiguration_serial
=== RUN   TestAccInspector2OrganizationConfiguration_serial/basic
=== RUN   TestAccInspector2OrganizationConfiguration_serial/disappears
=== RUN   TestAccInspector2OrganizationConfiguration_serial/ec2ECR
--- PASS: TestAccInspector2OrganizationConfiguration_serial (81.99s)
    --- PASS: TestAccInspector2OrganizationConfiguration_serial/basic (27.03s)
    --- PASS: TestAccInspector2OrganizationConfiguration_serial/disappears (30.49s)
    --- PASS: TestAccInspector2OrganizationConfiguration_serial/ec2ECR (24.47s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/inspector2	84.022s

@github-actions
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/XL Managed by automation to categorize the size of a PR. service/inspector2 Issues and PRs that pertain to the inspector2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 27, 2022
@github-actions github-actions bot added client-connections Pertains to the AWS Client and service connections. documentation Introduces or discusses updates to documentation. generators Relates to code generators. provider Pertains to the provider itself, rather than any interaction with AWS. labels Sep 27, 2022
@github-actions github-actions bot added repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. and removed repository Repository modifications; GitHub Actions, developer docs, issue templates, codeowners, changelog. labels Sep 27, 2022
@YakDriver YakDriver changed the title inspector2: Add first resource inspector2: First resource aws_inspector2_organization_configuration Sep 27, 2022
@YakDriver YakDriver merged commit 7cd136b into main Sep 27, 2022
@YakDriver YakDriver deleted the f-inspector2 branch September 27, 2022 22:06
@github-actions github-actions bot added this to the v4.33.0 milestone Sep 27, 2022
github-actions bot pushed a commit that referenced this pull request Sep 27, 2022
@YakDriver
Copy link
Member Author

YakDriver commented Sep 27, 2022

AWS CLI commands:

% aws inspector2 enable-delegated-admin-account --delegated-admin-account-id 012345678901
% aws inspector2 describe-organization-configuration
% aws inspector2 update-organization-configuration --auto-enable ec2=false,ecr=true
% aws inspector2 disable-delegated-admin-account --delegated-admin-account-id 012345678901

If you get this error, the account is not enabled as a delegated admin account:

% aws inspector2 describe-organization-configuration

An error occurred (AccessDeniedException) when calling the DescribeOrganizationConfiguration operation: Invoking account does not have access to describe the organization configuration.
% aws inspector2 enable-delegated-admin-account --delegated-admin-account-id 012345678901
% aws inspector2 describe-organization-configuration
{
    "autoEnable": {
        "ec2": false,
        "ecr": false
    },
    "maxAccountLimitReached": false
}

@github-actions
Copy link

This functionality has been released in v4.33.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
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 Oct 30, 2022
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. generators Relates to code generators. provider Pertains to the provider itself, rather than any interaction with AWS. service/inspector2 Issues and PRs that pertain to the inspector2 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
Development

Successfully merging this pull request may close these issues.

1 participant