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 updates on empty env vars in aws_lambda_func #29839

Merged
merged 1 commit into from
Mar 10, 2023
Merged

Conversation

nam054
Copy link
Contributor

@nam054 nam054 commented Mar 7, 2023

Description

Resource wanted to repeatedly apply a change on an empty environment.variables. Now it will check that the variable is not empty before flattening.

Relations

Closes #29255

References

Output from Acceptance Testing

> make testacc TESTARGS='-run=TestAccLambdaFunction_' PKG=lambda
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaFunction_ -timeout 180m
=== RUN   TestAccLambdaFunction_basic
.......
--- PASS: TestAccLambdaFunction_VPCPublishHas_changes (2135.68s)
--- PASS: TestAccLambdaFunction_disappears (464.75s)
--- PASS: TestAccLambdaFunction_LocalUpdate_nameOnly (635.94s)
--- PASS: TestAccLambdaFunction_localUpdate (572.40s)
--- PASS: TestAccLambdaFunction_unpublishedCodeUpdate (538.12s)
--- PASS: TestAccLambdaFunction_VPC_replaceSGWithCustom (516.01s)
--- PASS: TestAccLambdaFunction_fileSystem (2193.61s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     2196.658s
...

@github-actions
Copy link

github-actions bot commented Mar 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
Copy link

github-actions bot commented Mar 7, 2023

Hey @nam054 👋 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.)

@github-actions github-actions bot added service/lambda Issues and PRs that pertain to the lambda 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. needs-triage Waiting for first response or review from a maintainer. labels Mar 7, 2023
@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Mar 7, 2023
Resource wanted to repeatedly apply a change on an empty
environment.variables. Now it will check that the variable is not empty
before flattening.
@nam054 nam054 marked this pull request as ready for review March 9, 2023 23:30
Copy link
Member

@jar-b jar-b 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 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_nameValidation (3.90s)
=== CONT  TestAccLambdaFunction_versionedUpdate
--- PASS: TestAccLambdaFunction_Zip_validation (7.98s)
=== CONT  TestAccLambdaFunction_versioned
--- PASS: TestAccLambdaFunction_skipDestroy (47.52s)
=== CONT  TestAccLambdaFunction_architecturesUpdate
--- PASS: TestAccLambdaFunction_snapStart (61.49s)
=== CONT  TestAccLambdaFunction_concurrencyCycle
--- PASS: TestAccLambdaFunction_basic (74.14s)
=== CONT  TestAccLambdaFunction_encryptedEnvVariables
--- PASS: TestAccLambdaFunction_ephemeralStorage (80.49s)
=== CONT  TestAccLambdaFunction_EnvironmentVariables_emptyUpgrade
--- PASS: TestAccLambdaFunction_enablePublish (80.99s)
=== CONT  TestAccLambdaFunction_EnvironmentVariables_noValue
--- PASS: TestAccLambdaFunction_disablePublish (94.89s)
=== CONT  TestAccLambdaFunction_envVariables
--- PASS: TestAccLambdaFunction_architectures (99.75s)
=== CONT  TestAccLambdaFunction_expectFilenameAndS3Attributes
--- PASS: TestAccLambdaFunction_expectFilenameAndS3Attributes (0.85s)
=== CONT  TestAccLambdaFunction_emptyVPC
--- PASS: TestAccLambdaFunction_deadLetter (118.63s)
=== CONT  TestAccLambdaFunction_s3
=== CONT  TestAccLambdaFunction_nilDeadLetter
--- PASS: TestAccLambdaFunction_deadLetterUpdated (124.04s)
--- PASS: TestAccLambdaFunction_s3 (32.76s)
=== CONT  TestAccLambdaFunction_VPC_replaceSGWithCustom
--- PASS: TestAccLambdaFunction_EnvironmentVariables_emptyUpgrade (77.24s)
=== CONT  TestAccLambdaFunction_VPC_properIAMDependencies
--- PASS: TestAccLambdaFunction_versioned (296.41s)
=== CONT  TestAccLambdaFunction_fileSystem
--- PASS: TestAccLambdaFunction_runtimes (340.86s)
=== CONT  TestAccLambdaFunction_VPCPublishHas_changes
--- PASS: TestAccLambdaFunction_vpcRemoval (708.37s)
=== CONT  TestAccLambdaFunction_S3Update_basic
--- PASS: TestAccLambdaFunction_S3Update_basic (54.92s)
=== CONT  TestAccLambdaFunction_S3Update_unversioned
--- PASS: TestAccLambdaFunction_S3Update_unversioned (53.97s)
=== CONT  TestAccLambdaFunction_tracing
--- PASS: TestAccLambdaFunction_localUpdate (1275.73s)
=== CONT  TestAccLambdaFunction_LocalUpdate_nameOnly
--- PASS: TestAccLambdaFunction_EnvironmentVariables_noValue (1225.47s)
=== CONT  TestAccLambdaFunction_layersUpdate
--- PASS: TestAccLambdaFunction_nilDeadLetter (1191.59s)
=== CONT  TestAccLambdaFunction_unpublishedCodeUpdate
--- PASS: TestAccLambdaFunction_concurrencyCycle (1257.54s)
=== CONT  TestAccLambdaFunction_concurrency
--- PASS: TestAccLambdaFunction_emptyVPC (1224.18s)
=== CONT  TestAccLambdaFunction_codeSigning
--- PASS: TestAccLambdaFunction_versionedUpdate (1327.55s)
=== CONT  TestAccLambdaFunction_tags
--- PASS: TestAccLambdaFunction_encryptedEnvVariables (1263.12s)
=== CONT  TestAccLambdaFunction_disappears
--- PASS: TestAccLambdaFunction_envVariables (1278.81s)
=== CONT  TestAccLambdaFunction_layers
--- PASS: TestAccLambdaFunction_VPC_replaceSGWithDefault (1394.46s)
=== CONT  TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables
--- PASS: TestAccLambdaFunction_VPC_withInvocation (1493.96s)
--- PASS: TestAccLambdaFunction_vpcUpdate (1497.78s)
--- PASS: TestAccLambdaFunction_VPC_replaceSGWithCustom (1395.76s)
--- PASS: TestAccLambdaFunction_vpc (1880.16s)
--- PASS: TestAccLambdaFunction_architecturesWithLayer (2108.81s)
--- PASS: TestAccLambdaFunction_tracing (1301.01s)
--- PASS: TestAccLambdaFunction_architecturesUpdate (2072.89s)
--- PASS: TestAccLambdaFunction_layersUpdate (849.67s)
--- PASS: TestAccLambdaFunction_concurrency (839.22s)
--- PASS: TestAccLambdaFunction_disappears (826.19s)
--- PASS: TestAccLambdaFunction_layers (798.48s)
--- PASS: TestAccLambdaFunction_codeSigning (849.12s)
--- PASS: TestAccLambdaFunction_LocalUpdate_nameOnly (902.67s)
--- PASS: TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables (783.95s)
--- PASS: TestAccLambdaFunction_tags (853.22s)
--- PASS: TestAccLambdaFunction_unpublishedCodeUpdate (874.15s)
--- PASS: TestAccLambdaFunction_VPCPublishNo_changes (2266.77s)
--- PASS: TestAccLambdaFunction_VPCPublishHas_changes (1927.76s)
--- PASS: TestAccLambdaFunction_fileSystem (2472.00s)
--- PASS: TestAccLambdaFunction_VPC_properIAMDependencies (2648.74s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     2809.493s

@nam054 nam054 merged commit 57db2b3 into main Mar 10, 2023
@nam054 nam054 deleted the 29255-lambda-fix branch March 10, 2023 22:02
@github-actions github-actions bot added this to the v4.59.0 milestone Mar 10, 2023
github-actions bot pushed a commit that referenced this pull request Mar 10, 2023
@github-actions
Copy link

This functionality has been released in v4.59.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 Apr 16, 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/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.

[Bug]: aws_lambda_function with empty environment variables map flaps
2 participants