Lesson1 – Hands-on – Terraform/OpenTofu Deployment
In part 2 of this hands-on session, we will focus on using OpenTofu to execute and manage the Terraform configuration for deploying a single webserver on Oracle Cloud Infrastructure (OCI). The steps in this section include:
- Planning the Deployment:
- Use the tofu plan command to validate the Terraform configuration and preview the changes that will be applied to the OCI environment.
- Ensure that all configurations are correct and ready for deployment.
- Applying the Configuration:
- Execute the tofu apply command to deploy the defined infrastructure to OCI.
- Monitor the provisioning of resources, including the webserver instance, networking components, and security settings.
- Verifying the Deployment:
- Log in to the OCI Console to confirm that the resources have been successfully created.
- Verify the connectivity and functionality of the deployed webserver.
- Cleaning Up with Tofu Destroy:
- Use the tofu destroy command to safely and efficiently delete all resources created during the deployment.
- Ensure that the environment is clean and no unnecessary resources remain in the OCI account.
This part provides hands-on experience with OpenTofu’s lifecycle commands, emphasizing both automation and best practices for managing OCI resources.

