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_lambda_function: Add memory_size, role, and timeout validation #29721

Merged
merged 4 commits into from
Mar 2, 2023

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Feb 28, 2023

Description

Adds additional plan time validators for the aws_lambda_function resource.

Relations

Closes #22897
Relates #13709

References

Output from Acceptance Testing

$ make testacc PKG=lambda TESTS=TestAccLambdaFunction_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaFunction_'  -timeout 180m
--- PASS: TestAccLambdaFunction_Zip_validation (8.32s)
=== CONT  TestAccLambdaFunction_nameValidation
--- PASS: TestAccLambdaFunction_nameValidation (3.12s)
=== CONT  TestAccLambdaFunction_VPCPublishNo_changes
--- PASS: TestAccLambdaFunction_basic (52.01s)
=== CONT  TestAccLambdaFunction_deadLetterUpdated
--- PASS: TestAccLambdaFunction_S3Update_unversioned (58.10s)
=== CONT  TestAccLambdaFunction_VPC_withInvocation
--- PASS: TestAccLambdaFunction_snapStart (64.12s)
=== CONT  TestAccLambdaFunction_architecturesUpdate
--- PASS: TestAccLambdaFunction_skipDestroy (68.07s)
=== CONT  TestAccLambdaFunction_VPC_properIAMDependencies
--- PASS: TestAccLambdaFunction_tracing (76.70s)
=== CONT  TestAccLambdaFunction_architectures
--- PASS: TestAccLambdaFunction_versioned (83.46s)
=== CONT  TestAccLambdaFunction_fileSystem
--- PASS: TestAccLambdaFunction_concurrencyCycle (102.26s)
=== CONT  TestAccLambdaFunction_nilDeadLetter
--- PASS: TestAccLambdaFunction_ephemeralStorage (107.11s)
=== CONT  TestAccLambdaFunction_disablePublish
--- PASS: TestAccLambdaFunction_VPC_replaceSGWithDefault (320.30s)
=== CONT  TestAccLambdaFunction_deadLetter
--- PASS: TestAccLambdaFunction_runtimes (334.49s)
=== CONT  TestAccLambdaFunction_enablePublish
--- PASS: TestAccLambdaFunction_VPC_replaceSGWithCustom (493.75s)
=== CONT  TestAccLambdaFunction_versionedUpdate
--- PASS: TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables (672.36s)
=== CONT  TestAccLambdaFunction_envVariables
--- PASS: TestAccLambdaFunction_VPCPublishHas_changes (868.91s)
=== CONT  TestAccLambdaFunction_expectFilenameAndS3Attributes
--- PASS: TestAccLambdaFunction_expectFilenameAndS3Attributes (0.85s)
=== CONT  TestAccLambdaFunction_EnvironmentVariables_noValue
--- PASS: TestAccLambdaFunction_vpcRemoval (1228.78s)
=== CONT  TestAccLambdaFunction_LocalUpdate_nameOnly
--- PASS: TestAccLambdaFunction_layersUpdate (1281.94s)
=== CONT  TestAccLambdaFunction_s3
--- PASS: TestAccLambdaFunction_s3 (32.62s)
=== CONT  TestAccLambdaFunction_emptyVPC
--- PASS: TestAccLambdaFunction_layers (1470.55s)
=== CONT  TestAccLambdaFunction_concurrency
--- PASS: TestAccLambdaFunction_deadLetterUpdated (1443.17s)
=== CONT  TestAccLambdaFunction_codeSigning
--- PASS: TestAccLambdaFunction_vpcUpdate (1499.79s)
=== CONT  TestAccLambdaFunction_tags
--- PASS: TestAccLambdaFunction_VPC_withInvocation (1797.51s)
=== CONT  TestAccLambdaFunction_disappears
--- PASS: TestAccLambdaFunction_nilDeadLetter (1762.21s)
=== CONT  TestAccLambdaFunction_encryptedEnvVariables
--- PASS: TestAccLambdaFunction_architectures (1807.61s)
=== CONT  TestAccLambdaFunction_localUpdate
--- PASS: TestAccLambdaFunction_disablePublish (1785.41s)
=== CONT  TestAccLambdaFunction_S3Update_basic
--- PASS: TestAccLambdaFunction_VPC_properIAMDependencies (1828.19s)
=== CONT  TestAccLambdaFunction_unpublishedCodeUpdate
--- PASS: TestAccLambdaFunction_S3Update_basic (55.44s)
--- PASS: TestAccLambdaFunction_deadLetter (1727.90s)
--- PASS: TestAccLambdaFunction_EnvironmentVariables_noValue (1184.21s)
--- PASS: TestAccLambdaFunction_enablePublish (1737.33s)
--- PASS: TestAccLambdaFunction_architecturesWithLayer (2073.30s)
--- PASS: TestAccLambdaFunction_emptyVPC (759.45s)
--- PASS: TestAccLambdaFunction_concurrency (625.84s)
--- PASS: TestAccLambdaFunction_architecturesUpdate (2033.73s)
--- PASS: TestAccLambdaFunction_disappears (249.91s)
--- PASS: TestAccLambdaFunction_envVariables (1437.73s)
--- PASS: TestAccLambdaFunction_tags (621.91s)
--- PASS: TestAccLambdaFunction_LocalUpdate_nameOnly (904.95s)
--- PASS: TestAccLambdaFunction_localUpdate (255.58s)
--- PASS: TestAccLambdaFunction_unpublishedCodeUpdate (254.88s)
--- PASS: TestAccLambdaFunction_encryptedEnvVariables (287.70s)
--- PASS: TestAccLambdaFunction_versionedUpdate (1659.23s)
--- PASS: TestAccLambdaFunction_fileSystem (2073.05s)
--- PASS: TestAccLambdaFunction_vpc (2187.54s)
--- PASS: TestAccLambdaFunction_VPCPublishNo_changes (2178.07s)
--- PASS: TestAccLambdaFunction_codeSigning (949.44s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     2447.793s

@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/XS Managed by automation to categorize the size of a PR. service/lambda Issues and PRs that pertain to the lambda service. labels Feb 28, 2023
@jar-b jar-b marked this pull request as ready for review March 1, 2023 02:09
Copy link
Contributor

@johnsonaj johnsonaj 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=TestAccLambdaFunction_ -short' PKG=lambda
                                                                                                                                             
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaFunction_ -short -timeout 180m
    function_test.go:159: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_unpublishedCodeUpdate (0.00s)
    function_test.go:274: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_concurrency (0.00s)
    function_test.go:314: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_concurrencyCycle (0.00s)
    function_test.go:379: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_envVariables (0.00s)
    function_test.go:434: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_EnvironmentVariables_noValue (0.00s)
    function_test.go:467: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_encryptedEnvVariables (0.00s)
    function_test.go:538: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_versioned (0.00s)
    function_test.go:574: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_versionedUpdate (0.00s)
    function_test.go:652: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_enablePublish (0.00s)
    function_test.go:710: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_disablePublish (0.00s)
    function_test.go:759: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_deadLetter (0.00s)
    function_test.go:802: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_deadLetterUpdated (0.00s)
    function_test.go:844: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_nilDeadLetter (0.00s)
    function_test.go:867: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_fileSystem (0.00s)
    function_test.go:926: Environment variable AWS_LAMBDA_IMAGE_LATEST_ID is not set
--- SKIP: TestAccLambdaFunction_image (0.00s)
    function_test.go:996: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_architectures (0.00s)
    function_test.go:1047: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_architecturesUpdate (0.00s)
    function_test.go:1098: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_architecturesWithLayer (0.00s)
    function_test.go:1188: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_tracing (0.00s)
    function_test.go:1234: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables (0.00s)
    function_test.go:1268: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_layers (0.00s)
    function_test.go:1302: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_layersUpdate (0.00s)
    function_test.go:1344: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_vpc (0.00s)
    function_test.go:1380: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_vpcRemoval (0.00s)
    function_test.go:1420: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_vpcUpdate (0.00s)
    function_test.go:1469: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_VPC_withInvocation (0.00s)
    function_test.go:1504: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_VPCPublishNo_changes (0.00s)
    function_test.go:1546: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_VPCPublishHas_changes (0.00s)
    function_test.go:1588: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_VPC_properIAMDependencies (0.00s)
    function_test.go:1619: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_VPC_replaceSGWithDefault (0.00s)
    function_test.go:1651: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_VPC_replaceSGWithCustom (0.00s)
    function_test.go:1744: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_localUpdate (0.00s)
    function_test.go:1806: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_LocalUpdate_nameOnly (0.00s)
    function_test.go:2017: skipping long-running test in short mode
--- SKIP: TestAccLambdaFunction_runtimes (0.00s)
--- PASS: TestAccLambdaFunction_nameValidation (2.99s)
--- PASS: TestAccLambdaFunction_expectFilenameAndS3Attributes (3.01s)
--- PASS: TestAccLambdaFunction_Zip_validation (6.46s)
--- PASS: TestAccLambdaFunction_emptyVPC (35.03s)
--- PASS: TestAccLambdaFunction_s3 (35.76s)
--- PASS: TestAccLambdaFunction_basic (52.15s)
--- PASS: TestAccLambdaFunction_S3Update_unversioned (53.71s)
--- PASS: TestAccLambdaFunction_disappears (56.60s)
--- PASS: TestAccLambdaFunction_S3Update_basic (56.87s)
--- PASS: TestAccLambdaFunction_snapStart (57.44s)
--- PASS: TestAccLambdaFunction_skipDestroy (62.00s)
--- PASS: TestAccLambdaFunction_ephemeralStorage (63.20s)
--- PASS: TestAccLambdaFunction_tags (92.07s)
--- PASS: TestAccLambdaFunction_codeSigning (94.88s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	97.880s

@jar-b jar-b merged commit 0a07124 into main Mar 2, 2023
@jar-b jar-b deleted the f-aws_lambda_function-validation branch March 2, 2023 19:53
@github-actions github-actions bot added this to the v4.57.0 milestone Mar 2, 2023
github-actions bot pushed a commit that referenced this pull request Mar 2, 2023
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This functionality has been released in v4.57.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

github-actions bot commented Apr 7, 2023

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 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/lambda Issues and PRs that pertain to the lambda 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.

r/aws_lambda_function plan-time validation for role, memory_size, and timeout
2 participants