in hybrid-nodes-cdk/lib/nodeadm-stack.ts [312:365]
createIntegrationTestBuild() {
if (this.nodeadmBinaryBucket === undefined) {
throw new Error('`nodeadmBinaryBucket` is not defined');
}
if (this.goproxySecret === undefined) {
throw new Error('`goproxySecret` is not defined');
}
if (this.nodeadmLogsBucket === undefined) {
throw new Error('`nodeadmLogsBucket` is not defined');
}
if (this.testCreationCleanupPolicy === undefined) {
throw new Error('`testCreationCleanupPolicy` is not defined');
}
this.integrationTestProject = new codebuild.PipelineProject(this, 'nodeadm-e2e-tests-project', {
projectName: 'nodeadm-e2e-tests',
buildSpec: codebuild.BuildSpec.fromSourceFilename('buildspecs/test-nodeadm.yml'),
environment: {
buildImage: codebuild.LinuxBuildImage.fromDockerRegistry(constants.builderBaseImage),
environmentVariables: {
AWS_REGION: {
value: this.region,
},
ARTIFACTS_BUCKET: {
value: this.nodeadmBinaryBucket.bucketName,
},
LOGS_BUCKET: {
value: this.nodeadmLogsBucket.bucketName,
},
GOPROXY: {
type: codebuild.BuildEnvironmentVariableType.SECRETS_MANAGER,
value: `${this.goproxySecret.secretArn}:endpoint`,
},
...this.vpcParams(),
},
},
});
this.integrationTestProject.role!.addToPrincipalPolicy(
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['s3:PutObject*'],
resources: [this.nodeadmLogsBucket.bucketArn, `${this.nodeadmLogsBucket.bucketArn}/*`],
}),
);
this.integrationTestProject.role!.addToPrincipalPolicy(
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['s3:PutObject*', 's3:ListBucket'],
resources: [this.nodeadmBinaryBucket.bucketArn, `${this.nodeadmBinaryBucket.bucketArn}/*`],
}),
);
this.integrationTestProject.role!.attachInlinePolicy(this.testCreationCleanupPolicy);
}