-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.py
68 lines (55 loc) · 2.31 KB
/
configure.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
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
import boto3
import json
client = boto3.client('secretsmanager')
cloudformation = boto3.resource('cloudformation')
api_response = client.get_secret_value(
SecretId='api-tnris-org'
)
gspread_response = client.get_secret_value(
SecretId='api-gspread-config'
)
stack_resource = cloudformation.StackResource('datahub-master', 'MasterCloudfront')
secrets = json.loads(api_response["SecretString"])
gspread = gspread_response["SecretString"]
#Create the gspread_config.json file
text_file = open("./src/data_hub/gspread_config.json", "w")
text_file.write(gspread)
text_file.close()
export_command = ("export DB_PASSWORD=" + secrets["DB_PASSWORD"] +
" DB_NAME=" + secrets["DB_NAME"] +
" DB_USER=" + secrets["DB_USER"] +
" DB_HOST=localhost" +
" DB_PORT=9000" +
" SEO_TOKEN=" + secrets["SEO_TOKEN"] +
# CONTACT APP ENV VARIABLES
" RECAPTCHA_SECRET=" + secrets["RECAPTCHA_SECRET"] +
" MAIL_DEFAULT_FROM=" + secrets["MAIL_DEFAULT_FROM"] +
" STRATMAP_EMAIL=" + secrets["STRATMAP_EMAIL"] +
" MAIL_DEFAULT_TO=" + secrets["MAIL_DEFAULT_TO"] +
" AWS_SES_ACCESS_KEY=" + secrets["AWS_SES_ACCESS_KEY"] +
" AWS_SES_SECRET_KEY=" + secrets["AWS_SES_SECRET_KEY"] +
" S3_UPLOAD_BUCKET=" + secrets["S3_UPLOAD_BUCKET"] +
" S3_UPLOAD_SECRET=" + secrets["S3_UPLOAD_SECRET"] +
" S3_UPLOAD_KEY=" + secrets["S3_UPLOAD_KEY"] +
" MAPSERVER_DB_NAME=" + secrets["MAPSERVER_DB_NAME"] +
" MAPSERVER_DB_USER=" + secrets["MAPSERVER_DB_USER"] +
" MAPSERVER_DB_PASSWORD=" + secrets["MAPSERVER_DB_PASSWORD"] +
" DATAHUB_MASTER_CLOUDFRONT=" + stack_resource.physical_resource_id +
# CCP Environment Variables
" CCP_MERCHANT_CODE=" + secrets["CCP_MERCHANT_CODE"] +
" CCP_MERCHANT_KEY=" + secrets["CCP_MERCHANT_KEY"] +
" CCP_SERVICE_CODE=" + secrets["CCP_SERVICE_CODE"] +
" CCP_API_KEY=" + secrets["CCP_API_KEY"] +
" CCP_API_KEY_UAT=" + secrets["CCP_API_KEY_UAT"] +
" CCP_ACCESS_CODE=" + secrets["CCP_ACCESS_CODE"] +
# Encryption Environmental Variables
" FKEY1=" + secrets["FKEY1"] +
" ACCESS_PEPPER=" + secrets["ACCESS_PEPPER"] +
# Private emails
" BCC_EMAIL_1=" + secrets["BCC_EMAIL_1"] +
# ArcGIS credentials for analytics report
" ARCGIS_USERNAME=" + secrets["ARCGIS_USERNAME"] +
" ARCGIS_PASSWORD=" + secrets["ARCGIS_PASSWORD"] +
# the following is only used within ETL scripts (specifically, migrate.py)
" TNRIS_REPO='local_path_to_cloned_tnris_website_repo'")
print(export_command)