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

resource/aws_lambda_function: Properly handle vpc_config removal #5798

Merged
merged 3 commits into from
Sep 5, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Sep 5, 2018

Includes preventing panics as started by #5792

Fixes #5791
Fixes #3784
Fixes #2509

Changes proposed in this pull request:

  • Adds acceptance test (TestAccAWSLambdaFunction_VPCRemoval) to cover vpc_config removal
  • Prevents panic when removing vpc_config
  • Properly handles vpc_config removal to prevent perpetual difference

Previously:

--- FAIL: TestAccAWSLambdaFunction_VPCRemoval (42.52s)
    testing.go:527: Step 1 error: Check failed: Check 2/2 error: aws_lambda_function.lambda_function_test: Attribute 'vpc_config.#' expected "0", got "1"

Output from acceptance testing: (others pending in TeamCity)

31 tests passed (all tests)
--- PASS: TestAccAWSLambdaFunction_nilDeadLetterConfig (17.96s)
--- PASS: TestAccAWSLambdaFunction_importS3 (21.54s)
--- PASS: TestAccAWSLambdaFunction_expectFilenameAndS3Attributes (27.06s)
--- PASS: TestAccAWSLambdaFunction_versioned (30.83s)
--- PASS: TestAccAWSLambdaFunction_basic (37.09s)
--- PASS: TestAccAWSLambdaFunction_importLocalFile (37.63s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_noRuntime (0.48s)
--- PASS: TestAccAWSLambdaFunction_updateRuntime (39.90s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (48.67s)
--- PASS: TestAccAWSLambdaFunction_VPCRemoval (50.55s)
--- PASS: TestAccAWSLambdaFunction_VPC (51.22s)
--- PASS: TestAccAWSLambdaFunction_localUpdate (30.33s)
--- PASS: TestAccAWSLambdaFunction_s3 (35.32s)
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (32.29s)
--- PASS: TestAccAWSLambdaFunction_versionedUpdate (62.81s)
--- PASS: TestAccAWSLambdaFunction_s3Update_unversioned (29.28s)
--- PASS: TestAccAWSLambdaFunction_tracingConfig (66.61s)
--- PASS: TestAccAWSLambdaFunction_s3Update_basic (37.50s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfig (69.89s)
--- PASS: TestAccAWSLambdaFunction_importLocalFile_VPC (76.53s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_nodeJs43 (38.74s)
--- PASS: TestAccAWSLambdaFunction_concurrency (77.12s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python27 (40.97s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python36 (30.25s)
--- PASS: TestAccAWSLambdaFunction_VPCUpdate (81.65s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_java8 (35.09s)
--- PASS: TestAccAWSLambdaFunction_concurrencyCycle (88.68s)
--- PASS: TestAccAWSLambdaFunction_envVariables (89.78s)
--- PASS: TestAccAWSLambdaFunction_tags (40.89s)
--- PASS: TestAccAWSLambdaFunction_encryptedEnvVariables (94.16s)
--- PASS: TestAccAWSLambdaFunction_VPC_withInvocation (119.74s)

saravanan30erd and others added 3 commits September 5, 2018 15:57
Includes preventing panics as started by #5792

* Adds acceptance test (`TestAccAWSLambdaFunction_VPCRemoval`) to cover `vpc_config` removal
* Prevents panic when removing `vpc_config`
* Properly handles vpc_config removal to prevent perpetual difference

Previously:

```
--- FAIL: TestAccAWSLambdaFunction_VPCRemoval (42.52s)
    testing.go:527: Step 1 error: Check failed: Check 2/2 error: aws_lambda_function.lambda_function_test: Attribute 'vpc_config.#' expected "0", got "1"
```

Now:

```
--- PASS: TestAccAWSLambdaFunction_VPCRemoval (51.23s)
```
@bflad bflad added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/lambda Issues and PRs that pertain to the lambda service. labels Sep 5, 2018
@bflad bflad requested a review from a team September 5, 2018 17:26
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bflad bflad added this to the v1.35.0 milestone Sep 5, 2018
@bflad bflad merged commit 1c84f11 into master Sep 5, 2018
@bflad bflad deleted the b-aws_lambda_function-empty-vpc-handling branch September 5, 2018 18:05
bflad added a commit that referenced this pull request Sep 5, 2018
@bflad
Copy link
Contributor Author

bflad commented Sep 6, 2018

This has been released in version 1.35.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
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. crash Results from or addresses a Terraform crash or kernel panic. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-provider-v1.34: unexpected EOF Terraform crashed aws_lambda_function.lambda-name: unexpected EOF
3 participants