aws-cdk-lib.aws_ec2.GenericSSMParameterImage

class GenericSSMParameterImage

LanguageType name
.NETAmazon.CDK.AWS.EC2.GenericSSMParameterImage
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#GenericSSMParameterImage
Javasoftware.amazon.awscdk.services.ec2.GenericSSMParameterImage
Pythonaws_cdk.aws_ec2.GenericSSMParameterImage
TypeScript (source)aws-cdk-lib » aws_ec2 » GenericSSMParameterImage

Implements IMachineImage

Select the image based on a given SSM parameter.

This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.

The AMI ID is selected using the values published to the SSM parameter store.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const userData: ec2.UserData;
const genericSSMParameterImage = new ec2.GenericSSMParameterImage('parameterName', ec2.OperatingSystemType.LINUX, /* all optional props */ userData);

Initializer

new GenericSSMParameterImage(parameterName: string, os: OperatingSystemType, userData?: UserData)

Parameters

  • parameterName string
  • os OperatingSystemType
  • userData UserData

Properties

NameTypeDescription
parameterNamestringName of the SSM parameter we're looking up.

parameterName

Type: string

Name of the SSM parameter we're looking up.

Methods

NameDescription
getImage(scope)Return the image to use in the given context.

getImage(scope)

public getImage(scope: Construct): MachineImageConfig

Parameters

  • scope Construct

Returns

  • MachineImageConfig

Return the image to use in the given context.