Introduction
In Oracle Cloud Infrastructure (OCI), the OCI Stack provides a powerful and streamlined way to manage infrastructure with Terraform directly from the OCI Console. In this document, we will walk through the steps to create and manage Terraform code using the OCI Stack, leveraging its capabilities to simplify cloud infrastructure management.
Why we use OCI Stack
By using the OCI Stack, you can automate the deployment of complex cloud environments, ensuring consistency, repeatability, and scalability. This approach reduces the risk of human error, enhances efficiency, and provides a single source of truth for your cloud resources.
Steps to create Terraform code by using stack
- Login OCI console
- Create Compute Instance with the help of instance configuration.
Select the option “save as stack”, it will create a terraform code based on the instance configuration
- Configure variable: edit resource variable based on the requirement
- Review and create the stack for launching the instance
Define the needs by editing the stack variable
Eg: Create a resource Using Terraform Code in OCI Stack
- Access OCI Console: Log in and navigate to Resource Manager.
- Select the Stack: Open your created stack under Stacks.
- Review Terraform Code: Check the code defining your instance.
- Plan Execution: Click Terraform Actions > Plan to preview changes.
- Apply the Code: Select Terraform Actions > Apply to create the instance.
- Verify Creation: Check the Instances section in Compute to confirm.
- Manage Instance: Access and manage your instance as needed.
conclusion
Leveraging OCI Stack with Terraform simplifies and streamlines instance provisioning on Oracle Cloud. It ensures consistent, efficient, and automated management of your infrastructure, making scaling and maintenance easier.