Skip to content

Commit

Permalink
Release/0.0.22 (#18)
Browse files Browse the repository at this point in the history
Added bootstrap_spoke_as and updated betterboto version
  • Loading branch information
eamonnfaherty authored Apr 28, 2019
1 parent b05f1c7 commit 3ff56fd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
50 changes: 31 additions & 19 deletions servicecatalog_puppet/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,29 +621,41 @@ def deploy_launches(deployment_map, parameters, single_account, puppet_account_i
logger.info('Finished creating stacks')


@cli.command()
@click.argument('puppet_account_id')
@click.argument('iam_role_arn')
def bootstrap_spoke_as(puppet_account_id, iam_role_arn):
with betterboto_client.CrossAccountClientContextManager('cloudformation', iam_role_arn, 'bootstrapping') as cloudformation:
do_bootstrap_spoke(puppet_account_id, cloudformation)


@cli.command()
@click.argument('puppet_account_id')
def bootstrap_spoke(puppet_account_id):
logger.info('Starting bootstrap of spoke')
with betterboto_client.ClientContextManager('cloudformation') as cloudformation:
template = read_from_site_packages('{}-spoke.template.yaml'.format(BOOTSTRAP_STACK_NAME))
template = Template(template).render(VERSION=VERSION)
args = {
'StackName': "{}-spoke".format(BOOTSTRAP_STACK_NAME),
'TemplateBody': template,
'Capabilities': ['CAPABILITY_NAMED_IAM'],
'Parameters': [
{
'ParameterKey': 'PuppetAccountId',
'ParameterValue': str(puppet_account_id),
}, {
'ParameterKey': 'Version',
'ParameterValue': VERSION,
'UsePreviousValue': False,
},
],
}
cloudformation.create_or_update(**args)
do_bootstrap_spoke(puppet_account_id, cloudformation)


def do_bootstrap_spoke(puppet_account_id, cloudformation):
logger.info('Starting bootstrap of spoke')
template = read_from_site_packages('{}-spoke.template.yaml'.format(BOOTSTRAP_STACK_NAME))
template = Template(template).render(VERSION=VERSION)
args = {
'StackName': "{}-spoke".format(BOOTSTRAP_STACK_NAME),
'TemplateBody': template,
'Capabilities': ['CAPABILITY_NAMED_IAM'],
'Parameters': [
{
'ParameterKey': 'PuppetAccountId',
'ParameterValue': str(puppet_account_id),
}, {
'ParameterKey': 'Version',
'ParameterValue': VERSION,
'UsePreviousValue': False,
},
],
}
cloudformation.create_or_update(**args)
logger.info('Finished bootstrap of spoke')


Expand Down
2 changes: 1 addition & 1 deletion servicecatalog_puppet/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Jinja2==2.10.1
click==7.0
boto3==1.9.102
pykwalify==1.7.0
better-boto==0.6.9
better-boto==0.6.14
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setuptools.setup(
name="aws-service-catalog-puppet",
version="0.0.21",
version="0.0.22",
author="Eamonn Faherty",
author_email="[email protected]",
description="Making it easier to deploy ServiceCatalog products",
Expand Down

0 comments on commit 3ff56fd

Please sign in to comment.