Skip to content

Commit

Permalink
now allowing multiple hops through accounts (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
eamonnfaherty committed May 3, 2019
1 parent 5fa7ff8 commit e437a03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions servicecatalog_puppet/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,20 @@ def deploy(f, single_account):

@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:
@click.argument('iam_role_arn', nargs=-1)
def bootstrap_spoke_as(puppet_account_id, roles):
cross_accounts = []
index = 0
for role in roles:
cross_accounts.append(
(role, 'bootstrapping-role-{}'.format(index))
)
index += 1

with betterboto_client.CrossMultipleAccountsClientContextManager(
'cloudformation',
cross_accounts
) as cloudformation:
do_bootstrap_spoke(puppet_account_id, cloudformation, get_puppet_version())


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,6 +3,6 @@ Jinja2==2.10.1
click==7.0
boto3==1.9.102
pykwalify==1.7.0
better-boto==0.6.14
better-boto==0.6.18
terminaltables==3.1.0
colorclass==2.2.0
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.31",
version="0.0.32",
author="Eamonn Faherty",
author_email="aws-service-catalog-tools@amazon.com",
description="Making it easier to deploy ServiceCatalog products",
Expand Down

0 comments on commit e437a03

Please sign in to comment.