Skip to content

EventInvokeConfig does not appear in processed template when following the spec #3602

Closed
@Tristano8

Description

@Tristano8

Description

Using an EventInvokeConfig results in a processed template that ignores these fields completely

Steps to reproduce

Deploy something like the following template:

Resources:
  ErrorReporterFunction:
    Properties:
      AutoPublishAlias: 'Live'
      CodeUri: 'bootstrap-file'
      FunctionName:
        'Fn::Sub': "${AWS::StackName}-error-reporter-function"
      Handler: 'UNUSED'
      LoggingConfig:
        ApplicationLogLevel: 'DEBUG'
        LogFormat: 'JSON'
        SystemLogLevel:
          Fn::FindInMap:
            - LambdaLogLevel
            - Ref: 'LogSeverity'
            - System
      MemorySize: 512
      Policies:
        - 'AWSLambdaBasicExecutionRole'
      Runtime: 'provided.al2'
      Timeout: 300
    Type: 'AWS::Serverless::Function'
  MyFunction:
    EventInvokeConfig:
      DestinationConfig:
        OnFailure:
          Destination': !GetAtt ErrorReporterFunction.Arn
          Type: 'Lambda'
    Properties:
      AutoPublishAlias: 'Live'
      CodeUri: 'other-bootstrap-file'
      FunctionName:
        'Fn::Sub': "${AWS::StackName}-my-lambda"
      Handler: 'UNUSED'
      LoggingConfig:
        ApplicationLogLevel: 'DEBUG'
        LogFormat: 'JSON'
        SystemLogLevel:
          Fn::FindInMap:
            - LambdaLogLevel
            - Ref: 'LogSeverity'
            - System
      MemorySize: 512
      Policies:
        - 'AWSLambdaBasicExecutionRole'
      Runtime: 'provided.al2'
      Timeout: 300
    Type: 'AWS::Serverless::Function'

Observed result

The processed template after deployment looks something like the following for MyFunction:

"MyFunction": {
      "Type": "AWS::Lambda::Function",
      "DependsOn": [
        "ValidationProducerFunctionLogGroup"
      ],
      "Properties": {
        "Code": {
          "S3Bucket": "<bucket-name>",
          "S3Key": "<bootstrap-hash>"
        },
        "FunctionName": {
          "Fn::Sub": "${AWS::StackName}-my-lambda"
        },
        "Handler": "UNUSED",
        "MemorySize": 512
}

No reference to the EventInvokeConfig exist anywhere in the processed template.

Deploying the following as a top level resource seems to work:

EventInvokeConfig:
    Type: AWS::Lambda::EventInvokeConfig
    Properties:
      FunctionName: !Ref MyFunction
      Qualifier: "Live"
      DestinationConfig:
        OnFailure:
          Destination: !GetAtt ErrorReporterFunction.Arn

Expected result

The transform should include my declared EventInvokeConfig in the processed template

Additional environment details

  1. OS: MacOs 14.4.1
  2. If using the SAM CLI, sam --version:
  3. AWS region: us-east-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions