Creating a Stack from Git
Create a stack in Resource Manager from a Terraform configuration stored in Git. Select a configuration source provider that specifies the Git 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.
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-git-provider
command and required parameters to create a stack from Git.oci resource-manager stack create-from-git-provider [OPTIONS]
For a complete list of parameters and values for CLI commands, see the Command Line Reference for Resource Manager.
Example Requestoci resource-manager stack create-from-git-provider --compartment-id ocid1.tenancy.oc1..uniqueid --config-source-configuration-source-provider-id ocid.ormconfigsourceprovider.oc1..uniqueid --config-source-repository-url https://github.com/user/repo.git --config-source-branch-name mybranch --display-name "My Stack from Git" --description "My Test" --variables file://variables.json --working-directory ""
Use the CreateStack operation to create a stack from Git.
For an example of the
configSource
part of the request, see CreateGitConfigSourceDetails.Example requestPOST /20180917/stacks Host: resourcemanager.us-phoenix-1.oraclecloud.com <authorization and other headers> { "compartmentId": "ocid1.compartment.oc1..<unique_ID>", "displayName": "My GitHub Configuration", "configSource": { "configSourceType": "GIT_CONFIG_SOURCE", "configurationSourceProviderId": "ocid1.ormconfigsourceprovider.oc1..<unique_ID>", "repositoryUrl": "https://github.com/user/repo.git", "branchName": "MyBranch", "workingDirectory": "<file_path_to_directory>", } }