Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/build-image-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ export class BuildImageDataStack extends cdk.Stack {
*/
private createDeploymentBucket(bucketName: string): s3.IBucket {
const accessLoggingBucket = new s3.Bucket(this, 'LoggingBucket', {
versioned: true,
versioned: false,
enforceSSL: true,
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});

const encryptionKey = new kms.Key(this, 'PipelineArtifactKey', {
Expand Down
7 changes: 6 additions & 1 deletion lib/build-image-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ export class BuildImagePipelineStack extends cdk.Stack {
});

const accessLoggingBucket = new s3.Bucket(this, 'ArtifactAccessLogging', {
versioned: true,
versioned: false,
enforceSSL: true,
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});
const encryptionKey = new kms.Key(this, 'PipelineArtifactKey', {
removalPolicy: RemovalPolicy.DESTROY,
Expand All @@ -115,11 +117,14 @@ export class BuildImagePipelineStack extends cdk.Stack {
blockPublicAccess: new s3.BlockPublicAccess(
s3.BlockPublicAccess.BLOCK_ALL
),
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});

const pipeline = new codepipeline.Pipeline(this, 'BuildImagePipeline', {
artifactBucket,
pipelineName: `${props.imageKind}BuildImagePipeline`,
pipelineType: codepipeline.PipelineType.V1,
stages: [
{
stageName: 'Source',
Expand Down
4 changes: 2 additions & 2 deletions lib/build-image-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class BuildImageRepoStack extends cdk.Stack {

this.repository = new ecr.Repository(this, 'BuildImageRepo', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
autoDeleteImages: true,
emptyOnDelete: true,
});
}
}
}
11 changes: 10 additions & 1 deletion lib/embedded-linux-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ export class EmbeddedLinuxPipelineStack extends cdk.Stack {
let scriptAsset!: Asset;

const accessLoggingBucket = new s3.Bucket(this, 'ArtifactAccessLogging', {
versioned: true,
versioned: false,
enforceSSL: true,
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});

if (props.projectKind && props.projectKind == ProjectKind.PokyAmi) {
Expand All @@ -106,6 +108,8 @@ export class EmbeddedLinuxPipelineStack extends cdk.Stack {
encryptionKey: outputBucketEncryptionKey,
encryptionKeyArn: outputBucketEncryptionKey.keyArn,
serverAccessLogsBucket: accessLoggingBucket,
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});
environmentVariables = {
IMPORT_BUCKET: {
Expand All @@ -126,6 +130,8 @@ export class EmbeddedLinuxPipelineStack extends cdk.Stack {
versioned: true,
enforceSSL: true,
serverAccessLogsBucket: accessLoggingBucket,
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});
}

Expand All @@ -142,6 +148,8 @@ export class EmbeddedLinuxPipelineStack extends cdk.Stack {
blockPublicAccess: new s3.BlockPublicAccess(
s3.BlockPublicAccess.BLOCK_ALL
),
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});

/** Create our CodePipeline Actions. */
Expand Down Expand Up @@ -295,6 +303,7 @@ def handler(event, context):
const pipeline = new codepipeline.Pipeline(this, 'EmbeddedLinuxPipeline', {
artifactBucket,
restartExecutionOnUpdate: true,
pipelineType: codepipeline.PipelineType.V1,
stages: [
{
stageName: 'Source',
Expand Down
5 changes: 2 additions & 3 deletions lib/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import { LogGroup, RetentionDays } from 'aws-cdk-lib/aws-logs';
export class PipelineNetworkStack extends cdk.Stack {
/** The VPC for the pipeline to reside in. */
public readonly vpc: ec2.IVpc;

constructor(scope: Construct, props?: cdk.StackProps) {
super(scope, 'PipelineNetwork', props);
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

// We will create a VPC with 3 Private and Public subnets for AWS
// Resources that have network interfaces (e.g. Connecting and EFS
Expand Down
Loading