Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "version": "1.0",
- "producer": {
- "name": "app_name_{{ ENVIRONMENT }}_producer",
- "kms_key_alias": "alias/app_name_{{ ENVIRONMENT }}_producer_key",
- "shards": 1,
- "subscriptions": {
- "app_name1_{{ ENVIRONMENT }}_consumer": {
- "account_id": "123456789012",
- "active": true
- },
- "app_name2_{{ ENVIRONMENT }}_consumer": {
- "account_id": "987654321098",
- "active": true
- }
- }
- },
- "consumers": {
- "app_name_{{ ENVIRONMENT }}_consumer": {
- "kms_key_alias": "alias/app_name_{{ ENVIRONMENT }}_consumer_key",
- "shards": 1
- }
- },
- "overrides": {
- "prod": {
- "producer": {
- "shards": 2,
- "subscriptions": {
- "app_name1_{{ ENVIRONMENT }}_consumer": {
- "account_id": "123456789012",
- "active": false
- }
- }
- },
- "consumers": {
- "app_name_{{ ENVIRONMENT }}_consumer": {
- "shards": 3
- }
- }
- }
- }
- }
- {
- "producer": {
- ...
- }
- consumers": {
- ...
- }
- }
- const json = JSON.parse(template)
- if ({}.hasOwnProperty.call(overrides, environment)) {
- const env = overrides[environment];
- Object.keys(env).forEach((key){
- ...
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement