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

Reload Lambda Function environment variables if kms_key_arn has changed #26696

Conversation

bschaatsbergen
Copy link
Member

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #26692

Output from acceptance testing:

$ make testacc TESTS=TestAccXXX PKG=ec2

...

@github-actions github-actions bot added service/lambda Issues and PRs that pertain to the lambda service. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Sep 7, 2022
@bschaatsbergen bschaatsbergen changed the title Update Lambda Function environment variables if kms_key_arn has changed Reload Lambda Function environment variables if kms_key_arn has changed Sep 7, 2022
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 8, 2022
…ables' to delete one of the KMS keys.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccLambdaFunction_encryptedEnvVariables' PKG=lambda ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 2  -run=TestAccLambdaFunction_encryptedEnvVariables -timeout 180m
=== RUN   TestAccLambdaFunction_encryptedEnvVariables
=== PAUSE TestAccLambdaFunction_encryptedEnvVariables
=== CONT  TestAccLambdaFunction_encryptedEnvVariables
--- PASS: TestAccLambdaFunction_encryptedEnvVariables (81.12s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	85.344s
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Sep 8, 2022
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=TestAccLambdaFunction_' PKG=lambda ACCTEST_PARALLELISM=3 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 3  -run=TestAccLambdaFunction_ -timeout 180m
=== RUN   TestAccLambdaFunction_basic
=== PAUSE TestAccLambdaFunction_basic
=== RUN   TestAccLambdaFunction_disappears
=== PAUSE TestAccLambdaFunction_disappears
=== RUN   TestAccLambdaFunction_tags
=== PAUSE TestAccLambdaFunction_tags
=== RUN   TestAccLambdaFunction_unpublishedCodeUpdate
=== PAUSE TestAccLambdaFunction_unpublishedCodeUpdate
=== RUN   TestAccLambdaFunction_codeSigning
=== PAUSE TestAccLambdaFunction_codeSigning
=== RUN   TestAccLambdaFunction_concurrency
=== PAUSE TestAccLambdaFunction_concurrency
=== RUN   TestAccLambdaFunction_concurrencyCycle
=== PAUSE TestAccLambdaFunction_concurrencyCycle
=== RUN   TestAccLambdaFunction_expectFilenameAndS3Attributes
=== PAUSE TestAccLambdaFunction_expectFilenameAndS3Attributes
=== RUN   TestAccLambdaFunction_envVariables
=== PAUSE TestAccLambdaFunction_envVariables
=== RUN   TestAccLambdaFunction_EnvironmentVariables_noValue
=== PAUSE TestAccLambdaFunction_EnvironmentVariables_noValue
=== RUN   TestAccLambdaFunction_encryptedEnvVariables
=== PAUSE TestAccLambdaFunction_encryptedEnvVariables
=== RUN   TestAccLambdaFunction_nameValidation
=== PAUSE TestAccLambdaFunction_nameValidation
=== RUN   TestAccLambdaFunction_versioned
=== PAUSE TestAccLambdaFunction_versioned
=== RUN   TestAccLambdaFunction_versionedUpdate
=== PAUSE TestAccLambdaFunction_versionedUpdate
=== RUN   TestAccLambdaFunction_enablePublish
=== PAUSE TestAccLambdaFunction_enablePublish
=== RUN   TestAccLambdaFunction_disablePublish
=== PAUSE TestAccLambdaFunction_disablePublish
=== RUN   TestAccLambdaFunction_deadLetter
=== PAUSE TestAccLambdaFunction_deadLetter
=== RUN   TestAccLambdaFunction_deadLetterUpdated
=== PAUSE TestAccLambdaFunction_deadLetterUpdated
=== RUN   TestAccLambdaFunction_nilDeadLetter
=== PAUSE TestAccLambdaFunction_nilDeadLetter
=== RUN   TestAccLambdaFunction_fileSystem
=== PAUSE TestAccLambdaFunction_fileSystem
=== RUN   TestAccLambdaFunction_image
=== PAUSE TestAccLambdaFunction_image
=== RUN   TestAccLambdaFunction_architectures
=== PAUSE TestAccLambdaFunction_architectures
=== RUN   TestAccLambdaFunction_architecturesUpdate
=== PAUSE TestAccLambdaFunction_architecturesUpdate
=== RUN   TestAccLambdaFunction_architecturesWithLayer
=== PAUSE TestAccLambdaFunction_architecturesWithLayer
=== RUN   TestAccLambdaFunction_ephemeralStorage
=== PAUSE TestAccLambdaFunction_ephemeralStorage
=== RUN   TestAccLambdaFunction_tracing
=== PAUSE TestAccLambdaFunction_tracing
=== RUN   TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables
=== PAUSE TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables
=== RUN   TestAccLambdaFunction_layers
=== PAUSE TestAccLambdaFunction_layers
=== RUN   TestAccLambdaFunction_layersUpdate
=== PAUSE TestAccLambdaFunction_layersUpdate
=== RUN   TestAccLambdaFunction_vpc
=== PAUSE TestAccLambdaFunction_vpc
=== RUN   TestAccLambdaFunction_vpcRemoval
=== PAUSE TestAccLambdaFunction_vpcRemoval
=== RUN   TestAccLambdaFunction_vpcUpdate
=== PAUSE TestAccLambdaFunction_vpcUpdate
=== RUN   TestAccLambdaFunction_VPC_withInvocation
=== PAUSE TestAccLambdaFunction_VPC_withInvocation
=== RUN   TestAccLambdaFunction_VPCPublishNo_changes
=== PAUSE TestAccLambdaFunction_VPCPublishNo_changes
=== RUN   TestAccLambdaFunction_VPCPublishHas_changes
=== PAUSE TestAccLambdaFunction_VPCPublishHas_changes
=== RUN   TestAccLambdaFunction_VPC_properIAMDependencies
=== PAUSE TestAccLambdaFunction_VPC_properIAMDependencies
=== RUN   TestAccLambdaFunction_emptyVPC
=== PAUSE TestAccLambdaFunction_emptyVPC
=== RUN   TestAccLambdaFunction_s3
=== PAUSE TestAccLambdaFunction_s3
=== RUN   TestAccLambdaFunction_localUpdate
=== PAUSE TestAccLambdaFunction_localUpdate
=== RUN   TestAccLambdaFunction_LocalUpdate_nameOnly
=== PAUSE TestAccLambdaFunction_LocalUpdate_nameOnly
=== RUN   TestAccLambdaFunction_S3Update_basic
=== PAUSE TestAccLambdaFunction_S3Update_basic
=== RUN   TestAccLambdaFunction_S3Update_unversioned
=== PAUSE TestAccLambdaFunction_S3Update_unversioned
=== RUN   TestAccLambdaFunction_runtimes
=== PAUSE TestAccLambdaFunction_runtimes
=== RUN   TestAccLambdaFunction_Zip_validation
=== PAUSE TestAccLambdaFunction_Zip_validation
=== CONT  TestAccLambdaFunction_basic
=== CONT  TestAccLambdaFunction_architecturesUpdate
=== CONT  TestAccLambdaFunction_nameValidation
--- PASS: TestAccLambdaFunction_nameValidation (3.66s)
=== CONT  TestAccLambdaFunction_architectures
--- PASS: TestAccLambdaFunction_basic (51.71s)
=== CONT  TestAccLambdaFunction_image
    function_test.go:1011: AWS_LAMBDA_IMAGE_LATEST_ID, AWS_LAMBDA_IMAGE_V1_ID and AWS_LAMBDA_IMAGE_V2_ID env vars must be set for Lambda Container Image Support acceptance tests. 
--- SKIP: TestAccLambdaFunction_image (0.00s)
=== CONT  TestAccLambdaFunction_fileSystem
--- PASS: TestAccLambdaFunction_architecturesUpdate (67.85s)
=== CONT  TestAccLambdaFunction_nilDeadLetter
--- PASS: TestAccLambdaFunction_architectures (70.49s)
=== CONT  TestAccLambdaFunction_enablePublish
--- PASS: TestAccLambdaFunction_nilDeadLetter (15.43s)
=== CONT  TestAccLambdaFunction_versionedUpdate
--- PASS: TestAccLambdaFunction_enablePublish (70.03s)
=== CONT  TestAccLambdaFunction_versioned
--- PASS: TestAccLambdaFunction_versionedUpdate (80.25s)
=== CONT  TestAccLambdaFunction_VPCPublishNo_changes
--- PASS: TestAccLambdaFunction_versioned (43.77s)
=== CONT  TestAccLambdaFunction_Zip_validation
--- PASS: TestAccLambdaFunction_Zip_validation (3.86s)
=== CONT  TestAccLambdaFunction_runtimes
--- PASS: TestAccLambdaFunction_runtimes (669.98s)
=== CONT  TestAccLambdaFunction_S3Update_unversioned
--- PASS: TestAccLambdaFunction_S3Update_unversioned (60.83s)
=== CONT  TestAccLambdaFunction_S3Update_basic
--- PASS: TestAccLambdaFunction_S3Update_basic (69.09s)
=== CONT  TestAccLambdaFunction_LocalUpdate_nameOnly
--- PASS: TestAccLambdaFunction_fileSystem (985.38s)
=== CONT  TestAccLambdaFunction_disablePublish
--- PASS: TestAccLambdaFunction_LocalUpdate_nameOnly (61.21s)
=== CONT  TestAccLambdaFunction_deadLetterUpdated
--- PASS: TestAccLambdaFunction_disablePublish (50.19s)
=== CONT  TestAccLambdaFunction_deadLetter
--- PASS: TestAccLambdaFunction_deadLetterUpdated (68.61s)
=== CONT  TestAccLambdaFunction_concurrencyCycle
--- PASS: TestAccLambdaFunction_deadLetter (69.70s)
=== CONT  TestAccLambdaFunction_encryptedEnvVariables
--- PASS: TestAccLambdaFunction_concurrencyCycle (73.77s)
=== CONT  TestAccLambdaFunction_localUpdate
--- PASS: TestAccLambdaFunction_encryptedEnvVariables (83.23s)
=== CONT  TestAccLambdaFunction_s3
--- PASS: TestAccLambdaFunction_localUpdate (60.51s)
=== CONT  TestAccLambdaFunction_EnvironmentVariables_noValue
--- PASS: TestAccLambdaFunction_s3 (39.78s)
=== CONT  TestAccLambdaFunction_emptyVPC
--- PASS: TestAccLambdaFunction_EnvironmentVariables_noValue (45.81s)
=== CONT  TestAccLambdaFunction_VPC_properIAMDependencies
--- PASS: TestAccLambdaFunction_emptyVPC (44.95s)
=== CONT  TestAccLambdaFunction_envVariables
--- PASS: TestAccLambdaFunction_envVariables (271.89s)
=== CONT  TestAccLambdaFunction_VPCPublishHas_changes
--- PASS: TestAccLambdaFunction_VPCPublishNo_changes (1808.96s)
=== CONT  TestAccLambdaFunction_expectFilenameAndS3Attributes
--- PASS: TestAccLambdaFunction_expectFilenameAndS3Attributes (15.16s)
=== CONT  TestAccLambdaFunction_layersUpdate
--- PASS: TestAccLambdaFunction_layersUpdate (75.75s)
=== CONT  TestAccLambdaFunction_VPC_withInvocation
--- PASS: TestAccLambdaFunction_VPCPublishHas_changes (547.76s)
=== CONT  TestAccLambdaFunction_vpcUpdate
--- PASS: TestAccLambdaFunction_VPC_properIAMDependencies (1499.79s)
=== CONT  TestAccLambdaFunction_vpcRemoval
--- PASS: TestAccLambdaFunction_vpcRemoval (613.22s)
=== CONT  TestAccLambdaFunction_vpc
--- PASS: TestAccLambdaFunction_VPC_withInvocation (1523.95s)
=== CONT  TestAccLambdaFunction_tracing
--- PASS: TestAccLambdaFunction_tracing (81.38s)
=== CONT  TestAccLambdaFunction_layers
--- PASS: TestAccLambdaFunction_layers (42.80s)
=== CONT  TestAccLambdaFunction_unpublishedCodeUpdate
--- PASS: TestAccLambdaFunction_unpublishedCodeUpdate (65.22s)
=== CONT  TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables
--- PASS: TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables (40.63s)
=== CONT  TestAccLambdaFunction_concurrency
--- PASS: TestAccLambdaFunction_concurrency (58.88s)
=== CONT  TestAccLambdaFunction_codeSigning
--- PASS: TestAccLambdaFunction_codeSigning (71.95s)
=== CONT  TestAccLambdaFunction_disappears
--- PASS: TestAccLambdaFunction_disappears (39.60s)
=== CONT  TestAccLambdaFunction_ephemeralStorage
--- PASS: TestAccLambdaFunction_vpcUpdate (1855.81s)
=== CONT  TestAccLambdaFunction_architecturesWithLayer
--- PASS: TestAccLambdaFunction_ephemeralStorage (64.14s)
=== CONT  TestAccLambdaFunction_tags
--- PASS: TestAccLambdaFunction_architecturesWithLayer (63.42s)
--- PASS: TestAccLambdaFunction_tags (72.39s)
--- PASS: TestAccLambdaFunction_vpc (1546.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	4965.484s

@github-actions github-actions bot added generators Relates to code generators. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. labels Sep 8, 2022
@ewbankkit ewbankkit merged commit dedc15f into hashicorp:main Sep 8, 2022
@github-actions github-actions bot added this to the v4.30.0 milestone Sep 8, 2022
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

This functionality has been released in v4.30.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 Oct 9, 2022

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 9, 2022
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. generators Relates to code generators. service/lambda Issues and PRs that pertain to the lambda service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. 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.

aws_lambda_function does not update correctly when changing KMS key
2 participants