Skip to content

Commit 8c1b889

Browse files
committed
Use eu-west-1 region and RUNS_ON_AWS_REGION for AMI creation
Signed-off-by: Claude <[email protected]>
1 parent 3056596 commit 8c1b889

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
aws-region:
99
description: "AWS region to build AMI in"
1010
required: false
11-
default: "us-east-1"
11+
default: "eu-west-1"
1212
ami-prefix:
1313
description: "Prefix for AMI name"
1414
required: false
@@ -52,27 +52,30 @@ runs:
5252
rustup toolchain install nightly
5353
rustup component add --toolchain nightly rustfmt clippy rust-src miri llvm-tools-preview
5454
55-
- name: Install cargo tools
56-
shell: bash
57-
run: |
58-
cargo install cargo-nextest --locked
59-
cargo install cargo-hack --locked
60-
cargo install grcov --locked
55+
# - name: Install cargo tools
56+
# shell: bash
57+
# run: |
58+
# cargo install cargo-nextest --locked
59+
# cargo install cargo-hack --locked
60+
# cargo install grcov --locked
6161

6262
- name: Create AMI
6363
id: create-ami
6464
shell: bash
6565
env:
66-
AWS_REGION: ${{ inputs.aws-region }}
6766
AMI_PREFIX: ${{ inputs.ami-prefix }}
6867
ARCH: ${{ inputs.arch }}
6968
RETENTION_DAYS: ${{ inputs.retention-days }}
7069
run: |
70+
# Use the region where the instance is running
71+
export AWS_REGION="$RUNS_ON_AWS_REGION"
72+
export AWS_DEFAULT_REGION="$RUNS_ON_AWS_REGION"
73+
7174
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
7275
AMI_NAME="${AMI_PREFIX}-${ARCH}-${TIMESTAMP}"
7376
DEPRECATION_TIME=$(date -u -d "+${RETENTION_DAYS} days" +%Y-%m-%dT%H:%M:%SZ)
7477
75-
echo "Creating AMI: $AMI_NAME from instance $RUNS_ON_INSTANCE_ID"
78+
echo "Creating AMI: $AMI_NAME from instance $RUNS_ON_INSTANCE_ID in region $AWS_REGION"
7679
AMI_ID=$(aws ec2 create-image \
7780
--instance-id "$RUNS_ON_INSTANCE_ID" \
7881
--name "$AMI_NAME" \

.github/workflows/ami-prebuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ permissions:
3737
id-token: write
3838

3939
env:
40-
AWS_REGION: us-east-1
40+
AWS_REGION: eu-west-1
4141

4242
jobs:
4343
build-x64:

0 commit comments

Comments
 (0)