terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
886 stars 657 forks source link

Translate Event type API from SAM template.yaml #438

Closed SolomonHD closed 1 year ago

SolomonHD commented 1 year ago

I'm trying to convert a Lambda Function from a SAM CLI template to Terraform:

Resources:
  MessageTransformerFunction:
    Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
    Properties:
      PackageType: Image
      CodeUri: MessageTransformerFunction
     [...]
      Events:
        MessageTransformer:
          Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
          Properties:
            Path: /transform
            Method: get

How would I convert the Events section? I believe it's related to the aws_lambda_event_source_mapping resource but I do not see any examples that are similar to my use case.

SolomonHD commented 1 year ago

This turned out to not be relevant to my problem which was related to setting runtime, main class in a Java Lambda uploaded by Image instead of the default Zip.

github-actions[bot] commented 1 year ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.