Connect on-prem to VPC and PowerVS using Client to Site VPN.
The first step is to clone the repository and configure the terraform variables.
git clone https://github.com/cloud-design-dev/ibmcloud-vpc-tgw-per.git
cd ibmcloud-vpc-tgw-per
Copy the example terraform variables file and update the values with your own.
cp tfvars-template terraform.tfvars
Name | Description | Type | Default | Required |
---|---|---|---|---|
classic_access | Whether to enable classic access for the VPC | bool |
false |
no |
compute_base_image | The base image to use for the compute instance | string |
"ibm-ubuntu-22-04-4-minimal-amd64-4" |
no |
compute_instance_profile | The profile to use for the compute instance | string |
"cx2-2x4" |
no |
default_address_prefix | The default address prefix to use for the VPC | string |
"auto" |
no |
existing_resource_group | The name of an existing resource group where the VPC will be deployed | string |
"" |
no |
existing_secrets_manager_instance | The name of an existing Secrets Manager instance | string |
n/a | yes |
existing_ssh_key | Name of an existing SSH key in the region. | string |
"" |
no |
ibmcloud_api_key | The IBM Cloud API key needed to deploy the VPC | string |
n/a | yes |
ibmcloud_region | The IBM Cloud region where the VPC, Power, and related resources will be deployed | string |
"" |
no |
power_image_id | The ID of the PowerVS image to use for the PowerVS instance | string |
"264ab16d-e5d3-4817-8757-4f8a20ae87e5" |
no |
power_zone | The zone to deploy the PowerVS instance | string |
"dal12" |
no |
project_prefix | The prefix to use for naming resources. If not provided, a random string will be generated. | string |
"" |
no |
secrets_manager_region | Region where Secrets manager instance is provisioned | string |
"" |
no |
vpn_client_cidr | CIDR block for VPN clients | string |
"172.16.0.0/22" |
no |
vpn_users | n/a | list |
[] |
no |
Once you have the required variables set, you can initialize the terraform configuration and create a plan for the deployment.
terraform init
terraform plan -out=plan.out
If no errors are returned, you can apply the plan to create the VPCs, subnets, and compute instances.
terraform apply plan.out
When the provosion is complete, you should see the output of the plan, including the private IP addresses of the compute hosts in VPC and PowerVS.
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
power_instance_ip = "172.16.0.11"
power_network_id = "3475547c-14e5-4662-ba14-d84cdcc18ca0"
power_workspace_id = "65fd7bf6-1956-4161-b8e5-beebe7a732a8"
vpc_instance_ip = "10.240.0.4"