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

Add support for Lambda Destinations for Asynchronous Invocations #11087

Closed
sammefford opened this issue Dec 2, 2019 · 5 comments · Fixed by #11165
Closed

Add support for Lambda Destinations for Asynchronous Invocations #11087

sammefford opened this issue Dec 2, 2019 · 5 comments · Fixed by #11165
Assignees
Labels
new-resource Introduces a new resource. service/lambda Issues and PRs that pertain to the lambda service.
Milestone

Comments

@sammefford
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Lambdas will be significantly faster (less expensive) and simpler (no more routing or retries in lambda code) with the addition of Destinations for Asynchronous Invocations.

New or Affected Resource(s)

  • aws_lambda_function
  • aws_lambda_event_destination_mapping (new)

Potential Terraform Configuration

resource "aws_lambda_function" "this" {
    ...
    event_invoke_config {
        maximum_retry_attempts = "..."
        maximum_event_age_in_seconds = "..."
    }
}

resource "aws_lambda_destination" "this" {
    function_name = "..."
    destination_config = {
        on_success = {
            destination = "..."
        }
        on_failure = {
            destination = "..."
        }
    }
}

References

@sammefford sammefford added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 2, 2019
@ghost ghost added the service/lambda Issues and PRs that pertain to the lambda service. label Dec 2, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 2, 2019
@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Dec 5, 2019
@bflad
Copy link
Contributor

bflad commented Dec 5, 2019

I'll pick this one up since it is similar in configuration and testing to the new Lambda Provisioned Concurrency configuration. Since the API refers to these as "FunctionEventInvokeConfig", we'll probably stick with an admittedly uglier aws_lambda_function_event_invoke_config resource naming. We'll also want to introduce this solely as a separate resource to prevent multiple Terraform resources from being able to manage the same underlying infrastructure configuration.

@bflad bflad self-assigned this Dec 5, 2019
@bflad bflad added new-resource Introduces a new resource. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Dec 5, 2019
@bflad
Copy link
Contributor

bflad commented Dec 6, 2019

Pull request submitted: #11165

bflad added a commit that referenced this issue Dec 6, 2019
Reference: #11087

Output from acceptance testing:

```
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_AliasName (39.02s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunction (41.57s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_FunctionName_Arn (48.59s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_Latest (67.00s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_MaximumEventAgeInSeconds (68.94s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunctionEventInvokeConfig (70.85s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Swap (75.07s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Remove (92.63s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_basic (101.05s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_FunctionVersion (108.37s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_MaximumRetryAttempts (111.47s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnFailure_Destination (118.33s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnSuccess_Destination (121.72s)
```
bflad added a commit that referenced this issue Dec 6, 2019
Reference: #11087

Output from acceptance testing:

```
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_AliasName (39.02s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunction (41.57s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_FunctionName_Arn (48.59s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_Latest (67.00s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_MaximumEventAgeInSeconds (68.94s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunctionEventInvokeConfig (70.85s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Swap (75.07s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Remove (92.63s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_basic (101.05s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_FunctionVersion (108.37s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_MaximumRetryAttempts (111.47s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnFailure_Destination (118.33s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnSuccess_Destination (121.72s)
```
bflad added a commit that referenced this issue Dec 18, 2019
Reference: #11087

Output from acceptance testing:

```
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_AliasName (39.02s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunction (41.57s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_FunctionName_Arn (48.59s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_Latest (67.00s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_MaximumEventAgeInSeconds (68.94s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunctionEventInvokeConfig (70.85s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Swap (75.07s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Remove (92.63s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_basic (101.05s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_FunctionVersion (108.37s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_MaximumRetryAttempts (111.47s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnFailure_Destination (118.33s)
--- PASS: TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnSuccess_Destination (121.72s)
```
@bflad bflad added this to the v2.43.0 milestone Dec 18, 2019
@bflad
Copy link
Contributor

bflad commented Dec 18, 2019

Support for the new aws_lambda_function_event_invoke_config resource has been merged and will release with version 2.43.0 of the Terraform AWS Provider, Thursday this week. 👍

@ghost
Copy link

ghost commented Dec 19, 2019

This has been released in version 2.43.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 for triage. Thanks!

@ghost
Copy link

ghost commented Jan 17, 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 Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants