Is it possible to launch an existing ServiceCatalog product with AWS CDK?

Viewed 586

I cannot find any good examples on how to work with AWS CDK ServiceCatalog resources. My goal is to launch an existing ServiceCatalog product defined by my organization and supply its input parameters using the CDK.

Is it possible? Or is this only to define and change ServiceCatalog products itself, without an option to launch them?

1 Answers

Yes, it is possible to launch the ServiceCatalog product via AWS CDK. The CfnCloudFormationProvisionedProduct construct should be used for this.

CfnCloudFormationProvisionedProduct.Builder
            .create(this,"test")
            .provisionedProductName("s3")
            .productName("s3")
            .provisioningArtifactName("1.0")
            .provisioningParameters(Arrays.asList(params))
            .build()
    ;

And the params in the code snippet above can be defined as following:

CfnCloudFormationProvisionedProduct.ProvisioningParameterProperty
                    .builder().key("parameter id").value("parameter value").build()
Related