AWS ServiceCatalog provision-product error

9.2k Views Asked by At

I am automating (python, boto3) the creation of products and their launch in service catalog from the command line. I create the product, grab the productId from the response. I then pull the launch path using list-launch-paths. When I finally get down to provisioning the product I receive an error:

An error occurred (ResourceNotFoundException) when calling the ProvisionProduct operation: Product prod-vfwmgz65lckke not found.

I switched over to using the aws cli and get the same error. However, I can provision the product from the AWS Console. Here is the command line I am using

aws servicecatalog provision-product --product-id="prod-vfwmgz65lckke" --provisioning-artifact-id="mytester" --provisioned-product-name="mytester" --path-id="lp-wkgbq4zcd74v6"

Here is the listing from search_products:

.....................................
.....................................
.....................................                                 
'ProductViewSummaries': [   {   'HasDefaultPath': False,
                                'Id': 'prodview-3u7zx4fbb4ekg',
                                'Name': 'my-test-server-13',
                                'Owner': 'Felicia Rosemond',
                                'ProductId': 'prod-vfwmgz65lckke',
                                'Type': 'CLOUD_FORMATION_TEMPLATE'},
 .................................
 .................................
 .................................

Any ideas on what I am missing?

2

There are 2 best solutions below

0
On BEST ANSWER

I found the answer to my problem. I was missing the Provisioning Artifact Id, after including that the stack launched perfectly. It seems the error was a red herring.

0
On

Steps to provision product:

  1. Search the product by a text like 'test-infra':

    aws servicecatalog search-products --filters FullTextSearch='test-infra' --region eu-west1
    
  2. To fetch the artifactId, use the productId from the above results, run the following:

    aws servicecatalog describe-product --id prodvI989234 --region eu-west-1
    
  3. To get the launch path:

    aws servicecatalog list-launch-paths --product-id prodvI989234 --region=eu-west-1
    
  4. Use the productId from 1, artifactId from 2 and launchpathId from 3 and run provision-product:

    aws servicecatalog provision-product --product-id  prodvI989234 --provisioning-artifact-id  *artiafctId* --path-id *launchPathId* --provisioning-parameters Key=param1,Value=0,Key=param2, Value=medium,Key=param3,Value=abc,Key=param4,Value=test3,Key=StackName,Value=stackname --provisioned-product-name stackbuild