Creating a Stack from Bitbucket Server

Create a stack in Resource Manager from a Terraform configuration stored in Bitbucket Server. Select a configuration source provider that specifies the Bitbucket Server 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.

  • These steps show how to create a stack from a Bitbucket Server configuration source provider from its details page (Configuration source provider information). You can also create a stack from a configuration source provider from the Configuration source providers page by clicking the Actions menu (Actions Menu) to the right of the name of the configuration source provider and then selecting Create stack from configuration source provider.
    1. Open the navigation menu and click Developer Services. Under Resource Manager, click Configuration Source Providers.
    2. On the Configuration source providers page, select the compartment that contains the configuration source provider that you want.
    3. Click the name of the Bitbucket Server configuration source provider that you want.
    4. On the Configuration source provider information page, click Create stack.
      The Create stack page opens with the Bitbucket Server configuration source provider already selected.
    5. Select the Bitbucket Server project, repository, and branch. The list of branches is limited to 100.
    6. (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
    7. (Optional) To use custom providers, select Use custom providers and then select the bucket that contains the custom provider.
    8. (Optional) Edit the default stack name and enter a stack description. Avoid entering confidential information.
    9. Select the compartment where you want to create the stack.
    10. For Terraform version, select the version used by the Terraform configuration.
    11. (Optional) Click 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.
    12. Click Next.
    13. 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.
    14. Click Next.
    15. In the Review panel, verify the stack configuration.
    16. (Optional) To automatically provision resources on creation of the stack, select Run apply.
    17. Click 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-server command and required parameters to create a stack from Bitbucket Server.

    oci resource-manager stack create-from-bitbucket-server --compartment-id <compartment_OCID> --config-source-configuration-source-provider-id <Bitbucket_Server_configuration_source_provider_OCID> --config-source-repository-url <Bitbucket_Server_repository>

    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 Server.

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