From 3adedc9545a6e6e6b539bbca8e3ed3e609a1d46a Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 16 Aug 2024 17:21:47 +0000 Subject: [PATCH] install-aws-server: Set the name of the root EBS volume. --- tools/setup/install-aws-server | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/setup/install-aws-server b/tools/setup/install-aws-server index a9753d7ae6..c446b0ec47 100755 --- a/tools/setup/install-aws-server +++ b/tools/setup/install-aws-server @@ -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