SHARE
TWEET

Untitled

a guest Jun 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.   "version": "1.0",
  3.   "producer": {
  4.     "name": "app_name_{{ ENVIRONMENT }}_producer",
  5.     "kms_key_alias": "alias/app_name_{{ ENVIRONMENT }}_producer_key",
  6.     "shards": 1,
  7.     "subscriptions": {
  8.       "app_name1_{{ ENVIRONMENT }}_consumer": {
  9.         "account_id": "123456789012",
  10.         "active": true
  11.       },
  12.       "app_name2_{{ ENVIRONMENT }}_consumer": {
  13.         "account_id": "987654321098",
  14.         "active": true
  15.       }
  16.     }
  17.   },
  18.   "consumers": {
  19.     "app_name_{{ ENVIRONMENT }}_consumer": {
  20.       "kms_key_alias": "alias/app_name_{{ ENVIRONMENT }}_consumer_key",
  21.       "shards": 1
  22.     }
  23.   },
  24.   "overrides": {
  25.     "prod": {
  26.       "producer": {
  27.         "shards": 2,
  28.         "subscriptions": {
  29.           "app_name1_{{ ENVIRONMENT }}_consumer": {
  30.             "account_id": "123456789012",
  31.             "active": false
  32.           }
  33.         }
  34.       },
  35.       "consumers": {
  36.         "app_name_{{ ENVIRONMENT }}_consumer": {
  37.           "shards": 3
  38.         }
  39.       }
  40.     }
  41.   }
  42. }
  43.      
  44. {
  45.   "producer": {
  46.      ...
  47.   }
  48.   consumers": {
  49.     ...
  50.   }
  51. }
  52.      
  53. const json = JSON.parse(template)
  54.  
  55. if ({}.hasOwnProperty.call(overrides, environment)) {
  56.   const env = overrides[environment];
  57.  
  58.   Object.keys(env).forEach((key){
  59.       ...
  60.   }
  61. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top