aws-cdk-lib.aws_ecs.BottleRocketImage

class BottleRocketImage

LanguageType name
.NETAmazon.CDK.AWS.ECS.BottleRocketImage
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#BottleRocketImage
Javasoftware.amazon.awscdk.services.ecs.BottleRocketImage
Pythonaws_cdk.aws_ecs.BottleRocketImage
TypeScript (source)aws-cdk-lib » aws_ecs » BottleRocketImage

Implements IMachineImage

Construct an Bottlerocket image from the latest AMI published in SSM.

Example

declare const cluster: ecs.Cluster;

cluster.addCapacity('bottlerocket-asg', {
  minCapacity: 2,
  instanceType: new ec2.InstanceType('c5.large'),
  machineImage: new ecs.BottleRocketImage(),
});

Initializer

new BottleRocketImage(props?: BottleRocketImageProps)

Parameters

  • props BottleRocketImageProps

Constructs a new instance of the BottleRocketImage class.

Methods

NameDescription
getImage(scope)Return the correct image.
static isBottleRocketImage(x)Return whether the given object is a BottleRocketImage.

getImage(scope)

public getImage(scope: Construct): MachineImageConfig

Parameters

  • scope Construct

Returns

  • MachineImageConfig

Return the correct image.


static isBottleRocketImage(x)

public static isBottleRocketImage(x: any): boolean

Parameters

  • x any

Returns

  • boolean

Return whether the given object is a BottleRocketImage.