lambda-cloudformation-example.yaml

CloudFormation template for Lambda deployment .

3

Votes

AWSTemplateFormatVersion: "2010-09-09"
Description: Illustrating CF Lambdas
Resources:
  MyFunction:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: Blog_Test_Fn
      Description: Testing the behavior of CloudFormation
      Handler: com.nike.snsfifo.SnsFifoSubscriberMain::handleRequest
      Runtime: java8
      MemorySize: 640
      Timeout: 10
      Role: !Join
        - ""
        - - "arn:aws:iam::"
          - !Ref "AWS::AccountId"
          - ":role/"
          - "My-Lambda-Role"
      Code:
        S3Bucket: deploy.nikecloud.com
        S3Key: kender/blog/code.jar

  Version1:
    Type: AWS::Lambda::Version
    Properties:
      Description: "Version 1"
      FunctionName: !Ref MyFunction
      CodeSha256: "R/rU8R/MScTy3A+kTO/tselEFCa+eAkGZh+/72maIM0="

  Version2:
    Type: AWS::Lambda::Version
    Properties:
      Description: "Version 2"
      FunctionName: !Ref MyFunction
      CodeSha256: "PVBfMAYzT9HXoD/T0IjqbI4Mvu1SY+Pldh0pkC4LkNg="

  Canary:
    Type: AWS::Lambda::Alias
    Properties:
      Name: Production_Canary
      Description: Production Canary
      FunctionName: !Ref MyFunction
      FunctionVersion: !GetAtt [ Version1, Version ]
      RoutingConfig:
        AdditionalVersionWeights:
          - FunctionVersion: !GetAtt
            - Version2
            - Version
- FunctionWeight: 0.1

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png