extraneous key [DestinationConfig] is not permitted

0

I am trying to add the destination config into my cloud formation script. getting an error "extraneous key [DestinationConfig] is not permitted" Properties: DestinationConfig: OnSuccess: Destination: !Sub "arn:aws:sns:${AWS::Region}:${AWS::AccountId}:MyErrors2"

질문됨 일 년 전365회 조회
1개 답변
0

You don't say but I assume you're referring to https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig.html - I ask because there is one other place where DestinationConfig is used but it doesn't have an option of OnSuccess so I think I'm in the right place.

It would help a lot if you could paste a larger snippet of your CloudFormation template - because what you've given looks ok but it's impossible to tell without the preceding lines.

Editing here because it provides better formatting that in comments

Ok. You're putting the DestinationConfig part into the AWS::Lambda::Function section - but that's not where it goes. You need to create a different section which is AWS::Lambda::EventInvoke as per the documentation.

profile pictureAWS
전문가
답변함 일 년 전
  • AWSTemplateFormatVersion: "2010-09-09" Description: "my sync Lambda Functions stack" Parameters:
    PrivateSubnet1: Type: 'AWS::EC2::Subnet::Id'
    PrivateSubnet2:
    Type: 'AWS::EC2::Subnet::Id' PrivateSecurityGroupID: Type: 'AWS::EC2::SecurityGroup::Id' Resources: EmployeeSyncFunction: Type: "AWS::Lambda::Function" Properties: Description: "" FunctionName: "EmployeeSync" Handler: "MyLambda::MyLambda.Functions::SyncEmployees" Architectures: - "x86_64" Code: S3Bucket: "my-lambda-s3" S3Key: "MyApp.zip" MemorySize: 512 Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/AWSLambdaBasicExecutionRole" Runtime: "dotnet6" Timeout: 15 TracingConfig: Mode: "PassThrough" VpcConfig: SubnetIds: - !Ref PrivateSubnet1 - !Ref PrivateSubnet2 SecurityGroupIds: - !Ref PrivateSecurityGroupID EphemeralStorage: Size: 512 Tags: - Key: "Project" Value: "My app"
    ReservedConcurrentExecutions: 100 DestinationConfig: OnFailure: Destination: "arn:aws:sns:${AWS::Region}:${AWS::AccountId}:Errors2"

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠