class GenericLinuxImage
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.GenericLinuxImage |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#GenericLinuxImage |
Java | software.amazon.awscdk.services.ec2.GenericLinuxImage |
Python | aws_cdk.aws_ec2.GenericLinuxImage |
TypeScript (source) | aws-cdk-lib » aws_ec2 » GenericLinuxImage |
Implements
IMachine
Construct a Linux machine image from an AMI map.
Linux images IDs are not published to SSM parameter store yet, so you'll have to manually specify an AMI map.
Example
// Pick a Windows edition to use
const windows = new ec2.WindowsImage(ec2.WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE);
// Pick the right Amazon Linux edition. All arguments shown are optional
// and will default to these values when omitted.
const amznLinux = new ec2.AmazonLinuxImage({
generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX,
edition: ec2.AmazonLinuxEdition.STANDARD,
virtualization: ec2.AmazonLinuxVirt.HVM,
storage: ec2.AmazonLinuxStorage.GENERAL_PURPOSE,
});
// For other custom (Linux) images, instantiate a `GenericLinuxImage` with
// a map giving the AMI to in for each region:
const linux = new ec2.GenericLinuxImage({
'us-east-1': 'ami-97785bed',
'eu-west-1': 'ami-12345678',
// ...
});
Initializer
new GenericLinuxImage(amiMap: { [string]: string }, props?: GenericLinuxImageProps)
Parameters
- amiMap
{ [string]: string }
- props
Generic
Linux Image Props
Methods
Name | Description |
---|---|
get | Return the image to use in the given context. |
Image(scope)
getpublic getImage(scope: Construct): MachineImageConfig
Parameters
- scope
Construct
Returns
Return the image to use in the given context.