Show / Hide Table of Contents

Interface IAmazonLinuxImageProps

Amazon Linux image properties.

Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IAmazonLinuxImageProps
Syntax (vb)
Public Interface IAmazonLinuxImageProps
Remarks

ExampleMetadata: infused

Examples
IVpc vpc;

            var lb = new LoadBalancer(this, "LB", new LoadBalancerProps {
                Vpc = vpc,
                InternetFacing = true
            });

            // instance to add as the target for load balancer.
            var instance = new Instance(this, "targetInstance", new InstanceProps {
                Vpc = vpc,
                InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.MICRO),
                MachineImage = new AmazonLinuxImage(new AmazonLinuxImageProps { Generation = AmazonLinuxGeneration.AMAZON_LINUX_2 })
            });
            lb.AddTarget(new InstanceTarget(instance));

Synopsis

Properties

AdditionalCacheKey

Adds an additional discriminator to the cdk.context.json cache key.

CachedInContext

Whether the AMI ID is cached to be stable between deployments.

CpuType

CPU Type.

Edition

What edition of Amazon Linux to use.

Generation

What generation of Amazon Linux to use.

Kernel

What kernel version of Amazon Linux to use.

Storage

What storage backed image to use.

UserData

Initial user data.

Virtualization

Virtualization type.

Properties

AdditionalCacheKey

Adds an additional discriminator to the cdk.context.json cache key.

string? AdditionalCacheKey { get; }
Property Value

string

Remarks

Default: - no additional cache key

CachedInContext

Whether the AMI ID is cached to be stable between deployments.

bool? CachedInContext { get; }
Property Value

bool?

Remarks

By default, the newest image is used on each deployment. This will cause instances to be replaced whenever a new version is released, and may cause downtime if there aren't enough running instances in the AutoScalingGroup to reschedule the tasks on.

If set to true, the AMI ID will be cached in cdk.context.json and the same value will be used on future runs. Your instances will not be replaced but your AMI version will grow old over time. To refresh the AMI lookup, you will have to evict the value from the cache using the cdk context command. See https://docs.aws.amazon.com/cdk/latest/guide/context.html for more information.

Can not be set to true in environment-agnostic stacks.

Default: false

CpuType

CPU Type.

AmazonLinuxCpuType? CpuType { get; }
Property Value

AmazonLinuxCpuType?

Remarks

Default: X86_64

Edition

What edition of Amazon Linux to use.

AmazonLinuxEdition? Edition { get; }
Property Value

AmazonLinuxEdition?

Remarks

Default: Standard

Generation

What generation of Amazon Linux to use.

AmazonLinuxGeneration? Generation { get; }
Property Value

AmazonLinuxGeneration?

Remarks

Default: AmazonLinux

Kernel

What kernel version of Amazon Linux to use.

AmazonLinuxKernel? Kernel { get; }
Property Value

AmazonLinuxKernel?

Remarks

Default: -

Storage

What storage backed image to use.

AmazonLinuxStorage? Storage { get; }
Property Value

AmazonLinuxStorage?

Remarks

Default: GeneralPurpose

UserData

Initial user data.

UserData? UserData { get; }
Property Value

UserData

Remarks

Default: - Empty UserData for Linux machines

Virtualization

Virtualization type.

AmazonLinuxVirt? Virtualization { get; }
Property Value

AmazonLinuxVirt?

Remarks

Default: HVM

Back to top Generated by DocFX