dist: bionic
language: generic
os: linux

branches:
  only:
    - deploy

deploy:
  - provider: lambda
    access_key_id: $AWS_S3_ACCESS_KEY_ID
    secret_access_key: $AWS_S3_SECRET_ACCESS_KEY
    region: "us-east-1"
    function_name: "blog-martincostello-com-redirect-folders"
    role: "arn:aws:iam::492538393790:role/service-role/lambda_basic_execution_cloudfront_edge"
    handler_name: "handler"
    module_name: "cloudfront-folders"
    timeout: 1,
    runtime: "nodejs10.x"
    zip: "cloudfront-folders.js"
    publish: true
  - provider: lambda
    access_key_id: $AWS_S3_ACCESS_KEY_ID
    secret_access_key: $AWS_S3_SECRET_ACCESS_KEY
    region: "us-east-1"
    function_name: "blog-martincostello-com-response-headers"
    role: "arn:aws:iam::492538393790:role/service-role/lambda_basic_execution_cloudfront_edge"
    handler_name: "handler"
    module_name: "cloudfront-headers"
    timeout: 1,
    runtime: "nodejs10.x"
    zip: "cloudfront-headers.js"
    publish: true

dist: bionic
language: generic
os: linux

branches:
  only:
    - deploy

deploy:
  - provider: lambda
    access_key_id: $AWS_S3_ACCESS_KEY_ID
    secret_access_key: $AWS_S3_SECRET_ACCESS_KEY
    region: "us-east-1"
    function_name: "blog-martincostello-com-redirect-folders"
    role: "arn:aws:iam::492538393790:role/service-role/lambda_basic_execution_cloudfront_edge"
    handler_name: "handler"
    module_name: "cloudfront-folders"
    timeout: 1,
    runtime: "nodejs10.x"
    zip: "cloudfront-folders.js"
    publish: true
    on:
      branch: deploy
  - provider: lambda
    access_key_id: $AWS_S3_ACCESS_KEY_ID
    secret_access_key: $AWS_S3_SECRET_ACCESS_KEY
    region: "us-east-1"
    function_name: "blog-martincostello-com-response-headers"
    role: "arn:aws:iam::492538393790:role/service-role/lambda_basic_execution_cloudfront_edge"
    handler_name: "handler"
    module_name: "cloudfront-headers"
    timeout: 1,
    runtime: "nodejs10.x"
    zip: "cloudfront-headers.js"
    publish: true
    on:
      branch: deploy

Fix Lambda not being deployed
Fix Lambda not being deployed

Turns out you have to specifically allow deploy to be deployed...
