Provisioning Resources on Oracle Cloud Infrastructure using OCI Resource Manager

OCI Resource Manager Command

Question

You have received an email from your manager to provision new resources on Oracle Cloud Infrastructure (OCI)

When researching OCI, you determined that you should use OCI Resource Manager.

Since this is a task that will be done multiple times for development, test, and production.

You will need to create a command that can be re-used.

Which CLI command can be used in this situation? (Choose the best answer.)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

OCI Resource Manager is a service in Oracle Cloud Infrastructure that helps automate the process of provisioning infrastructure resources. It allows you to define infrastructure as code (IAC) using Terraform templates, which can be version-controlled and reused across multiple environments such as development, test, and production.

To create a stack using OCI Resource Manager, you can use the OCI Command Line Interface (CLI). The CLI is a command-line tool that enables you to interact with OCI services from the terminal. It provides a set of commands that you can use to manage your resources in OCI.

The question asks for the best CLI command to create a stack that can be reused across multiple environments. Let's review each option provided:

Option A:

c
oci resource-manager stack create ""tenancy"id <tenancy_OCID> \ ""config-source prod.zip ""variables file://variables.json \ ""display-name Production stack build \ ""description Creating new Production environment

This command creates a stack in the root compartment (tenancy) using the prod.zip file as the configuration source and variables.json file for variable values. The display name of the stack is "Production stack build" and the description is "Creating new Production environment". However, since it creates the stack in the root compartment, it may not be suitable for managing resources across multiple environments.

Option B:

c
oci resource-manager stack update ""compartment"id <compartment_OCID> \ ""config-source prod.zip ""variables file://variables.json \ ""display-name Production stack build \ ""description Creating new Production environment

This command updates an existing stack in the specified compartment (compartment_OCID) with the prod.zip file as the configuration source and variables.json file for variable values. The display name of the stack is "Production stack build" and the description is "Creating new Production environment". However, this command updates an existing stack and may not be suitable for creating a new stack.

Option C:

c
oci resource-manager stack create ""compartment"id <compartment_OCID> \ ""config-source prod.zip ""variables file://variables.json \ ""display-name Production stack build \ ""description Creating new Production environment

This command creates a new stack in the specified compartment (compartment_OCID) using the prod.zip file as the configuration source and variables.json file for variable values. The display name of the stack is "Production stack build" and the description is "Creating new Production environment". This command is suitable for creating a new stack in a specific compartment, making it easier to manage resources across multiple environments.

Option D:

c
oci resource-manager stack update ""tenancy"id <tenancy_OCID> \ ""config-source prod.zip ""variables file://variables.json \ ""display-name Production stack build \ ""description Creating new Production environment

This command updates an existing stack in the root compartment (tenancy) with the prod.zip file as the configuration source and variables.json file for variable values. The display name of the stack is "Production stack build" and the description is "Creating new Production environment". However, this command updates an existing stack and may not be suitable for creating a new stack.

Based on the explanations above, the best answer for the CLI command that can be used to create a new stack that can be reused across multiple environments is Option C:

c
oci resource-manager stack create ""compartment"id <compartment_OCID> \ ""config-source prod.zip ""variables file://variables.json \ ""display-name Production stack build \ ""description Creating new Production environment

This command allows you to create a new stack in a specific compartment, which makes it easier to manage resources across multiple environments.