-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
80 lines (73 loc) · 2.28 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: "Set up Leverage AWS credentials"
description: 'Setup AWS credentials using Binbash Leverage convention'
inputs:
aws_prd_account_id:
description: 'AWS PRD Account ID'
required: true
default: '0000000000'
aws_devstg_account_id:
description: 'AWS DEVSTG Account ID'
required: true
default: '0000000000'
aws_shared_account_id:
description: 'AWS SHARED Account ID'
required: true
default: '0000000000'
aws_security_account_id:
description: 'AWS SECURITY Account ID'
required: false
default: '0000000000'
aws_network_account_id:
description: 'AWS NETWORK Account ID'
required: true
default: '0000000000'
aws_access_key_id:
description: 'AWS Access Key ID'
required: true
default: 'UNDEFINED'
aws_secret_access_key:
description: 'AWS Access Key ID'
required: true
default: 'UNDEFINED'
runs:
using: composite
steps:
- name: Configure AWS credentials
shell: bash
run: |
set +x
mkdir -p ~/.aws/bb
cat <<EOF > ~/.aws/bb/config
[profile bb-apps-prd-devops]
output=json
region=us-east-1
role_arn=arn:aws:iam::${{ inputs.aws_prd_account_id }}:role/DeployMaster
source_profile=bb-security
[profile bb-apps-devstg-devops]
output=json
region=us-east-1
role_arn=arn:aws:iam::${{ inputs.aws_devstg_account_id }}:role/DeployMaster
source_profile=bb-security
[profile bb-network-devops]
output=json
region=us-east-1
role_arn=arn:aws:iam::${{ inputs.aws_network_account_id }}:role/DeployMaster
source_profile=bb-security
[profile bb-shared-devops]
output=json
region=us-east-1
role_arn=arn:aws:iam::${{ inputs.aws_shared_account_id }}:role/DeployMaster
source_profile=bb-security
[profile bb-security-devops]
output=json
region=us-east-1
role_arn=arn:aws:iam::${{ inputs.aws_security_account_id }}:role/DeployMaster
source_profile=bb-security
EOF
cat <<EOF > ~/.aws/bb/credentials
[bb-security]
aws_access_key_id=${{ inputs.aws_access_key_id }}
aws_secret_access_key=${{ inputs.aws_secret_access_key }}
region=us-east-1
output=json
EOF