forked from alphagov/notifications-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.yml.j2
182 lines (160 loc) · 6.44 KB
/
manifest.yml.j2
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
{%- set app_vars = {
'notify-api': {
'NOTIFY_APP_NAME': 'api',
'disk_quota': '10G',
'sqlalchemy_pool_size': 15,
'additional_env_vars': {
'STATSD_HOST': None
},
'routes': {
'preview': ['api.notify.works', 'notify-api-preview.apps.internal'],
'staging': ['api.staging-notify.works', 'notify-api-staging.apps.internal'],
'production': ['api.notifications.service.gov.uk', 'notify-api-production.apps.internal'],
},
'health-check-type': 'port',
'health-check-invocation-timeout': 3,
'instances': {
'preview': None,
'staging': None,
'production': 25
},
},
'notify-api-sms-receipts': {
'NOTIFY_APP_NAME': 'api',
'disk_quota': '4G',
'additional_env_vars': {
'STATSD_HOST': None
},
'routes': {
'preview': ['api.notify.works/notifications/sms/mmg', 'api.notify.works/notifications/sms/firetext', 'notify-api-sms-receipts-preview.apps.internal'],
'staging': ['api.staging-notify.works/notifications/sms/mmg', 'api.staging-notify.works/notifications/sms/firetext', 'notify-api-sms-receipts-staging.apps.internal'],
'production': ['api.notifications.service.gov.uk/notifications/sms/mmg', 'api.notifications.service.gov.uk/notifications/sms/firetext', 'notify-api-sms-receipts-production.apps.internal' ],
},
'health-check-type': 'port',
'health-check-invocation-timeout': 3,
'instances': {
'preview': 1,
'staging': 2,
'production': 10
},
},
'notify-api-db-migration': {
'NOTIFY_APP_NAME': 'api',
'instances': {
'preview': 0,
'staging': 0,
'production': 0
},
},
'notify-delivery-celery-beat': {
'memory': '512M',
'instances': {
'preview': 0,
'staging': 0,
'production': 0
},
},
'notify-delivery-worker-ecs-fixup': {
'disk_quota': '10G',
'memory': '4G',
'additional_env_vars': {
'NOTIFICATION_QUEUE_PREFIX': ('production-' if environment == 'production' else (NOTIFICATION_QUEUE_PREFIX + '-ecs')),
'CELERYD_PREFETCH_MULTIPLIER': 1,
},
'instances': {
'preview': 0,
'staging': 0,
'production': 0
},
},
'notify-delivery-worker-jobs': {'memory': '2G'},
'notify-delivery-worker-research': {'disk_quota': '10G'},
'notify-delivery-worker-sender': {'disk_quota': '4G', 'memory': '4G'},
'notify-delivery-worker-sender-letters': {},
'notify-delivery-worker-periodic': {},
'notify-delivery-worker-reporting': {
'additional_env_vars': {
'CELERYD_PREFETCH_MULTIPLIER': 1,
}
},
'notify-delivery-worker-letters': {'memory': '2G'},
'notify-delivery-worker-retry-tasks': {},
'notify-delivery-worker-internal': {},
'notify-delivery-worker-broadcasts': {
'additional_env_vars': {
'CELERYD_PREFETCH_MULTIPLIER': 1,
'CBC_PROXY_AWS_ACCESS_KEY_ID': CBC_PROXY_AWS_ACCESS_KEY_ID,
'CBC_PROXY_AWS_SECRET_ACCESS_KEY': CBC_PROXY_AWS_SECRET_ACCESS_KEY,
}
},
'notify-delivery-worker-receipts': {},
'notify-delivery-worker-service-callbacks': {'disk_quota': '4G'},
'notify-delivery-worker-save-api-notifications': {'disk_quota': '4G'},
} -%}
{%- set app = app_vars[CF_APP] -%}
{%- set instance_count = app.get('instances', {}).get(environment) -%}
---
applications:
- name: {{ CF_APP }}
buildpack: python_buildpack
{% if instance_count is not none %}
instances: {{ instance_count }}
{%- endif %}
memory: {{ app.get('memory', '1.5G') }}
disk_quota: {{ app.get('disk_quota', '2G')}}
stack: cflinuxfs3
routes:
{%- for route in app.get('routes', {}).get(environment, []) %}
- route: {{ route }}
{%- endfor%}
- route: {{ CF_APP }}-{{ environment }}.cloudapps.digital
health-check-type: {{ app.get('health-check-type', 'process') }}
health-check-invocation-timeout: {{ app.get('health-check-invocation-timeout', 1) }}
services:
- logit-ssl-syslog-drain
env:
NOTIFY_APP_NAME: {{ app.get('NOTIFY_APP_NAME', CF_APP.replace('notify-', '')) }}
NOTIFY_LOG_PATH: /home/vcap/logs/app.log
SQLALCHEMY_POOL_SIZE: {{ app.get('sqlalchemy_pool_size', 1) }}
FLASK_APP: application.py
NOTIFY_ENVIRONMENT: {{ environment }}
# Credentials variables
ADMIN_BASE_URL: '{{ ADMIN_BASE_URL }}'
INTERNAL_CLIENT_API_KEYS: '{{ INTERNAL_CLIENT_API_KEYS | tojson }}'
API_HOST_NAME: '{{ API_HOST_NAME }}'
API_HOST_NAME_INTERNAL: '{{ API_HOST_NAME_INTERNAL }}'
DANGEROUS_SALT: '{{ DANGEROUS_SALT }}'
SECRET_KEY: '{{ SECRET_KEY }}'
ROUTE_SECRET_KEY_1: '{{ ROUTE_SECRET_KEY_1 }}'
ROUTE_SECRET_KEY_2: '{{ ROUTE_SECRET_KEY_2 }}'
CRONITOR_KEYS: '{{ CRONITOR_KEYS | tojson }}'
METRICS_BASIC_AUTH_TOKEN: {{ METRICS_BASIC_AUTH_TOKEN }}
SQLALCHEMY_DATABASE_URI: '{{ SQLALCHEMY_DATABASE_URI }}'
REDIS_URL: '{{ REDIS_URL }}'
HIGH_VOLUME_SERVICE: '{{ HIGH_VOLUME_SERVICE | tojson }}'
DOCUMENT_DOWNLOAD_API_HOST: '{{ DOCUMENT_DOWNLOAD_API_HOST }}'
DOCUMENT_DOWNLOAD_API_HOST_INTERNAL: '{{ DOCUMENT_DOWNLOAD_API_HOST }}'
DOCUMENT_DOWNLOAD_API_KEY: '{{ DOCUMENT_DOWNLOAD_API_KEY }}'
NOTIFICATION_QUEUE_PREFIX: '{{ NOTIFICATION_QUEUE_PREFIX }}'
AWS_ACCESS_KEY_ID: '{{ AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '{{ AWS_SECRET_ACCESS_KEY }}'
STATSD_HOST: "notify-statsd-exporter-{{ environment }}.apps.internal"
ZENDESK_API_KEY: '{{ ZENDESK_API_KEY }}'
ZENDESK_REPORTING: '{{ ZENDESK_REPORTING | tojson }}'
MMG_API_KEY: '{{ MMG_API_KEY }}'
MMG_INBOUND_SMS_AUTH: '{{ MMG_INBOUND_SMS_AUTH | tojson }}'
MMG_INBOUND_SMS_USERNAME: '{{ MMG_INBOUND_SMS_USERNAME | tojson }}'
FIRETEXT_API_KEY: '{{ FIRETEXT_API_KEY }}'
FIRETEXT_INTERNATIONAL_API_KEY: '{{ FIRETEXT_INTERNATIONAL_API_KEY }}'
FIRETEXT_INBOUND_SMS_AUTH: '{{ FIRETEXT_INBOUND_SMS_AUTH | tojson }}'
TEMPLATE_PREVIEW_API_HOST: '{{ TEMPLATE_PREVIEW_API_HOST }}'
TEMPLATE_PREVIEW_API_KEY: '{{ TEMPLATE_PREVIEW_API_KEY }}'
DVLA_EMAIL_ADDRESSES: '{{ DVLA_EMAIL_ADDRESSES | tojson }}'
DVLA_API_TLS_CIPHERS: '{{ DVLA_API_TLS_CIPHERS }}'
SENTRY_ENABLED: '{{ NOTIFICATIONS_API_SENTRY_ENABLED }}'
SENTRY_DSN: '{{ NOTIFICATIONS_API_SENTRY_DSN }}'
SENTRY_ERRORS_SAMPLE_RATE: '{{ NOTIFICATIONS_API_SENTRY_ERRORS_SAMPLE_RATE }}'
SENTRY_TRACES_SAMPLE_RATE: '{{ NOTIFICATIONS_API_SENTRY_TRACES_SAMPLE_RATE }}'
{% for key, value in app.get('additional_env_vars', {}).items() %}
{{key}}: '{{value}}'
{% endfor %}