Creating a Stack from a Bucket

Create a stack in Resource Manager from a Terraform configuration stored in an Object Storage bucket.

Limit the bucket to files that are intended for use with Terraform. Ensure that the Terraform configuration is valid. See Terraform Configurations for Resource Manager and Authoring Configurations.

    1. On the Stacks list page, select Create stack. If you need help finding the list page or the stack, see Listing Stacks.
    2. On the Create stack page, under Choose the origin of the Terraform configuration, select My configuration.
    3. Under Stack configuration, select Object Storage bucket and then select the bucket that you want.
      Limit the bucket to files that are intended for use with Terraform.
    4. (Optional) To use custom providers, select Use custom providers and then select the bucket that contains the custom provider.
    5. (Optional) Edit the default stack name and enter a stack description. Avoid entering confidential information.
    6. Select the compartment that you want to store the stack in.
    7. For Terraform version, select the version used by the Terraform configuration.
    8. (Optional) Under Tags, add one or more tags to the stack.
      If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
    9. Select Next.
    10. In the Configure variables panel, review the variables listed from the Terraform configuration and change as needed.
      Important

      Don't add your private key or other confidential information to configuration variables.
    11. Select Next.
    12. In the Review panel, verify the stack configuration.
    13. (Optional) To automatically provision resources on creation of the stack, select Run apply.
    14. Select Create.

    The stack is created and its details page opens.

    If you selected Run apply, then Resource Manager runs the apply action on the new stack.

  • Use the oci resource-manager stack create-from-object-storage command and required parameters to create a stack from a bucket.

    oci resource-manager stack create-from-object-storage --compartment-id <compartment_OCID> --config-source-bucket-name <bucket_name> --config-source-namespace <bucket_namespace> --config-source-region <bucket_region>

    For a complete list of parameters and values for CLI commands, see the Command Line Reference for Resource Manager.

  • Use the CreateStack operation to create a stack from a bucket.

    For an example of the configSource part of the request, see CreateObjectStorageConfigSourceDetails.

    Example request
    POST /20180917/stacks
    Host: resourcemanager.us-phoenix-1.oraclecloud.com
    <authorization and other headers>
    {
      "compartmentId": "ocid1.compartment.oc1..<unique_ID>",
      "displayName": "My Bucket Terraform Configuration",
      "configSource": {
        "configSourceType": "OBJECT_STORAGE_CONFIG_SOURCE",
        "region": "us-phoenix-1",
        "namespace": "<bucket_namespace>",
        "bucketName": "<bucket_name>"
      }
    }