Configure your VM image for Terraform deployment

This article describes how to finish configuring and submit your VM image for deployment using Terraform.

Specify whether to use the default or a custom Terraform module

You can choose whether you want your customers to use the default or a custom Terraform module when they deploy your product.

If you choose to use the default Terraform module, Google Cloud provides your customers with autogenerated Terraform code that they can use to deploy your product. If you choose to use a custom Terraform module, you must provide your own Terraform templates to your customer.

To specify whether your customers should use the default or a custom Terraform module, complete the following steps:

  1. In Producer Portal, go to the Deployment package section.

  2. Under Terraform configuration, under Type, select Default or Custom.

Additional steps for custom Terraform modules

If you selected to use custom Terraform modules, you must complete the following additional steps to configure your VM image for deployment:

  1. In Producer Portal, go to the Deployment package section.

  2. Under Terraform configuration, under Variables, click Add variable.

    To enable Terraform deployment of your product, you must have turned on usage of Marketplace owned images. Cloud Marketplace uses the variable you add here to swap in the Marketplace owned version of your VM image when a customer deploys your product.

  3. In the Variable text field, enter a name for your variable, such as "image".

  4. In your custom Terraform module, set the default value of the variable that you created in the previous step to the name of the VM image for your product, in the format projects/YOUR_PROJECT/global/images/YOUR_IMAGE.

  5. Under Specify your GCS object location, click Browse.

    If you've already created a Cloud Storage bucket, select it here.

    If you don't have a Cloud Storage bucket, click the icon labeled Create new bucket. When you create a new bucket, you:

    • Select a name for the bucket.

    • Specify what region or regions the bucket stores data in.

    • Specify the storage class for your data.

    • Determine what level of granularity to apply to the Identity and Access Management (IAM) permissions for the bucket's data.

    • Configure optional advanced settings, such as encryption or data retention policies.

  6. Ensure that Object Versioning is enabled for your Cloud Storage bucket.

  7. To save your bucket settings and continue configuring your deployment package, click Configure.

  8. Under Required roles, specify the IAM roles your customers must have to deploy your product.

Submit your deployment package for review

After you've created and configured your deployment package, you must submit the package to Producer Portal so that the Cloud Marketplace team can review and approve the package.

  1. In Producer Portal, go to the Deployment package section.

  2. Click Validate. The validation process can take up to two hours to complete, and you can exit the screen while it's completing.

  3. After the validation has completed successfully, to submit the deployment package for review, click Submit. After you submit the package, it might take up to two weeks for Google to review and approve the package.