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>
-ClientConfig <AmazonAutoScalingConfig>

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 Quotas for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. For more information, see Launch configurations in the Amazon EC2 Auto Scaling User Guide. Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a launch template or a launch configuration. We strongly recommend that you do not use launch configurations. They do not provide full functionality for Amazon EC2 Auto Scaling or Amazon EC2. For information about using launch templates, see Launch templates in the Amazon EC2 Auto Scaling User Guide.

Parameters

-AssociatePublicIpAddress <Boolean>
Specifies whether to assign a public IPv4 address to the group's instances. If the instance is launched into a default subnet, the default is to assign a public IPv4 address, unless you disabled the option to assign a public IPv4 address on the subnet. If the instance is launched into a nondefault subnet, the default is not to assign a public IPv4 address, unless you enabled the option to assign a public IPv4 address on the subnet.If you specify true, each instance in the Auto Scaling group receives a unique public IPv4 address. For more information, see Launching Auto Scaling instances in a VPC in the Amazon EC2 Auto Scaling User Guide.If you specify this property, you must specify at least one subnet for VPCZoneIdentifier when you create your group.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-BlockDeviceMapping <BlockDeviceMapping[]>
The block device mapping entries that define the block devices to attach to the instances at launch. By default, the block devices specified in the block device mapping for the AMI are used. For more information, see Block device mappings in the Amazon EC2 User Guide for Linux Instances.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesBlockDeviceMappings
-ClassicLinkVPCId <String>
Available for backward compatibility.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ClassicLinkVPCSecurityGroup <String[]>
Available for backward compatibility.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesClassicLinkVPCSecurityGroups
-ClientConfig <AmazonAutoScalingConfig>
Amazon.PowerShell.Cmdlets.AS.AmazonAutoScalingClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-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 a Linux AMI in the Amazon EC2 User Guide for Linux Instances.If you specify InstanceId, an ImageId is not required.
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 Creating a launch configuration using an EC2 instance in the Amazon EC2 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?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 specify InstanceId, an InstanceType is not required.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-KernelId <String>
The ID of the kernel associated with the AMI.We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances.
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 and Linux instances 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: 1
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, either default or dedicated. 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 property to dedicated. For more information, see Configuring instance tenancy with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.If you specify PlacementTenancy, you must specify at least one subnet for VPCZoneIdentifier when you create your group.Valid values: default | dedicated
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-RamdiskId <String>
The ID of the RAM disk to select.We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide for Linux Instances.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SecurityGroup <String[]>
A list that contains the security group IDs to assign to the instances in the Auto Scaling group. For more information, see Control traffic to resources using security groups in the Amazon Virtual Private Cloud User Guide.
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 Request Spot Instances for fault-tolerant and flexible applications in the Amazon EC2 Auto Scaling User Guide.Valid Range: Minimum value of 0.001When 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 user data to make available to the launched EC2 instances. For more information, see Instance metadata and user data (Linux) and Instance metadata and user data (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text. User data is limited to 16 KB.
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

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