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 Disable lambda from being triggered by setting reserved_concurrent_executions to 0 #3806

Merged
merged 2 commits into from
Feb 23, 2019

Conversation

Puneeth-n
Copy link
Contributor

@Puneeth-n Puneeth-n commented Mar 16, 2018

closes #3803

AWS_REGION=us-east-1 make testacc TESTARGS='-run=TestAccAWSLambdaFunction_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSLambdaFunction_ -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSLambdaFunction_importLocalFile
--- PASS: TestAccAWSLambdaFunction_importLocalFile (42.48s)
=== RUN   TestAccAWSLambdaFunction_importLocalFile_VPC
--- PASS: TestAccAWSLambdaFunction_importLocalFile_VPC (43.17s)
=== RUN   TestAccAWSLambdaFunction_importS3
--- PASS: TestAccAWSLambdaFunction_importS3 (44.41s)
=== RUN   TestAccAWSLambdaFunction_basic
--- PASS: TestAccAWSLambdaFunction_basic (37.53s)
=== RUN   TestAccAWSLambdaFunction_concurrency
--- PASS: TestAccAWSLambdaFunction_concurrency (82.14s)
=== RUN   TestAccAWSLambdaFunction_concurrencyCycle
--- PASS: TestAccAWSLambdaFunction_concurrencyCycle (104.85s)
=== RUN   TestAccAWSLambdaFunction_updateRuntime
--- PASS: TestAccAWSLambdaFunction_updateRuntime (59.85s)
=== RUN   TestAccAWSLambdaFunction_expectFilenameAndS3Attributes
--- PASS: TestAccAWSLambdaFunction_expectFilenameAndS3Attributes (26.76s)
=== RUN   TestAccAWSLambdaFunction_envVariables
--- PASS: TestAccAWSLambdaFunction_envVariables (101.95s)
=== RUN   TestAccAWSLambdaFunction_encryptedEnvVariables
--- PASS: TestAccAWSLambdaFunction_encryptedEnvVariables (79.26s)
=== RUN   TestAccAWSLambdaFunction_versioned
--- PASS: TestAccAWSLambdaFunction_versioned (53.19s)
=== RUN   TestAccAWSLambdaFunction_versionedUpdate
--- PASS: TestAccAWSLambdaFunction_versionedUpdate (59.37s)
=== RUN   TestAccAWSLambdaFunction_DeadLetterConfig
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfig (38.38s)
=== RUN   TestAccAWSLambdaFunction_DeadLetterConfigUpdated
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (59.80s)
=== RUN   TestAccAWSLambdaFunction_nilDeadLetterConfig
--- PASS: TestAccAWSLambdaFunction_nilDeadLetterConfig (26.67s)
=== RUN   TestAccAWSLambdaFunction_tracingConfig
--- PASS: TestAccAWSLambdaFunction_tracingConfig (59.21s)
=== RUN   TestAccAWSLambdaFunction_VPC
--- PASS: TestAccAWSLambdaFunction_VPC (40.62s)
=== RUN   TestAccAWSLambdaFunction_VPCUpdate
--- PASS: TestAccAWSLambdaFunction_VPCUpdate (71.15s)
=== RUN   TestAccAWSLambdaFunction_VPC_withInvocation
--- PASS: TestAccAWSLambdaFunction_VPC_withInvocation (100.99s)
=== RUN   TestAccAWSLambdaFunction_s3
--- PASS: TestAccAWSLambdaFunction_s3 (42.01s)
=== RUN   TestAccAWSLambdaFunction_localUpdate
--- FAIL: TestAccAWSLambdaFunction_localUpdate (38.58s)
	testing.go:518: Step 1 error: Check failed: Check 5/5 error: Expected time attribute data.template_file.last_modified.rendered with value 2018-03-19T13:45:03.108+0000 was not before 2018-03-19T13:45:05Z
=== RUN   TestAccAWSLambdaFunction_localUpdate_nameOnly
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (45.44s)
=== RUN   TestAccAWSLambdaFunction_s3Update_basic
--- PASS: TestAccAWSLambdaFunction_s3Update_basic (95.66s)
=== RUN   TestAccAWSLambdaFunction_s3Update_unversioned
--- PASS: TestAccAWSLambdaFunction_s3Update_unversioned (70.01s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_noRuntime
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_noRuntime (1.67s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_nodeJs43
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_nodeJs43 (37.11s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_python27
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python27 (36.68s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_java8
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_java8 (39.05s)
=== RUN   TestAccAWSLambdaFunction_tags
--- PASS: TestAccAWSLambdaFunction_tags (82.64s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_python36
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python36 (37.54s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	1658.207s
GNUmakefile:18: recipe for target 'testacc' failed
make: *** [testacc] Error 1

@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Mar 16, 2018
@austinbyers
Copy link

austinbyers commented Mar 16, 2018

Thanks for the change @Puneeth-n! Just keep in mind that people might be relying on 0 as the default value right now, so this is a breaking change.

In other words, if someone has a Lambda function with 0 concurrency in the current provider version, their Lambda will run without any limit. But after this change, their existing config (with a 0 value) will stop all invocations of their function

This just needs to be very clearly explained in the release notes

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service. labels Mar 16, 2018
@Puneeth-n Puneeth-n force-pushed the fix/lambda-concurrency branch from 2f02da7 to 3cdb3f6 Compare March 19, 2018 13:24
@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Mar 19, 2018
@Puneeth-n
Copy link
Contributor Author

@bflad used the validate function from validators. I noticed that an unrelated test is failing on master.

AWS_REGION=us-east-1 make testacc TESTARGS='-run=TestAccAWSLambdaFunction_localUpdate'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSLambdaFunction_localUpdate -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSLambdaFunction_localUpdate
--- FAIL: TestAccAWSLambdaFunction_localUpdate (39.34s)
	testing.go:513: Step 1 error: Check failed: Check 5/5 error: Expected time attribute data.template_file.last_modified.rendered with value 2018-03-19T13:20:28.580+0000 was not before 2018-03-19T13:20:30Z
=== RUN   TestAccAWSLambdaFunction_localUpdate_nameOnly
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (44.93s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	84.296s
GNUmakefile:18: recipe for target 'testacc' failed
make: *** [testacc] Error 1

@Puneeth-n
Copy link
Contributor Author

@bflad any update on this?

@Puneeth-n
Copy link
Contributor Author

Puneeth-n commented Apr 3, 2018

@radeksimko @Ninir Can you please review it? :)

@bflad
Copy link
Contributor

bflad commented Jun 29, 2018

@Puneeth-n sorry this got lost in the shuffle 😅 Could you rebase this and we'll get it in? Thanks so much.

@Puneeth-n
Copy link
Contributor Author

@bflad Finally :D Sure. Will fix it!

@bflad
Copy link
Contributor

bflad commented Jul 23, 2018

We're starting to see some duplicate issues/pull requests for this functionality: #5288

I'm still worried that since this could potentially cause production downtime (due to the nature of the change) that we might need to relegate this merge to only happen during the next major version upgrade of the provider, likely in the coming weeks before Terraform 0.12. For now, I'm going to tag this with the breaking-change label and 2.0.0 milestone just to ensure its on our radar for that timeframe and denote its severity.

@bflad bflad added the breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. label Jul 23, 2018
@bflad bflad added this to the v2.0.0 milestone Jul 23, 2018
@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Jul 23, 2018
@zioproto
Copy link

Is this ever going to be merged in Terraform 0.11.x ? thanks

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thanks so much for updating this and your patience, @Puneeth-n! Version 2.0.0 is under development and its finally time to get this in. 🚀

--- PASS: TestAccAWSLambdaFunction_expectFilenameAndS3Attributes (25.78s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_ruby25 (40.63s)
--- PASS: TestAccAWSLambdaFunction_basic (42.41s)
--- PASS: TestAccAWSLambdaFunction_versioned (43.17s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_java8 (45.94s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python37 (47.47s)
--- PASS: TestAccAWSLambdaFunction_tracingConfig (55.90s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_noRuntime (0.51s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_NodeJs810 (58.15s)
--- PASS: TestAccAWSLambdaFunction_updateRuntime (58.57s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_provided (59.36s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python36 (61.23s)
--- PASS: TestAccAWSLambdaFunction_importLocalFile (62.93s)
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python27 (67.81s)
--- PASS: TestAccAWSLambdaFunction_VPC (69.12s)
--- PASS: TestAccAWSLambdaFunction_concurrency (72.31s)
--- PASS: TestAccAWSLambdaFunction_nilDeadLetterConfig (27.31s)
--- PASS: TestAccAWSLambdaFunction_importS3 (34.71s)
--- PASS: TestAccAWSLambdaFunction_VPCRemoval (82.75s)
--- PASS: TestAccAWSLambdaFunction_tags (83.08s)
--- PASS: TestAccAWSLambdaFunction_Layers (42.51s)
--- PASS: TestAccAWSLambdaFunction_localUpdate (36.10s)
--- PASS: TestAccAWSLambdaFunction_LayersUpdate (63.71s)
--- PASS: TestAccAWSLambdaFunction_EmptyVpcConfig (33.03s)
--- PASS: TestAccAWSLambdaFunction_s3 (33.53s)
--- PASS: TestAccAWSLambdaFunction_envVariables (95.34s)
--- PASS: TestAccAWSLambdaFunction_concurrencyCycle (98.47s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (55.97s)
--- PASS: TestAccAWSLambdaFunction_encryptedEnvVariables (103.52s)
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (46.41s)
--- PASS: TestAccAWSLambdaFunction_s3Update_unversioned (49.28s)
--- PASS: TestAccAWSLambdaFunction_s3Update_basic (47.92s)
--- PASS: TestAccAWSLambdaFunction_importLocalFile_VPC (45.58s)
--- PASS: TestAccAWSLambdaFunction_versionedUpdate (54.07s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfig (58.46s)
--- PASS: TestAccAWSLambdaFunction_VPCUpdate (65.26s)
--- PASS: TestAccAWSLambdaFunction_VPC_withInvocation (113.21s)

@ghost
Copy link

ghost commented Mar 31, 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 Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change Introduces a breaking change in current functionality; usually deferred to the next major release. enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reserved_concurrent_executions for aws_lambda_function does not support 0 concurrency
4 participants