Provision the Resources
You can provision the resources by using either Terraform or Terragrunt. If you use Terraform, you must apply the configurations in each directory, in a prescribed sequence. With Terragrunt, you can provision all the resources with a single command.
About Terraform State Files
Terraform stores state information to track your managed infrastructure resources, map the deployed resources to your configuration, track metadata, and improve performance for large infrastructure deployments.
By default, the terraform.tfstate
file is stored on the local host. This default behavior is not optimal in IT environments where multiple users need to create and destroy the resources that are defined in a given configuration. To control deploying and managing resources in a multi-user environment, store the Terraform state files in Oracle Cloud
Infrastructure Object Storage, and share the state files and lock files between all the users. See Using the Object Store for Terraform State Files.
Provision the Resources Using Terragrunt
You can use Terragrunt to provision all the resources in the topology by using a single command. Internally, Terragrunt invokes Terraform commands and handles all the inter-resource dependencies defined in the configuration.
Provision the Resources Using Terraform
If you choose to provision the resources by using Terraform, then you must apply the Terraform configuration in each directory individually, in a prescribed sequence.
Modify the Topology
To modify the topology, you must update the resource definitions in the appropriate Terraform configurations, and then apply the revised configuration. Identifying the resource definitions that need to be modified requires a thorough understanding of the example code, specifically the Terraform modules referenced in each directory and the inter-module dependencies.
Remove All the Resources
You can remove all the deployed resources easily by using either Terraform or Terragrunt.
- Go to the
examples/full-deployment
directory. - Do one of the following:
- If you have Terragrunt installed, then run the following command:
terragrunt destroy-all
Terragrunt invokes the
terraform destroy
command for resources in the configuration, in a defined sequence.If you attempt to use
terragrunt destroy-all
to clean up a failed or partial deployment, then the following error might occur:Error: Unsupported attribute on management_rte_attachment.tf line 8, in module "management_rte_attachement": 8: data.terraform_remote_state.peering_servers.outputs.routing_instance_1_ip_id, |---------------- | data.terraform_remote_state.peering_servers.outputs is object with 3 attributes This object does not have an attribute named "routing_instance_1_ip_id".
If this error occurs, then remove the resources by running
terraform destroy
in each configuration directory, as described next. - To remove the resources by using the Terraform CLI, run
terraform destroy
in each configuration directory underexamples/full-deployment
, in the following order.Note:
Wait for the command to finish running in each directory before proceeding to the next directory.tenant/servers management/server_attachment management/servers peering/routing management/access tenant/network management/network peering/network common/compartments common/configuration
- If you have Terragrunt installed, then run the following command: