Skip to content

Pipelines: Support creating lambdas where code is in another repository #13600

@Gtofig

Description

@Gtofig

Provide a mechanism to construct lambda Code object from a build artifact

Use Case

In the standard CodePipeline world I would use CfnParametersCode to pass lambda code and would use CloudFormationCreateUpdateStackAction with parameterOverrides to pass lambda code from the build artifact. However, CDK Pipeline has no means to override CFN parameters, therefore this method no longer works. Using Code.fromAsset only works when lambda code is in the same repo, and I don't think there is any other way to create lambda function where code comes from another repository.

I also tried using Code.fromBucket(Bucket.fromBucketName(this, 'ServiceBuildArtifactBucket', serviceBuildArtifact.bucketName), serviceBuildArtifact.objectKey) but this fails with Template Error: Encountered unsupported function: Fn::GetArtifactAtt.

Proposed Solution

Either allow overriding CFN parameters in CDK Pipeline, or provide a new mechanism to create Code object (ex: Code.fromArtifact) with a solution around Fn::GetArtifactAtt issue.

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions