Skip to content

Commit 67ac19a

Browse files
committed
added a script to assume the correct role in staging in order to use the example data in the parameter store
1 parent 9d755a0 commit 67ac19a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

concourse/bin/sts-assume-role.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
unset AWS_SESSION_TOKEN
6+
7+
role_arn="$1"
8+
region="$2"
9+
temp_role=$(aws sts assume-role \
10+
--role-arn "${role_arn}" \
11+
--role-session-name "concourse-task" \
12+
--duration 1800)
13+
14+
export AWS_ACCESS_KEY_ID=$(echo $temp_role | jq .Credentials.AccessKeyId | xargs)
15+
export AWS_SECRET_ACCESS_KEY=$(echo $temp_role | jq .Credentials.SecretAccessKey | xargs)
16+
export AWS_SESSION_TOKEN=$(echo $temp_role | jq .Credentials.SessionToken | xargs)
17+
export AWS_DEFAULT_REGION=${region:-eu-west-2}

concourse/pipeline.yml

+3
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ jobs:
3434
pip install -r requirements-pipeline.txt
3535
pre-commit install -c .gds/.pre-commit-config.yaml
3636
git config --global core.hookspath ../global_install/hooks
37+
source ../concourse/bin/sts-assume-role.sh /
38+
'arn:aws:iam::103495720024:role/gds_pre_commit_tests_role)' /
39+
'eu-west-2'
3740
make run

0 commit comments

Comments
 (0)