How to compare settings between old and new versions of EC2 launch templates

0

Hello.

I am managing AutoScaling on a certain system using EC2 launch templates.
I would like to check the difference between the settings of the new version created when updating the launch template and the old version that was previously used.
Is there a function to compare differences from the management console?
If the management console does not have a function to compare differences, is it best to obtain json using AWS CLI and compare the differences?

profile picture
EXPERT
asked 12 days ago65 views
1 Answer
3
Accepted Answer

Unfortunately, there isn't a built-in function in the AWS Management Console to directly compare different versions of EC2 launch templates. However, you have a couple of options to compare the settings between old and new versions:

  1. Using the AWS Management Console: You can manually compare versions by viewing the details of each version side by side. Navigate to the EC2 console, select "Launch Templates," choose your template, and then view the details of different versions. This method requires you to visually compare the settings, which can be time-consuming and prone to errors for complex templates.

  2. Using the AWS CLI: This is likely the more efficient and accurate method for comparing versions. You can use the AWS CLI to describe the launch template versions and output the results in JSON format. Then, you can use a JSON diff tool or text comparison tool to highlight the differences between versions.

Here's how you can do this using the AWS CLI:

  1. Describe the specific versions you want to compare:

aws ec2 describe-launch-template-versions --launch-template-id <your-template-id> --versions <old-version> <new-version>

  1. You can redirect the output to JSON files:

aws ec2 describe-launch-template-versions --launch-template-id <your-template-id> --versions <old-version> > old_version.json aws ec2 describe-launch-template-versions --launch-template-id <your-template-id> --versions <new-version> > new_version.json

  1. Then use a JSON diff tool or a text comparison tool to compare the two files.

This method allows for a more detailed and accurate comparison of the launch template versions, making it easier to identify specific changes in settings between versions.
Sources
Modify a launch template (manage launch template versions) - Amazon Elastic Compute Cloud
Examples for creating and managing launch templates with the AWS CLI - Amazon EC2 Auto Scaling

profile picture
answered 12 days ago
profile picture
EXPERT
reviewed 12 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions