Apply tags to registered AMI
Adding the tag called `Name` to the AMI ensures that the name appears in the *Name* column inside AWS' web console. Fixes #1171. Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
parent
15969e0adc
commit
2618e11bfe
2 changed files with 23 additions and 0 deletions
|
|
@ -263,6 +263,12 @@ for LOOP_COUNTER in {0..10}; do
|
|||
sleep 5
|
||||
done
|
||||
|
||||
# Ensure the image was properly tagged.
|
||||
IMAGE_TAG=$($AWS_CMD ec2 describe-images --image-ids "${AMI_IMAGE_ID}" | jq -r '.Images[0].Tags[] | select(.Key=="Name") | .Value')
|
||||
if [[ ! $IMAGE_TAG == "${IMAGE_KEY}" ]]; then
|
||||
RESULTS=0
|
||||
fi
|
||||
|
||||
# Clean up our mess.
|
||||
greenprint "🧼 Cleaning up"
|
||||
SNAPSHOT_ID=$(jq -r '.Images[].BlockDeviceMappings[].Ebs.SnapshotId' "$AMI_DATA")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue