install-aws-server: Set the name of the root EBS volume.

This commit is contained in:
Alex Vandiver 2024-08-16 17:21:47 +00:00 committed by Tim Abbott
parent fe0a7b3b77
commit 3adedc9545
1 changed files with 5 additions and 2 deletions

View File

@ -174,8 +174,8 @@ INSTANCEID=$(echo "$INSTANCE_DATA" | jq -r .Instances[0].InstanceId)
PUBLIC_DNS_NAME=""
while [ -z "$PUBLIC_DNS_NAME" ]; do
sleep 1
PUBLIC_DNS_NAME=$($AWS ec2 describe-instances --instance-ids "$INSTANCEID" \
| jq -r .Reservations[0].Instances[0].PublicDnsName)
INSTANCE_DATA=$($AWS ec2 describe-instances --instance-ids "$INSTANCEID")
PUBLIC_DNS_NAME=$(echo "$INSTANCE_DATA" | jq -r .Reservations[0].Instances[0].PublicDnsName)
done
# Add the hostname to the zone
@ -199,6 +199,9 @@ EOF
$AWS route53 change-resource-record-sets --hosted-zone-id "$AWS_ZONE_ID" --change-batch "file://$ROUTE53_CHANGES"
rm "$ROUTE53_CHANGES"
VOLUME_ID=$(echo "$INSTANCE_DATA" | jq -r .Reservations[0].Instances[0].BlockDeviceMappings[0].Ebs.VolumeId)
$AWS ec2 create-tags --resources "$VOLUME_ID" --tags "Key=Name,Value=$SERVER root"
set +x
echo
echo