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 AWS 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>
-MetadataOptions_HttpEndpoint <InstanceMetadataEndpointState>
-MetadataOptions_HttpPutResponseHopLimit <Int32>
-MetadataOptions_HttpToken <InstanceMetadataHttpTokensState>
-IamInstanceProfile <String>
-InstanceId <String>
-InstanceType <String>
-KernelId <String>
-PlacementTenancy <String>
-RamdiskId <String>
-SpotPrice <String>
-UserData <String>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>

Description

Creates a launch configuration. If you exceed your maximum limit of launch configurations, the call fails. To query this limit, call the DescribeAccountLimits API. For information about updating this limit, see Amazon EC2 Auto Scaling Service Quotas in the Amazon EC2 Auto Scaling User Guide. For more information, see Launch Configurations in the Amazon EC2 Auto Scaling User Guide.

Parameters

-AssociatePublicIpAddress <Boolean>
For Auto Scaling groups that are running in a virtual private cloud (VPC), specifies whether to assign a public IP address to the group's instances. If you specify true, each instance in the Auto Scaling group receives a unique public IP address. For more information, see Launching Auto Scaling Instances in a VPC in the Amazon EC2 Auto Scaling User Guide.If you specify this parameter, you must specify at least one subnet for VPCZoneIdentifier when you create your group.If the instance is launched into a default subnet, the default is to assign a public IP address, unless you disabled the option to assign a public IP address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IP address, unless you enabled the option to assign a public IP address on the subnet.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-BlockDeviceMapping <BlockDeviceMapping[]>
A block device mapping, which specifies the block devices for the instance. You can specify virtual devices and EBS volumes. For more information, see Block Device Mapping in the Amazon EC2 User Guide for Linux Instances.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesBlockDeviceMappings
-ClassicLinkVPCId <String>
The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. For more information, see ClassicLink in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic Instances to a VPC in the Amazon EC2 Auto Scaling User Guide.This parameter can only be used if you are launching EC2-Classic instances.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ClassicLinkVPCSecurityGroup <String[]>
The IDs of one or more security groups for the specified ClassicLink-enabled VPC. For more information, see ClassicLink in the Amazon EC2 User Guide for Linux Instances and Linking EC2-Classic Instances to a VPC in the Amazon EC2 Auto Scaling User Guide.If you specify the ClassicLinkVPCId parameter, you must specify this parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesClassicLinkVPCSecurityGroups
-EbsOptimized <Boolean>
Specifies whether the launch configuration is optimized for EBS I/O (true) or not (false). 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 fees are incurred when you enable EBS optimization for an instance type that is not EBS-optimized by default. For more information, see Amazon EBS-Optimized Instances in the Amazon EC2 User Guide for Linux Instances.The default value is false.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
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?True (ByPropertyName)
-IamInstanceProfile <String>
The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role.For more information, see IAM Role for Applications That Run on Amazon EC2 Instances in the Amazon EC2 Auto Scaling User Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ImageId <String>
The ID of the Amazon Machine Image (AMI) that was assigned during registration. For more information, see Finding an AMI in the Amazon EC2 User Guide for Linux Instances.If you do not specify InstanceId, you must specify ImageId.
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, except for the block device mapping.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 Amazon EC2 Auto Scaling User Guide.If you do not specify InstanceId, you must specify both ImageId and InstanceType.
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?True (ByPropertyName)
-InstanceType <String>
Specifies the instance type of the EC2 instance.For information about available instance types, see Available Instance Types in the Amazon EC2 User Guide for Linux Instances.If you do not specify InstanceId, you must specify InstanceType.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-KernelId <String>
The ID of the kernel associated with the AMI.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-KeyName <String>
The name of the key pair. For more information, see Amazon EC2 Key Pairs in the Amazon EC2 User Guide for Linux Instances.
Required?False
Position?3
Accept pipeline input?True (ByPropertyName)
-LaunchConfigurationName <String>
The name of the launch configuration. This name must be unique per Region per account.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-MetadataOptions_HttpEndpoint <InstanceMetadataEndpointState>
This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is enabled.If you specify a value of disabled, you will not be able to access your instance metadata.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MetadataOptions_HttpPutResponseHopLimit <Int32>
The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.Default: 1Possible values: Integers from 1 to 64
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MetadataOptions_HttpToken <InstanceMetadataHttpTokensState>
The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is optional.If the state is optional, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.If the state is required, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesMetadataOptions_HttpTokens
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the LaunchConfigurationName parameter. The -PassThru parameter is deprecated, use -Select '^LaunchConfigurationName' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-PlacementTenancy <String>
The tenancy of the instance. An instance with dedicated tenancy runs on isolated, single-tenant hardware and can only be launched into a VPC.To launch dedicated instances into a shared tenancy VPC (a VPC with the instance placement tenancy attribute set to default), you must set the value of this parameter to dedicated.If you specify PlacementTenancy, you must specify at least one subnet for VPCZoneIdentifier when you create your group.For more information, see Instance Placement Tenancy in the Amazon EC2 Auto Scaling User Guide.Valid Values: default | dedicated
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-RamdiskId <String>
The ID of the RAM disk to select.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SecurityGroup <String[]>
A list that contains the security groups to assign to the instances in the Auto Scaling group.[EC2-VPC] Specify the security group IDs. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.[EC2-Classic] Specify either the security group names or the security group IDs. For more information, see Amazon EC2 Security Groups in the Amazon EC2 User Guide for Linux Instances.
Required?False
Position?4
Accept pipeline input?True (ByPropertyName)
AliasesSecurityGroups
-Select <String>
Use the -Select parameter to control the cmdlet output. The cmdlet doesn't have a return value by default. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.AutoScaling.Model.CreateLaunchConfigurationResponse). Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-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 price. For more information, see Launching Spot Instances in Your Auto Scaling Group in the Amazon EC2 Auto Scaling User Guide.When you change your maximum price by creating a new launch configuration, running instances will continue to run as long as the maximum price for those running instances is higher than the current Spot price.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-UserData <String>
The Base64-encoded user data to make available to the launched EC2 instances. For more information, see Instance Metadata and User Data in the Amazon EC2 User Guide for Linux Instances.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

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?True (ByPropertyName)
AliasesAK
-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?True (ByValue, ByPropertyName)
-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?True (ByPropertyName)
-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?True (ByValue, ByPropertyName)
-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.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?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-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?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-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?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet does not generate 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