Skip to content
v2.277.0

Experimental

@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

Repository Class ​

A container repository used to distribute container images in EC2 Image Builder.

Example ​

ts
const parameterizedComponent = imagebuilder.Component.fromComponentName(
  this,
  'ParameterizedComponent',
  'my-parameterized-component'
);

const imageRecipe = new imagebuilder.ImageRecipe(this, 'ParameterizedImageRecipe', {
  baseImage: imagebuilder.BaseImage.fromSsmParameterName(
    '/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64'
  ),
  components: [
    {
      component: parameterizedComponent,
      parameters: {
        environment: imagebuilder.ComponentParameterValue.fromString('production'),
        version: imagebuilder.ComponentParameterValue.fromString('1.0.0')
      }
    }
  ]
});
python
parameterized_component = imagebuilder.Component.from_component_name(self, "ParameterizedComponent", "my-parameterized-component")

image_recipe = imagebuilder.ImageRecipe(self, "ParameterizedImageRecipe",
    base_image=imagebuilder.BaseImage.from_ssm_parameter_name("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"),
    components=[imagebuilder.ComponentConfiguration(
        component=parameterized_component,
        parameters={
            "environment": imagebuilder.ComponentParameterValue.from_string("production"),
            "version": imagebuilder.ComponentParameterValue.from_string("1.0.0")
        }
    )
    ]
)
java
IComponent parameterizedComponent = Component.fromComponentName(this, "ParameterizedComponent", "my-parameterized-component");

ImageRecipe imageRecipe = ImageRecipe.Builder.create(this, "ParameterizedImageRecipe")
        .baseImage(BaseImage.fromSsmParameterName("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"))
        .components(List.of(ComponentConfiguration.builder()
                .component(parameterizedComponent)
                .parameters(Map.of(
                        "environment", ComponentParameterValue.fromString("production"),
                        "version", ComponentParameterValue.fromString("1.0.0")))
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.ImageBuilder.Alpha
var parameterizedComponent = Component.FromComponentName(this, "ParameterizedComponent", "my-parameterized-component");

var imageRecipe = new ImageRecipe(this, "ParameterizedImageRecipe", new ImageRecipeProps {
    BaseImage = BaseImage.FromSsmParameterName("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"),
    Components = new [] { new ComponentConfiguration {
        Component = parameterizedComponent,
        Parameters = new Dictionary<string, ComponentParameterValue> {
            { "environment", ComponentParameterValue.FromString("production") },
            { "version", ComponentParameterValue.FromString("1.0.0") }
        }
    } }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2
parameterizedComponent := imagebuilder.Component_FromComponentName(this, jsii.String("ParameterizedComponent"), jsii.String("my-parameterized-component"))

imageRecipe := imagebuilder.NewImageRecipe(this, jsii.String("ParameterizedImageRecipe"), &ImageRecipeProps{
	BaseImage: imagebuilder.BaseImage_*FromSsmParameterName(jsii.String("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64")),
	Components: []ComponentConfiguration{
		&ComponentConfiguration{
			Component: parameterizedComponent,
			Parameters: map[string]ComponentParameterValue{
				"environment": imagebuilder.ComponentParameterValue_fromString(jsii.String("production")),
				"version": imagebuilder.ComponentParameterValue_fromString(jsii.String("1.0.0")),
			},
		},
	},
})

Initializer ​

ts
new Repository()
python
Repository()
java
new Repository()
csharp
new Repository()
go
NewRepository()

Properties ​

repositoryNamestringrepository_namestrrepositoryNameStringRepositoryNamestringRepositoryName*string#
The name of the container repository where the output container image is stored.
The service in which the container repository is hosted.

Methods ​

fromEcr(repository: IRepository): Repository // chainable@staticmethod def from_ecr(repository: IRepository) -> Repositorypublic static Repository fromEcr(IRepository repository)public static Repository FromEcr(IRepository repository)func FromEcr(Repository IRepository) Repositorystatic#
The ECR repository to use as the target container repository.
1 parameter

Parameters

  • repositoryrepositoryrepositoryrepositoryRepository — The ECR repository to use.