1
votes

I am trying to get launch configuration details by aws-cli, I know there have a command aws autoscaling describe-launch-configurations --launch-configuration-names my-launch-config, but I don't know what is the launch config name, I only have the ASG(auto-scaling group)name. I know in AWS console I can find the launch configuration name in the ASG detail page, but how to do this by aws-cli?

In another word, I want to get launch configuration details but I only have ASG name as input, what should be the command/commands in aws-cli.

1

1 Answers

1
votes

You can get LC name using describe-auto-scaling-groups and then use describe-launch-configurations to get its details:

asg_name="dddd"

launch_config_name=$(aws autoscaling describe-auto-scaling-groups \
                        --auto-scaling-group-names ${asg_name} \
                        --query "AutoScalingGroups[0].LaunchConfigurationName" \
                        --output text)

echo ${launch_config_name}

aws autoscaling describe-launch-configurations \
        --launch-configuration-names ${launch_config_name}