Skip to content

Commit

Permalink
Add prop to pass IAM policies to build project.
Browse files Browse the repository at this point in the history
  • Loading branch information
nateglims committed Jan 4, 2024
1 parent 15aa7c5 commit 70c0fb6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/embedded-linux-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export interface EmbeddedLinuxPipelineProps extends cdk.StackProps {
readonly projectKind?: ProjectKind;
/** A name for the layer-repo that is created. Default is 'layer-repo' */
readonly layerRepoName?: string;
/** Additional policy statements to add to the build project. */
readonly buildPolicyAdditions?: iam.PolicyStatement[];
}

/**
Expand Down Expand Up @@ -199,6 +201,10 @@ export class EmbeddedLinuxPipelineStack extends cdk.Stack {
},
});

if (props.buildPolicyAdditions) {
props.buildPolicyAdditions.map(p => project.addToRolePolicy(p))
}

if (props.projectKind && props.projectKind == ProjectKind.PokyAmi) {
outputBucket.grantReadWrite(project);
project.addToRolePolicy(this.addVMExportPolicy());
Expand Down

0 comments on commit 70c0fb6

Please sign in to comment.