Class GenericLinuxImage
Construct a Linux machine image from an AMI map.
Inheritance
System.Object
GenericLinuxImage
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GenericLinuxImage : DeputyBase, IMachineImage
Syntax (vb)
Public Class GenericLinuxImage
Inherits DeputyBase
Implements IMachineImage
Remarks
Linux images IDs are not published to SSM parameter store yet, so you'll have to manually specify an AMI map.
ExampleMetadata: lit=aws-autoscaling/test/example.images.lit.ts infused
Examples
// Pick a Windows edition to use
var windows = new WindowsImage(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.
var amznLinux = new AmazonLinuxImage(new AmazonLinuxImageProps {
Generation = AmazonLinuxGeneration.AMAZON_LINUX,
Edition = AmazonLinuxEdition.STANDARD,
Virtualization = AmazonLinuxVirt.HVM,
Storage = AmazonLinuxStorage.GENERAL_PURPOSE
});
// For other custom (Linux) images, instantiate a `GenericLinuxImage` with
// a map giving the AMI to in for each region:
var linux = new GenericLinuxImage(new Dictionary<string, string> {
{ "us-east-1", "ami-97785bed" },
{ "eu-west-1", "ami-12345678" }
});
Synopsis
Constructors
GenericLinuxImage(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
GenericLinuxImage(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
GenericLinuxImage(IDictionary<String, String>, IGenericLinuxImageProps) |
Methods
GetImage(Construct) | Return the image to use in the given context. |
Constructors
GenericLinuxImage(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected GenericLinuxImage(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
GenericLinuxImage(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected GenericLinuxImage(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
GenericLinuxImage(IDictionary<String, String>, IGenericLinuxImageProps)
public GenericLinuxImage(IDictionary<string, string> amiMap, IGenericLinuxImageProps props = null)
Parameters
- amiMap System.Collections.Generic.IDictionary<System.String, System.String>
- props IGenericLinuxImageProps
Methods
GetImage(Construct)
Return the image to use in the given context.
public virtual IMachineImageConfig GetImage(Construct scope)
Parameters
- scope Constructs.Construct
Returns