Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .eslintrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions src/image-builders/aws-image-builder/ami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as cdk from 'aws-cdk-lib';
import { aws_imagebuilder as imagebuilder } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { ImageBuilderComponent } from './builder';
import { ImageBuilderObjectBase } from './common';
import { amiRootDevice, Architecture, Os } from '../../providers';
import { uniqueImageBuilderName } from '../common';

Expand Down Expand Up @@ -48,7 +47,7 @@ interface AmiRecipeProperties {
*
* @internal
*/
export class AmiRecipe extends ImageBuilderObjectBase {
export class AmiRecipe extends cdk.Resource {
public readonly arn: string;
public readonly name: string;
public readonly version: string;
Expand All @@ -73,13 +72,6 @@ export class AmiRecipe extends ImageBuilderObjectBase {
] : undefined;

this.name = uniqueImageBuilderName(this);
this.version = this.generateVersion('ImageRecipe', this.name, {
platform: props.platform,
components,
parentAmi: props.baseAmi,
tags: props.tags,
blockDeviceMappings,
});

let workingDirectory;
if (props.platform == 'Linux') {
Expand All @@ -92,7 +84,7 @@ export class AmiRecipe extends ImageBuilderObjectBase {

const recipe = new imagebuilder.CfnImageRecipe(this, 'Recipe', {
name: this.name,
version: this.version,
version: '1.0.x',
parentImage: props.baseAmi,
components,
workingDirectory,
Expand All @@ -101,6 +93,7 @@ export class AmiRecipe extends ImageBuilderObjectBase {
});

this.arn = recipe.attrArn;
this.version = recipe.getAtt('Version', cdk.ResolutionTypeHint.STRING).toString();
}
}

Expand Down
9 changes: 2 additions & 7 deletions src/image-builders/aws-image-builder/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { TagMutability } from 'aws-cdk-lib/aws-ecr';
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
import { Construct, IConstruct } from 'constructs';
import { AmiRecipe, defaultBaseAmi } from './ami';
import { ImageBuilderObjectBase } from './common';
import { ContainerRecipe, defaultBaseDockerImage } from './container';
import { DeleteResourcesFunction } from './delete-resources-function';
import { DeleteResourcesProps } from './delete-resources.lambda';
Expand Down Expand Up @@ -164,7 +163,7 @@ export interface ImageBuilderComponentProperties {
*
* @deprecated Use `RunnerImageComponent` instead as this be internal soon.
*/
export class ImageBuilderComponent extends ImageBuilderObjectBase {
export class ImageBuilderComponent extends cdk.Resource {
/**
* Component ARN.
*/
Expand Down Expand Up @@ -263,11 +262,7 @@ export class ImageBuilderComponent extends ImageBuilderObjectBase {
name: name,
description: props.description,
platform: props.platform,
version: this.generateVersion('Component', name, {
platform: props.platform,
data,
description: props.description,
}),
version: '1.0.0',
data: JSON.stringify(data),
});

Expand Down
48 changes: 0 additions & 48 deletions src/image-builders/aws-image-builder/common.ts

This file was deleted.

13 changes: 4 additions & 9 deletions src/image-builders/aws-image-builder/container.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as cdk from 'aws-cdk-lib';
import { aws_ecr as ecr, aws_imagebuilder as imagebuilder } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { ImageBuilderComponent } from './builder';
import { ImageBuilderObjectBase } from './common';
import { Os } from '../../providers';
import { uniqueImageBuilderName } from '../common';

Expand Down Expand Up @@ -55,7 +55,7 @@ export interface ContainerRecipeProperties {
*
* @internal
*/
export class ContainerRecipe extends ImageBuilderObjectBase {
export class ContainerRecipe extends cdk.Resource {
public readonly arn: string;
public readonly name: string;
public readonly version: string;
Expand All @@ -70,16 +70,10 @@ export class ContainerRecipe extends ImageBuilderObjectBase {
});

this.name = uniqueImageBuilderName(this);
this.version = this.generateVersion('ContainerRecipe', this.name, {
platform: props.platform,
components,
dockerfileTemplate: props.dockerfileTemplate,
tags: props.tags,
});

const recipe = new imagebuilder.CfnContainerRecipe(this, 'Recipe', {
name: this.name,
version: this.version,
version: '1.0.x',
parentImage: props.parentImage,
platformOverride: props.platform == 'Linux' ? 'Linux' : undefined,
components,
Expand All @@ -93,6 +87,7 @@ export class ContainerRecipe extends ImageBuilderObjectBase {
});

this.arn = recipe.attrArn;
this.version = recipe.getAtt('Version', cdk.ResolutionTypeHint.STRING).toString();
}
}

Expand Down
1 change: 0 additions & 1 deletion src/image-builders/aws-image-builder/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './ami';
export * from './builder';
export * from './common';
export * from './container';
export * from './deprecated';
26 changes: 0 additions & 26 deletions src/image-builders/aws-image-builder/versioner-function.ts

This file was deleted.

Loading
Loading