lambda

Deploy a Serverless service (functions and resources) to AWS lambda

arguments

  • AWS_CREDENTIALS_FILE - Base64 encoded AWS credentials file
  • AWS_PROFILE - AWS credentials profile
  • AWS_REGION - AWS region
  • AWS_SHARED_CREDENTIALS_FILE - Path to shared AWS credentials file
  • AWS_STAGE - AWS API Gateway stage
  • PACKAGE - Serverless Framework package folder
    version: '1.0'
steps:
  setup:
    image: 'alpine:3.7'
    title: generate AWS shared credentials file
    commands:
      - mkdir -p .aws
      - 'echo -n $AWS_CREDENTIALS_FILE | base64 -d > ${PWD}/.aws/credentials'
      - 'cf_export AWS_SHARED_CREDENTIALS_FILE=${PWD}/.aws/credentials'
  package:
    image: codefreshplugins/cf-plugin-serverless
    title: package serverless service
    working_directory: '${{main_clone}}/examples/aws-node-simple-http-endpoint'
    commands:
      - >-
        serverless package --stage ${AWS_STAGE} --region ${AWS_REGION} --package
        ${PACKAGE}
  deploy:
    type: serverless
    title: deploy to AWS with serverless framework
    arguments:
      PACKAGE: '${{PACKAGE}}'
      AWS_CREDENTIALS_FILE: '${{AWS_CREDENTIALS_FILE}}'
      AWS_SHARED_CREDENTIALS_FILE: '${{AWS_SHARED_CREDENTIALS_FILE}}'
      AWS_REGION: '${{AWS_REGION}}'
      AWS_PROFILE: '${{AWS_PROFILE}}'
      AWS_STAGE: '${{AWS_STAGE}}'

  
github.com
Francisco Cocozza
Sep 18, 2019