-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
38 lines (24 loc) · 1.27 KB
/
config.py
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
#!/usr/bin/env python3
"""config info"""
import boto3
SCICOMP_ACCOUNT_NUMBER = "344850189907"
HSE_ACCOUNT_NUMBER = "064561331775"
# Allows full access to the batch service as well as the ability to pass the
# following roles/instance profile: ADMIN_ROLE, ADMIN_INSTANCE_PROFILE
ADMIN_BATCH_GROUP = "Fh-batch-fullaccess"
ACCOUNT_NUMBER = boto3.client('sts').get_caller_identity()['Account']
ADMIN_ROLE = "arn:aws:iam::{}:role/fh-pi-universal-batchservice".format(ACCOUNT_NUMBER)
ADMIN_INSTANCE_PROFILE = \
"arn:aws:iam::{}:instance-profile/fh-pi-universal-batchrole".format(ACCOUNT_NUMBER)
BATCH_ROLE = "arn:aws:iam::{}:role/fh-pi-universal-batchrole".format(ACCOUNT_NUMBER)
BATCH_SERVICE = "arn:aws:iam::{}:role/fh-pi-universal-batchservice".format(ACCOUNT_NUMBER)
BUCKET_ACCESS_POLICY = "arn:aws:iam::{account}:policy/fh-pi{pi}-bucket-access"
END_USER_BATCH_GROUP = "fh-pi-end-user-batch-access"
PASS_ROLE_POLICY = "arn:aws:iam::{}:policy/fh_allow_passrole".format(ACCOUNT_NUMBER)
BATCHIT_POLICY = "arn:aws:iam::{}:policy/batchit-instance-permissions".format(ACCOUNT_NUMBER)
if ACCOUNT_NUMBER == SCICOMP_ACCOUNT_NUMBER:
BUCKET_PREFIX = "fh-pi-sc-"
elif ACCOUNT_NUMBER == HSE_ACCOUNT_NUMBER:
BUCKET_PREFIX = "fh-pi-"
else:
raise ValueError('Unknown AWS account number.')