Interface IAutoScalingGroupProps
- Namespace
- Amazon.CDK.AWS.AutoScaling
- Assembly
- Amazon.CDK.AWS.AutoScaling.dll
Properties of a Fleet.
public interface IAutoScalingGroupProps : ICommonAutoScalingGroupProps
- Inherited Members
Examples
Vpc vpc;
var mySecurityGroup = new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps { Vpc = vpc });
new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.MICRO),
MachineImage = new AmazonLinuxImage(),
SecurityGroup = mySecurityGroup
});
Remarks
ExampleMetadata: infused
Properties
Init
Apply the given CloudFormation Init configuration to the instances in the AutoScalingGroup at startup.
CloudFormationInit? Init { get; }
Property Value
- CloudFormationInit
Remarks
If you specify init
, you must also specify signals
to configure
the number of instances to wait for and the timeout for waiting for the
init process.
Default: - no CloudFormation init
InitOptions
Use the given options for applying CloudFormation Init.
IApplyCloudFormationInitOptions? InitOptions { get; }
Property Value
Remarks
Describes the configsets to use and the timeout to wait
Default: - default options
InstanceType
Type of instance to launch.
InstanceType? InstanceType { get; }
Property Value
- InstanceType
Remarks
launchTemplate
must not be specified when this property is specified.
Default: - Do not provide any instance type
LaunchTemplate
Launch template to use.
ILaunchTemplate? LaunchTemplate { get; }
Property Value
- ILaunchTemplate
Remarks
Launch configuration related settings and MixedInstancesPolicy must not be specified when a launch template is specified.
Default: - Do not provide any launch template
MachineImage
AMI to launch.
IMachineImage? MachineImage { get; }
Property Value
- IMachineImage
Remarks
launchTemplate
must not be specified when this property is specified.
Default: - Do not provide any machine image
MixedInstancesPolicy
Mixed Instances Policy to use.
IMixedInstancesPolicy? MixedInstancesPolicy { get; }
Property Value
Remarks
Launch configuration related settings and Launch Template must not be specified when a MixedInstancesPolicy is specified.
Default: - Do not provide any MixedInstancesPolicy
RequireImdsv2
Whether IMDSv2 should be required on launched instances.
bool? RequireImdsv2 { get; }
Property Value
- bool?
Remarks
Default: false
Role
An IAM role to associate with the instance profile assigned to this Auto Scaling Group.
IRole? Role { get; }
Property Value
- IRole
Examples
var role = new Role(this, "MyRole", new RoleProps {
AssumedBy = new ServicePrincipal("ec2.amazonaws.com")
});
Remarks
The role must be assumable by the service principal ec2.amazonaws.com
:
launchTemplate
must not be specified when this property is specified.
Default: A role will automatically be created, it can be accessed via the role
property
SecurityGroup
Security group to launch the instances in.
ISecurityGroup? SecurityGroup { get; }
Property Value
- ISecurityGroup
Remarks
launchTemplate
must not be specified when this property is specified.
Default: - A SecurityGroup will be created if none is specified.
UserData
Specific UserData to use.
UserData? UserData { get; }
Property Value
- UserData
Remarks
The UserData may still be mutated after creation.
launchTemplate
must not be specified when this property is specified.
Default: - A UserData object appropriate for the MachineImage's Operating System is created.
Vpc
VPC to launch these instances in.
IVpc Vpc { get; }
Property Value
- IVpc