AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the Auto Scaling CreateLaunchConfiguration API operation.

Syntax

New-ASLaunchConfiguration
-LaunchConfigurationName <String>
-ImageId <String>
-KeyName <String>
-SecurityGroup <String[]>
-AssociatePublicIpAddress <Boolean>
-BlockDeviceMapping <BlockDeviceMapping[]>
-ClassicLinkVPCId <String>
-ClassicLinkVPCSecurityGroup <String[]>
-EbsOptimized <Boolean>
-InstanceMonitoring_Enabled <Boolean>
-IamInstanceProfile <String>
-InstanceId <String>
-InstanceType <String>
-KernelId <String>
-PlacementTenancy <String>
-RamdiskId <String>
-SpotPrice <String>
-UserData <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>

Description

Creates a launch configuration. If you exceed your maximum limit of launch configurations, which by default is 100 per region, the call fails. For information about viewing and updating this limit, see DescribeAccountLimits. For more information, see Launch Configurations in the Auto Scaling User Guide.

Parameters

-AssociatePublicIpAddress <Boolean>
Used for groups that launch instances into a virtual private cloud (VPC). Specifies whether to assign a public IP address to each instance. For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.If you specify this parameter, be sure to specify at least one subnet when you create your group.Default: If the instance is launched into a default subnet, the default is true. If the instance is launched into a nondefault subnet, the default is false. For more information, see Supported Platforms in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?Named
Accept pipeline input?False
-BlockDeviceMapping <BlockDeviceMapping[]>
One or more mappings that specify how block devices are exposed to the instance. For more information, see Block Device Mapping in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?Named
Accept pipeline input?False
-ClassicLinkVPCId <String>
The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter is supported only if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?Named
Accept pipeline input?False
-ClassicLinkVPCSecurityGroup <String[]>
The IDs of one or more security groups for the specified ClassicLink-enabled VPC. This parameter is required if you specify a ClassicLink-enabled VPC, and is not supported otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?Named
Accept pipeline input?False
-EbsOptimized <Boolean>
Indicates whether the instance is optimized for Amazon EBS I/O. By default, the instance is not optimized for EBS I/O. The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional usage charges apply. For more information, see Amazon EBS-Optimized Instances in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?Named
Accept pipeline input?False
-Force <SwitchParameter>
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?False
-IamInstanceProfile <String>
The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.EC2 instances launched with an IAM role will automatically have AWS security credentials available. You can use IAM roles with Auto Scaling to automatically enable applications running on your EC2 instances to securely access other AWS resources. For more information, see Launch Auto Scaling Instances with an IAM Role in the Auto Scaling User Guide.
Required?False
Position?Named
Accept pipeline input?False
-ImageId <String>
The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances.If you do not specify InstanceId, you must specify ImageId.For more information, see Finding an AMI in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?2
Accept pipeline input?True (ByPropertyName)
-InstanceId <String>
The ID of the instance to use to create the launch configuration. The new launch configuration derives attributes from the instance, with the exception of the block device mapping.If you do not specify InstanceId, you must specify both ImageId and InstanceType.To create a launch configuration with a block device mapping or override any other instance attributes, specify them as part of the same request.For more information, see Create a Launch Configuration Using an EC2 Instance in the Auto Scaling User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-InstanceMonitoring_Enabled <Boolean>
If true, detailed monitoring is enabled. Otherwise, basic monitoring is enabled.
Required?False
Position?Named
Accept pipeline input?False
-InstanceType <String>
The instance type of the EC2 instance.If you do not specify InstanceId, you must specify InstanceType.For information about available instance types, see Available Instance Types in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?Named
Accept pipeline input?False
-KernelId <String>
The ID of the kernel associated with the AMI.
Required?False
Position?Named
Accept pipeline input?False
-KeyName <String>
The name of the key pair. For more information, see Amazon EC2 Key Pairs in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?3
Accept pipeline input?False
-LaunchConfigurationName <String>
The name of the launch configuration. This name must be unique within the scope of your AWS account.
Required?False
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-PassThru <SwitchParameter>
Returns the value passed to the LaunchConfigurationName parameter. By default, this cmdlet does not generate any output.
Required?False
Position?Named
Accept pipeline input?False
-PlacementTenancy <String>
The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware and can only be launched into a VPC.You must set the value of this parameter to dedicated if want to launch Dedicated Instances into a shared tenancy VPC (VPC with instance placement tenancy attribute set to default).If you specify this parameter, be sure to specify at least one subnet when you create your group.For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.Valid values: default | dedicated
Required?False
Position?Named
Accept pipeline input?False
-RamdiskId <String>
The ID of the RAM disk associated with the AMI.
Required?False
Position?Named
Accept pipeline input?False
-SecurityGroup <String[]>
One or more security groups with which to associate the instances.If your instances are launched in EC2-Classic, you can either specify security group names or the security group IDs. For more information about security groups for EC2-Classic, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide.If your instances are launched into a VPC, specify security group IDs. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.
Required?False
Position?4
Accept pipeline input?False
-SpotPrice <String>
The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot market price. For more information, see Launching Spot Instances in Your Auto Scaling Group in the Auto Scaling User Guide.
Required?False
Position?Named
Accept pipeline input?False
-UserData <String>
The user data to make available to the launched EC2 instances. For more information, see Instance Metadata and User Data in the Amazon Elastic Compute Cloud User Guide.
Required?False
Position?Named
Accept pipeline input?False

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required? False
Position? Named
Accept pipeline input? False
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required? False
Position? Named
Accept pipeline input? False
-ProfileLocation <String>

Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)

If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials. Note that the encrypted credential file is not supported on all platforms. It will be skipped when searching for profiles on Windows Nano Server, Mac, and Linux platforms.

If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.

As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.

Required? False
Position? Named
Accept pipeline input? False
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required? False
Position? Named
Accept pipeline input? False
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required? False
Position? Named
Accept pipeline input? False
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required? False
Position? Named
Accept pipeline input? False
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required? False
Position? Named
Accept pipeline input? False
-Region <String>
The system name of the AWS region in which the operation should be invoked. For example, us-east-1, eu-west-1 etc.
Required? False
Position? Named
Accept pipeline input? False
-EndpointUrl <String>

The endpoint to make the call against.

Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.

Required? False
Position? Named
Accept pipeline input? False

Inputs

You can pipe a String object to this cmdlet for the LaunchConfigurationName parameter.

Outputs

None or System.String
When you use the PassThru parameter, this cmdlet outputs the value supplied to the LaunchConfigurationName parameter. Otherwise, this cmdlet does not return any output. The service response (type Amazon.AutoScaling.Model.CreateLaunchConfigurationResponse) can be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Examples

Example 1

PS C:\> New-ASLaunchConfiguration -LaunchConfigurationName my-lc -InstanceType "m3.medium" -ImageId "ami-12345678" -SecurityGroup "sg-12345678" -IamInstanceProfile "myIamRole"
This example creates a launch configuration named 'my-lc'. The EC2 instances launched by Auto Scaling groups that use this launch configuration use specified instance type, AMI, security group, and IAM role.

Supported Version

AWS Tools for PowerShell: 2.x.y.z