Using the SDK

Note

This was added in 0.18.0

Service Catalog Puppet includes a published SDK. You can make use of the python functions available:

from servicecatalog_puppet import sdk

The functions available are:

Functions

servicecatalog_puppet.sdk.add_to_accounts(account_or_ou)[source]

Add the parameter to the account list of the manifest file

Parameters

account_or_ou – A dict describing the the account or the ou to be added

servicecatalog_puppet.sdk.add_to_launches(launch_name, launch)[source]

Add the given launch to the launches section using the given launch_name

Parameters
  • launch_name – The launch name to use when adding the launch to the manifest launches

  • launch – The dict to add to the launches

servicecatalog_puppet.sdk.bootstrap(with_manual_approvals)[source]

Bootstrap the puppet account. This will create the AWS CodeCommit repo containing the config and it will also create the AWS CodePipeline that will run the solution.

Parameters

with_manual_approvals – Boolean to specify whether there should be manual approvals before provisioning occurs

servicecatalog_puppet.sdk.remove_from_accounts(account_id_or_ou_id_or_ou_path)[source]

remove the given account_id_or_ou_id_or_ou_path from the account list

Parameters

account_id_or_ou_id_or_ou_path – the value can be an account_id, ou_id or an ou_path. It should be present in the

accounts list within the manifest file or an error is generated

servicecatalog_puppet.sdk.remove_from_launches(launch_name)[source]

remove the given launch_name from the launches list

Parameters

launch_name – The name of the launch to be removed from the launches section of the manifest file

servicecatalog_puppet.sdk.run(what='puppet', wait_for_completion=False)[source]

Run something

Parameters
  • what – what should be run. The only parameter that will work is puppet

  • wait_for_completion – Whether the command should wait for the completion of the pipeline before it returns

servicecatalog_puppet.sdk.upload_config(config)[source]

This function allows you to upload your configuration for puppet. At the moment this should be a dict with an attribute named regions: regions: [

‘eu-west-3’, ‘sa-east-1’,

]

Parameters

config – The dict containing the configuration used for puppet