This Terraform configuration provisions a VPC in IBM Cloud with subnets, gateways, and compute instances using the provided variables.
Below is a quick reference for the variables in custom.tfvars
: (Note: all variables are required)
ibmcloud_api_key
: IBM Cloud API key with VPC permissionsvpc_name
: Name for your VPCvsi_name
: Name for the VSIrhel_image
: RHEL image name or IDworkstation_public_ip
: Your workstation’s public IP in CIDR formatcreate_vpc
: Set to true if you want Terraform to create a new VPCexisting_vpc_id
: Provide an existing VPC ID if not creating a new onessh_private_key
: SSH private key for accessing the VSI
- Create a new variable file called
custom.tfvars
- Update the variables in
custom.tfvars
to match your environment. - Run:
terraform init
terraform plan --var-file=custom.tfvars
terraform apply --var-file=custom.tfvars
- Wait for the resources to be provisioned in your IBM Cloud account.