Skip to content

Commit

Permalink
Merge pull request jhuapl-boss#6 from aplmicrons/devstack
Browse files Browse the repository at this point in the history
Set DEV_STACK variable if deploying to a dev stack
  • Loading branch information
sandyhider authored Jun 15, 2017
2 parents 3b1a4ef + bde4d35 commit a05787b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cloud_formation/configs/dynamolambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
# written to SLACK_WEBHOOK_PATH.
VPC_DOMAIN = 'VPC_DOMAIN'

# Used to override normal autoscale rules when creating a developer's stack.
# All tables will use the autoscale rules defined by the "default" config to
# avoid spending too much. The production autoscale rules have minimums that
# are way too high for DynamoDB tables for developers.
DEV_STACK = 'DEV_STACK'

def create_config(session, domain):
"""
Create the CloudFormationConfiguration object.
Expand Down Expand Up @@ -166,6 +172,8 @@ def update_config_file(config_str, domain):
config_str (str): String representation of config file template.
"""
parser = configparser.ConfigParser()
# Disable default transform to lowercase of keys.
parser.optionxform = lambda option: option
parser.read_string(config_str)
parser.set('default', VPC_DOMAIN, domain)

Expand All @@ -176,6 +184,10 @@ def update_config_file(config_str, domain):
parser.set('default', SLACK_WEBHOOK_PATH, slack_path_prod)
else:
parser.set('default', SLACK_WEBHOOK_PATH, slack_path_dev)
if domain != 'integration.boss':
# Override normal autoscale parameters when deploying to a
# developer stack.
parser.set('default', DEV_STACK, '')
slack_path = parser.get('default', SLACK_WEBHOOK_PATH)

# Remove stack specific variables before outputting.
Expand Down

0 comments on commit a05787b

Please sign in to comment.