Using Custom Providers with a Stack

Update a stack to fetch custom providers from Object Storage buckets.

If the stack was created before custom providers were available, then first update the stack to use Terraform Registry. This update enables the stack to use custom providers.

Before You Begin

Follow these steps to add a custom provider to a bucket.
  1. Set up the bucket for the custom provider. See Putting Data into Object Storage.
    • To store amd/x86 binaries, create a directory under the root of the bucket with the following name:

      linux_amd64

    • To store Arm binaries, create a directory under the root of the bucket with the following name:

      linux_arm64

  2. Confirm that the name of each custom provider binary file aligns with the following convention:

    terraform-provider-<TYPE>_v<MAJOR.MINOR.PATCH>

    With optional suffix (example: x5 or x4):

    terraform-provider-<TYPE>_v<MAJOR.MINOR.PATCH>_<OPTIONAL-SUFFIX>

  3. Upload the custom provider binary files to the bucket. See Putting Data into Object Storage.
    1. Open the navigation menu and click Developer Services. Under Resource Manager, click Stacks.
    2. On the Stacks page, select the compartment that contains the stack that you want.
    3. Click the name of the stack that you want.
    4. On the Stack details page, go to Edit and then select Edit stack.
    5. On the Edit stack page, select Use custom providers.
    6. Select the bucket that contains the custom providers.
    7. Click Next twice.
    8. Click Save changes.
  • Use the oci resource-manager stack update command and required parameters to use custom providers with stacks.

    oci resource-manager stack update --custom-terraform-provider <json_input> [...]

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

  • Use the UpdateStack operation to update the custom providers used by a stack.

    For an example of the CustomTerraformProvider part of the request, see CustomTerraformProvider.