Skip to content

Commit 3056596

Browse files
committed
Use RUNS_ON_INSTANCE_ID env var instead of metadata service
Signed-off-by: Claude <[email protected]>
1 parent d1369df commit 3056596

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

.github/actions/build-ami/action.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ runs:
5959
cargo install cargo-hack --locked
6060
cargo install grcov --locked
6161
62-
- name: Get instance ID
63-
id: instance
64-
shell: bash
65-
run: |
66-
INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
67-
echo "instance_id=$INSTANCE_ID" >> $GITHUB_OUTPUT
68-
6962
- name: Create AMI
7063
id: create-ami
7164
shell: bash
@@ -79,9 +72,9 @@ runs:
7972
AMI_NAME="${AMI_PREFIX}-${ARCH}-${TIMESTAMP}"
8073
DEPRECATION_TIME=$(date -u -d "+${RETENTION_DAYS} days" +%Y-%m-%dT%H:%M:%SZ)
8174
82-
echo "Creating AMI: $AMI_NAME"
75+
echo "Creating AMI: $AMI_NAME from instance $RUNS_ON_INSTANCE_ID"
8376
AMI_ID=$(aws ec2 create-image \
84-
--instance-id "${{ steps.instance.outputs.instance_id }}" \
77+
--instance-id "$RUNS_ON_INSTANCE_ID" \
8578
--name "$AMI_NAME" \
8679
--description "Vortex CI runner image for ${ARCH}" \
8780
--no-reboot \

0 commit comments

Comments
 (0)