Interface IAutoScalingGroupProps
Properties of a Fleet.
Inherited Members
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.AWS.AutoScaling.dll
Syntax (csharp)
public interface IAutoScalingGroupProps : ICommonAutoScalingGroupProps
Syntax (vb)
Public Interface IAutoScalingGroupProps
Inherits ICommonAutoScalingGroupProps
Remarks
ExampleMetadata: infused
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
});
Synopsis
Properties
| Init | Apply the given CloudFormation Init configuration to the instances in the AutoScalingGroup at startup. |
| InitOptions | Use the given options for applying CloudFormation Init. |
| InstanceType | Type of instance to launch. |
| LaunchTemplate | Launch template to use. |
| MachineImage | AMI to launch. |
| MixedInstancesPolicy | Mixed Instances Policy to use. |
| RequireImdsv2 | Whether IMDSv2 should be required on launched instances. |
| Role | An IAM role to associate with the instance profile assigned to this Auto Scaling Group. |
| SecurityGroup | Security group to launch the instances in. |
| UserData | Specific UserData to use. |
| Vpc | VPC to launch these instances in. |
Properties
Init
Apply the given CloudFormation Init configuration to the instances in the AutoScalingGroup at startup.
virtual CloudFormationInit Init { get; }
Property Value
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.
virtual IApplyCloudFormationInitOptions InitOptions { get; }
Property Value
IApplyCloudFormationInitOptions
Remarks
Describes the configsets to use and the timeout to wait
Default: - default options
InstanceType
Type of instance to launch.
virtual InstanceType InstanceType { get; }
Property Value
Remarks
launchTemplate must not be specified when this property is specified.
Default: - Do not provide any instance type
LaunchTemplate
Launch template to use.
virtual ILaunchTemplate LaunchTemplate { get; }
Property Value
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.
virtual IMachineImage MachineImage { get; }
Property Value
Remarks
launchTemplate must not be specified when this property is specified.
Default: - Do not provide any machine image
MixedInstancesPolicy
Mixed Instances Policy to use.
virtual 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.
virtual Nullable<bool> RequireImdsv2 { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Role
An IAM role to associate with the instance profile assigned to this Auto Scaling Group.
virtual IRole Role { get; }
Property Value
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
Examples
var role = new Role(this, "MyRole", new RoleProps {
AssumedBy = new ServicePrincipal("ec2.amazonaws.com")
});
SecurityGroup
Security group to launch the instances in.
virtual ISecurityGroup SecurityGroup { get; }
Property Value
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.
virtual UserData UserData { get; }
Property Value
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.