Skip to content

Lambda Layers not added when deploying through AWS CodeBuild #5667

@Chanonry

Description

@Chanonry

This is a Bug Report

Description

  • What went wrong?

When the stack is deployed through AWS CodePipeline/CodeBuild using the sls deploy --verbose command the stack deploys correctly EXCEPT the pre-defined layers are not (shown in the console as) attached to any functions.

When the same stack is deployed from the terminal with sls deploy --verbose all layers are attached correctly.

  • What did you expect should have happened?

Full stack deployment and lambda layers correctly attached

  • What was the config you used?

service: repair-test

custom:
test: ${ssm:/pgdata/dev/test_mode}
loglevel: ${ssm:/pgdata/dev/loglevel}
acctno: xxxxxxxxxxxx

package:
individually: true

provider:
name: aws
runtime: python3.6
stage: dev
region: us-west-2
memorySize: 128
timeout: 12
role: arn:aws:iam::${self:custom.acctno}:role/service-role/simpleMicroservice

functions:
pdfRepair:
handler: repairhandler100.handler
package:
artifact: ${env:CODEBUILD_SRC_DIR}/1-pdfRepair/1-pdfRepair.zip
environment:
loglevel: ${self:custom.loglevel}
opq:
Fn::ImportValue: pgdatainfra-pdfrepair-data-Qurl
problem_q_url:
Fn::ImportValue: pgdatainfra-pdfproblem-data-Qurl
dlq:
Fn::ImportValue: pgdatainfra-dlq-Qurl
test_mode: ${self:custom.test}
test_q_url:
Fn::ImportValue: pgdatainfra-pdfrepair-test-Qurl
events:
- sqs:
arn:arn:aws:sqs:${self:provider.region}:${self:custom.acctno}:pgdatainfra-start-data
batchSize: 1
layers:
- ${cf:pypdf2-layer-dev.Pypdf2LayerExport}
- ${cf:pdftk-layer-dev.PdftkLayerExport}
- ${cf:core-pgdata-layer-dev.CorePdLayerExport}

  • What stacktrace or error message from your provider did you see?

[Container] 2019/01/09 11:05:54 Running command sls deploy --verbose
Serverless: Packaging service...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
CloudFormation - CREATE_IN_PROGRESS - AWS::CloudFormation::Stack - repair-test-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - repair-test-dev
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (3.51 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - repair-test-dev
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - repair-test-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - PdfRepairLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - PdfRepairLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - PdfRepairLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - PdfRepairLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - PdfRepairLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - PdfRepairLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::EventSourceMapping - PdfRepairEventSourceMappingSQSPgdatainfrastartdata
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - PdfRepairLambdaVersionRLvKL3oixuH8h2wJM7d6QdN5SCNTNl7KxyrnanBE
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::EventSourceMapping - PdfRepairEventSourceMappingSQSPgdatainfrastartdata
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - PdfRepairLambdaVersionRLvKL3oixuH8h2wJM7d6QdN5SCNTNl7KxyrnanBE
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - PdfRepairLambdaVersionRLvKL3oixuH8h2wJM7d6QdN5SCNTNl7KxyrnanBE
CloudFormation - CREATE_COMPLETE - AWS::Lambda::EventSourceMapping - PdfRepairEventSourceMappingSQSPgdatainfrastartdata
CloudFormation - UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - repair-test-dev
CloudFormation - UPDATE_COMPLETE - AWS::CloudFormation::Stack - repair-test-dev
Serverless: Stack update finished...
Service Information
service: repair-test
stage: dev
region: us-west-2
stack: repair-test-dev
api keys:
None
endpoints:
None
functions:
pdfRepair: repair-test-dev-pdfRepair
Stack Outputs
PdfRepairLambdaFunctionQualifiedArn: arn:aws:lambda:us-west-2:776476655456:function:repair-test-dev-pdfRepair:9
ServerlessDeploymentBucketName: repair-test-dev-serverlessdeploymentbucket-ixwzgasqz1bf
[Container] 2019/01/09 11:07:24 Phase complete: BUILD Success: true
[Container] 2019/01/09 11:07:24 Phase context status code: Message:
[Container] 2019/01/09 11:07:25 Entering phase POST_BUILD
[Container] 2019/01/09 11:07:25 Phase complete: POST_BUILD Success: true
[Container] 2019/01/09 11:07:25 Phase context status code: Message:

Similar or dependent issues:

Additional Data

  • Serverless Framework Version you're using:
    1.35.1
  • Operating System:
    Darwin 17.3.0
  • Stack Trace:
  • Provider Error messages:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions