Updating Service Catalog Product Versions Through AWS CLI/Boto3

1.8k Views Asked by At

I want to automatically roll out new versions of my Service Catalog product using a Lambda that runs weekly. I can't find a corresponding Boto3/AWS CLI command to do this, however. I see there is 'update_product', but there doesn't appear to be a way to use this command specify a version number,nor do I think there is a way to remove deprecated versions without removing the product itself with 'delete_product'.

Is there a way to do this versioning from the CLI?

3

There are 3 best solutions below

1
On
0
On

Use aws servicecatalog generate provisioning-artifact.

0
On
  1. Find the Product ID of the product you wish to update by using the command below, and note the value of the field named ProductId

    aws servicecatalog search-products-as-admin

  2. Upload the CloudFormation template to S3 and copy the URL to the template

  3. Run the following command, inserting the Version Name, Product ID and the URL for the template in S3

    aws servicecatalog create-provisioning-artifact --product-id INSERT_PRODUCT_ID --parameters Name=INSERT_VERSION_NAME,Info={LoadTemplateFromURL=INSERT_TEMPLATE_URL},Type=CLOUD_FORMATION_TEMPLATE