Use DescribeLaunchConfigurations with a CLI
The following code examples show how to use DescribeLaunchConfigurations.
- CLI
-
- Amazon CLI
-
Example 1: To describe the specified launch configuration
This example describes the specified launch configuration.
aws autoscaling describe-launch-configurations \ --launch-configuration-namesmy-launch-configOutput:
{ "LaunchConfigurations": [ { "LaunchConfigurationName": "my-launch-config", "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config", "ImageId": "ami-0528a5175983e7f28", "KeyName": "my-key-pair-uswest2", "SecurityGroups": [ "sg-05eaec502fcdadc2e" ], "ClassicLinkVPCSecurityGroups": [], "UserData": "", "InstanceType": "t2.micro", "KernelId": "", "RamdiskId": "", "BlockDeviceMappings": [ { "DeviceName": "/dev/xvda", "Ebs": { "SnapshotId": "snap-06c1606ba5ca274b1", "VolumeSize": 8, "VolumeType": "gp2", "DeleteOnTermination": true, "Encrypted": false } } ], "InstanceMonitoring": { "Enabled": true }, "CreatedTime": "2020-10-28T02:39:22.321Z", "EbsOptimized": false, "AssociatePublicIpAddress": true, "MetadataOptions": { "HttpTokens": "required", "HttpPutResponseHopLimit": 1, "HttpEndpoint": "disabled" } } ] }Example 2: To describe a specified number of launch configurations
To return a specific number of launch configurations, use the
--max-itemsoption.aws autoscaling describe-launch-configurations \ --max-items1If the output includes a
NextTokenfield, there are more launch configurations. To get the additional launch configurations, use the value of this field with the--starting-tokenoption in a subsequent call as follows.aws autoscaling describe-launch-configurations \ --starting-tokenZ3M3LMPEXAMPLE-
For API details, see DescribeLaunchConfigurations
in Amazon CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example lists the names of your launch configurations.
Get-ASLaunchConfiguration | format-table -property LaunchConfigurationNameOutput:
LaunchConfigurationName ----------------------- my-lc-1 my-lc-2 my-lc-3 my-lc-4 my-lc-5Example 2: This example describes the specified launch configuration.
Get-ASLaunchConfiguration -LaunchConfigurationName my-lc-1Output:
AssociatePublicIpAddress : True BlockDeviceMappings : {/dev/xvda} ClassicLinkVPCId : ClassicLinkVPCSecurityGroups : {} CreatedTime : 12/12/2014 3:22:08 PM EbsOptimized : False IamInstanceProfile : ImageId : ami-043a5034 InstanceMonitoring : Amazon.AutoScaling.Model.InstanceMonitoring InstanceType : t2.micro KernelId : KeyName : LaunchConfigurationARN : arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:7e5f31e4-693b-4604-9322- e6f68d7fafad:launchConfigurationName/my-lc-1 LaunchConfigurationName : my-lc-1 PlacementTenancy : RamdiskId : SecurityGroups : {sg-67ef0308} SpotPrice : UserData :Example 3: This example describes the specified two launch configurations.
Get-ASLaunchConfiguration -LaunchConfigurationName @("my-lc-1", "my-lc-2")Example 4: This example describes all your launch configurations.
Get-ASLaunchConfiguration-
For API details, see DescribeLaunchConfigurations
in Amazon Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example lists the names of your launch configurations.
Get-ASLaunchConfiguration | format-table -property LaunchConfigurationNameOutput:
LaunchConfigurationName ----------------------- my-lc-1 my-lc-2 my-lc-3 my-lc-4 my-lc-5Example 2: This example describes the specified launch configuration.
Get-ASLaunchConfiguration -LaunchConfigurationName my-lc-1Output:
AssociatePublicIpAddress : True BlockDeviceMappings : {/dev/xvda} ClassicLinkVPCId : ClassicLinkVPCSecurityGroups : {} CreatedTime : 12/12/2014 3:22:08 PM EbsOptimized : False IamInstanceProfile : ImageId : ami-043a5034 InstanceMonitoring : Amazon.AutoScaling.Model.InstanceMonitoring InstanceType : t2.micro KernelId : KeyName : LaunchConfigurationARN : arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:7e5f31e4-693b-4604-9322- e6f68d7fafad:launchConfigurationName/my-lc-1 LaunchConfigurationName : my-lc-1 PlacementTenancy : RamdiskId : SecurityGroups : {sg-67ef0308} SpotPrice : UserData :Example 3: This example describes the specified two launch configurations.
Get-ASLaunchConfiguration -LaunchConfigurationName @("my-lc-1", "my-lc-2")Example 4: This example describes all your launch configurations.
Get-ASLaunchConfiguration-
For API details, see DescribeLaunchConfigurations
in Amazon Tools for PowerShell Cmdlet Reference (V5).
-
For a complete list of Amazon SDK developer guides and code examples, see Using this service with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.