Show / Hide Table of Contents

Enum MachineImageType

The machine image type.

Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum MachineImageType
Syntax (vb)
Public Enum MachineImageType
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;

            var launchTemplate = new LaunchTemplate(this, "ASG-LaunchTemplate", new LaunchTemplateProps {
                InstanceType = new InstanceType("t3.medium"),
                MachineImage = EcsOptimizedImage.AmazonLinux2(),
                UserData = UserData.ForLinux()
            });

            var autoScalingGroup = new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
                Vpc = vpc,
                MixedInstancesPolicy = new MixedInstancesPolicy {
                    InstancesDistribution = new InstancesDistribution {
                        OnDemandPercentageAboveBaseCapacity = 50
                    },
                    LaunchTemplate = launchTemplate
                }
            });

            var cluster = new Cluster(this, "Cluster", new ClusterProps { Vpc = vpc });

            var capacityProvider = new AsgCapacityProvider(this, "AsgCapacityProvider", new AsgCapacityProviderProps {
                AutoScalingGroup = autoScalingGroup,
                MachineImageType = MachineImageType.AMAZON_LINUX_2
            });

            cluster.AddAsgCapacityProvider(capacityProvider);

Synopsis

Fields

AMAZON_LINUX_2

Amazon ECS-optimized Amazon Linux 2 AMI.

BOTTLEROCKET

Bottlerocket AMI.

Fields

Name Description
AMAZON_LINUX_2

Amazon ECS-optimized Amazon Linux 2 AMI.

BOTTLEROCKET

Bottlerocket AMI.

Back to top Generated by DocFX