Can AWS CodePipeline access the different folders from the source artifact?

17 Views Asked by At

A source artifact is created in an AWS CodePipeline source stage:

const sourceOutput = new cdk.aws_codepipeline.Artifact('sourceOutput');

const sourceAction = new cdk.aws_codepipeline_actions.CodeCommitSourceAction({
...
output: sourceOutput,
});

The source contains a folder structure and each folder needs to be deployed to a specific S3 bucket. Is it possible for the CodePipeline to access the contents of the artifact and deploy them as needed? For example:

new cdk.aws_codepipeline_actions.S3DeployAction({
...
input: sourceOutput.atPath('/folder_a').artifact,
bucket: "some_bucket",
objectKey: "some_key",
});

new cdk.aws_codepipeline_actions.S3DeployAction({
...
input: sourceOutput.atPath('/folder_b').artifact,
bucket: "some_bucket",
objectKey: "some_other",
});

The solution creates the S3 objects at some_bucket/some_key and some_bucket/some_other correctly, but it deploys the whole artifact to each folder instead of only the contents of folder_a and folder_b.

0

There are 0 best solutions below