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

feat: Add lambda_code attr to aws_inspector2_organization_configuration resource #34261

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Nov 4, 2023

Description

This PR is for adding the lambda_code attribute to the auto_enable block of the aws_inspector2_organization_configuration resource, which will add support for managing Lambda code scanning at the organizational level.

Relations

Closes #34200

References

Output from Acceptance Testing

antw@U-UQPXPV4N2NIW:~/git/terraform-provider-aws$ make testacc TESTS=TestAccInspector2_serial PKG=inspector2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/inspector2/... -v -count 1 -parallel 20 -run='TestAccInspector2_serial'  -timeout 360m
=== RUN   TestAccInspector2_serial
=== PAUSE TestAccInspector2_serial
=== CONT  TestAccInspector2_serial
=== RUN   TestAccInspector2_serial/Enabler
=== RUN   TestAccInspector2_serial/Enabler/memberAccount_updateMemberAccounts
    acctest.go:827: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccInspector2_serial/Enabler/memberAccount_disappearsMemberAssociation
    acctest.go:827: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccInspector2_serial/Enabler/basic
=== RUN   TestAccInspector2_serial/Enabler/accountID
=== RUN   TestAccInspector2_serial/Enabler/updateResourceTypes_disjoint
=== RUN   TestAccInspector2_serial/Enabler/memberAccount_basic
    acctest.go:827: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccInspector2_serial/Enabler/memberAccount_multiple
    acctest.go:827: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccInspector2_serial/Enabler/memberAccount_updateMemberAccountsAndScanTypes
    acctest.go:827: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccInspector2_serial/Enabler/disappears
=== RUN   TestAccInspector2_serial/Enabler/lambda
=== RUN   TestAccInspector2_serial/Enabler/updateResourceTypes
=== RUN   TestAccInspector2_serial/DelegatedAdminAccount
=== RUN   TestAccInspector2_serial/DelegatedAdminAccount/disappears
=== RUN   TestAccInspector2_serial/DelegatedAdminAccount/basic
=== RUN   TestAccInspector2_serial/MemberAssociation
=== RUN   TestAccInspector2_serial/MemberAssociation/basic
    acctest.go:827: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccInspector2_serial/MemberAssociation/disappears
    acctest.go:827: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
=== RUN   TestAccInspector2_serial/OrganizationConfiguration
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/basic
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/disappears
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/ec2ECR
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/lambda
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/lambdaCode
--- PASS: TestAccInspector2_serial (1165.64s)
    --- PASS: TestAccInspector2_serial/Enabler (874.79s)
        --- SKIP: TestAccInspector2_serial/Enabler/memberAccount_updateMemberAccounts (1.03s)
        --- SKIP: TestAccInspector2_serial/Enabler/memberAccount_disappearsMemberAssociation (0.31s)
        --- PASS: TestAccInspector2_serial/Enabler/basic (147.89s)
        --- PASS: TestAccInspector2_serial/Enabler/accountID (289.35s)
        --- PASS: TestAccInspector2_serial/Enabler/updateResourceTypes_disjoint (134.30s)
        --- SKIP: TestAccInspector2_serial/Enabler/memberAccount_basic (0.38s)
        --- SKIP: TestAccInspector2_serial/Enabler/memberAccount_multiple (0.36s)
        --- SKIP: TestAccInspector2_serial/Enabler/memberAccount_updateMemberAccountsAndScanTypes (1.28s)
        --- PASS: TestAccInspector2_serial/Enabler/disappears (60.23s)
        --- PASS: TestAccInspector2_serial/Enabler/lambda (62.09s)
        --- PASS: TestAccInspector2_serial/Enabler/updateResourceTypes (177.57s)
    --- PASS: TestAccInspector2_serial/DelegatedAdminAccount (64.57s)
        --- PASS: TestAccInspector2_serial/DelegatedAdminAccount/disappears (29.93s)
        --- PASS: TestAccInspector2_serial/DelegatedAdminAccount/basic (34.64s)
    --- PASS: TestAccInspector2_serial/MemberAssociation (0.40s)
        --- SKIP: TestAccInspector2_serial/MemberAssociation/basic (0.20s)
        --- SKIP: TestAccInspector2_serial/MemberAssociation/disappears (0.20s)
    --- PASS: TestAccInspector2_serial/OrganizationConfiguration (225.89s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/basic (43.96s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/disappears (51.41s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/ec2ECR (44.34s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/lambda (44.40s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/lambdaCode (41.78s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/inspector2 1165.820s
antw@U-UQPXPV4N2NIW:~/git/terraform-provider-aws$ 

Copy link

github-actions bot commented Nov 4, 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/M 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. service/inspector2 Issues and PRs that pertain to the inspector2 service. labels Nov 4, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 4, 2023
@acwwat acwwat force-pushed the f-aws_inspector2_organization_configuration-lambda_code branch 3 times, most recently from 2872c93 to 5e9d8b3 Compare November 4, 2023 07:02
@acwwat acwwat force-pushed the f-aws_inspector2_organization_configuration-lambda_code branch from 5e9d8b3 to 6733a31 Compare November 4, 2023 07:04
@acwwat acwwat changed the title [WIP] feat: Add lambda_code attr to aws_inspector2_organization_configuration resource feat: Add lambda_code attr to aws_inspector2_organization_configuration resource Nov 4, 2023
@ewbankkit ewbankkit 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 Nov 6, 2023
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=TestAccInspector2_serial/OrganizationConfiguration' PKG=inspector2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/inspector2/... -v -count 1 -parallel 20  -run=TestAccInspector2_serial/OrganizationConfiguration -timeout 360m
=== RUN   TestAccInspector2_serial
=== PAUSE TestAccInspector2_serial
=== CONT  TestAccInspector2_serial
=== RUN   TestAccInspector2_serial/OrganizationConfiguration
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/lambdaCode
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/basic
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/disappears
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/ec2ECR
=== RUN   TestAccInspector2_serial/OrganizationConfiguration/lambda
--- PASS: TestAccInspector2_serial (299.84s)
    --- PASS: TestAccInspector2_serial/OrganizationConfiguration (299.84s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/lambdaCode (35.33s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/basic (36.18s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/disappears (39.84s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/ec2ECR (33.73s)
        --- PASS: TestAccInspector2_serial/OrganizationConfiguration/lambda (37.07s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/inspector2	304.816s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit f611c8a into hashicorp:main Nov 6, 2023
62 checks passed
@github-actions github-actions bot added this to the v5.25.0 milestone Nov 6, 2023
Copy link

This functionality has been released in v5.25.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 Dec 11, 2023
@acwwat acwwat deleted the f-aws_inspector2_organization_configuration-lambda_code branch January 13, 2024 22:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/inspector2 Issues and PRs that pertain to the inspector2 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.

[Enhancement]: Add auto-enable lambda_code support to aws_inspector2_organization_configuration
2 participants