Creating a Stack from Bitbucket Cloud

Create a stack in Resource Manager from a Terraform configuration stored in Bitbucket Cloud. Select a configuration source provider that specifies the Bitbucket Cloud information needed to access the configurations.

Ensure that the Terraform configuration is valid. See Terraform Configurations for Resource Manager and Authoring Configurations.

For information about configuration source providers, see Managing Configuration Source Providers.

    1. On the Configuration source providers list page, find the configuration source provider that you want to work with. If you need help finding the list page or the configuration source provider, see Listing Configuration Source Providers.
    2. From the Actions menu (Actions Menu) for the configuration source provider, select Create stack from configuration source provider.
      The Create stack page opens with the Bitbucket Cloud configuration source provider already selected.
    3. Select the Bitbucket Cloud workspace, repository, and branch. The list of branches is limited to 100.
      For information about Bitbucket Cloud workspaces, see https://support.atlassian.com/bitbucket-cloud/docs/what-is-a-workspace/.
    4. (Optional) To use a directory other than the root directory for running Terraform, specify the working directory. This field is visible when the selected branch has directories. Examples:
      • One level: Directory
      • Two levels: Directory/Subdirectory
    5. (Optional) To use custom providers, select Use custom providers and then select the bucket that contains the custom provider.
    6. (Optional) Edit the default stack name and enter a stack description. Avoid entering confidential information.
    7. Select the compartment where you want to create the stack.
    8. For Terraform version, select the version used by the Terraform configuration.
    9. (Optional) Select Show advanced options and assign tags to the stack.
      • Tag namespace: To add a defined tag, select an existing namespace. To add a free-from tag, leave the value blank.
      • Tag key: To add a defined tag, select an existing tag key. To add a free-form tag, type the key name that you want.
      • Tag value: Type the tag value that you want.
      • Add tag: Click to add another tag.
    10. Select Next.
    11. 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.
    12. Select Next.
    13. In the Review panel, verify the stack configuration.
    14. (Optional) To automatically provision resources on creation of the stack, select Run apply.
    15. Select Create.

    The stack is created and its Stack 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-bitbucket-cloud command and required parameters to create a stack from Bitbucket Cloud.

    oci resource-manager stack create-from-bitbucket-cloud --compartment-id <compartment_OCID> --config-source-configuration-source-provider-id <Bitbucket_Cloud_configuration_source_provider_OCID> --config-source-repository-url <Bitbucket_Cloud_repository> --config-source-workspace-id <workspace_ID>

    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 Bitbucket Cloud.

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