You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This logic creates a VSI to an existing landing zone VPC.
3
+
This architecture creates virtual server instances (VSI) for VPC in some or all of the subnets of any existing landing zone VPC deployable architecture.
4
4
5
-
This code creates and configures the following infrastructure:
6
-
- Adds an SSH key to IBM Cloud or uses an existing one.
7
-
- Adds a VSI in each subnet of the landing zone VPC.
5
+
## Before you begin
8
6
9
-
There are two ways through which a user can pass the VPC details for deploying the VSI, both the approaches are mutually exclusive.
7
+
- You must have either the [VPC landing zone](https://cloud.ibm.com/catalog/architecture/deploy-arch-ibm-slz-vpc-9fc0fa64-27af-4fed-9dce-47b3640ba739-global) or [Red Hat OpenShift Container Platform on VPC landing zone](https://cloud.ibm.com/catalog/architecture/deploy-arch-ibm-slz-ocp-95fccffc-ae3b-42df-b6d9-80be5914d852-global) deployable architecture deployed.
8
+
- The block storage to KMS auth policy must exist. This policy would have been created by one of the above deployable architectures if the `add_kms_block_storage_s2s` variable was set to `true`, which is default value.
9
+
- You need the VPC ID, subnet names, and boot volume encryption key from your existing landing zone VPC deployable architecture. For information about finding these values, see [Adding a VSI to your VPC landing zone deployable architecture](https://cloud.ibm.com/docs/secure-infrastructure-vpc?topic=secure-infrastructure-vpc-ext-with-vsi).
10
10
11
-
## Using `vpc_id`
12
-
13
-
The VPC ID of the landing zone VPC can be assigned to the variable vpc_id in order to create a VSI within that specific VPC.
14
-
15
-
## Using `prerequisite_workspace_id` and `existing_vpc_name`
16
-
17
-
The user can specify the workspace ID associated with the deployment of the landing zone VPC when creating a new VSI.
18
-
19
-
Follow these steps to get the schematics workspace ID.
20
-
21
-
1. Click the Navigation menu icon, and then click Schematics > Workspaces.
22
-
1. Select the Workspace that is associated with landing zone VPC.
23
-
1. Click the Settings.
24
-
1. In the Details section, you can find the Workspace ID.
25
-
26
-
Pass the Workspace ID to the `prerequisite_workspace_id` variable and pass the name of the VPC to the `existing_vpc_name` to choosse the name of the VPC to which the user wants to deploy the VSI.
27
-
Please provide the Workspace ID for the prerequisite workspace and the name of the existing VPC to the `prerequisite_workspace_id` and `existing_vpc_name` variables respectively, to identify the VPC where you want to deploy the VSI.
11
+

validate_vpc_vars=var.prerequisite_workspace_id==null&& var.vpc_id==null?tobool("var.prerequisite_workspace_id and var.vpc_id cannot be both set to null.") :true
8
-
# tflint-ignore: terraform_unused_declarations
9
-
validate_vpc_names=var.prerequisite_workspace_id!=null&& var.existing_vpc_name==null?tobool("A value must be passed for var.existing_vpc_name to choose a VPC from the list of VPCs from the schematics workspace.") :true
Copy file name to clipboardExpand all lines: patterns/vsi-extension/variables.tf
+25-48Lines changed: 25 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
variable"ibmcloud_api_key" {
2
-
description="The API key that's associated with the account to provision resources to"
2
+
description="The API key that's associated with the account to provision resources to."
3
3
type=string
4
4
sensitive=true
5
5
}
@@ -16,20 +16,19 @@ variable "prefix" {
16
16
}
17
17
18
18
variable"vpc_id" {
19
-
description="The ID of the VPC where the VSI will be created."
19
+
description="The ID of the VPC where you want to deploy the VSI. [Learn more](https://cloud.ibm.com/docs/secure-infrastructure-vpc?topic=secure-infrastructure-vpc-ext-with-vsi)."
20
20
type=string
21
-
default=null
22
21
}
23
22
24
23
variable"existing_ssh_key_name" {
25
-
description="The ID of the VPC where the VSI will be created."
24
+
description="The name of a public SSH key in the region where you want to deploy the VSI. [Learn more](https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys). To create an SSH key, use the 'ssh_public_key' input instead."
26
25
type=string
27
26
default=null
28
27
}
29
28
30
29
31
30
variable"ssh_public_key" {
32
-
description="SSH keys to use to provision a VSI. Must be an RSA key with a key size of either 2048 bits or 4096 bits (recommended). If `public_key` is not provided, the named key will be looked up from data. See https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys."
31
+
description="A public SSH key that does not exist in the region where you want to deploy the VSI. The key must be an RSA key with a key size of either 2048 bits or 4096 bits (recommended). [Learn more](https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys). To use an existing key, specify a value in the `existing_ssh_key_name` input instead."
33
32
type=string
34
33
35
34
validation {
@@ -39,75 +38,65 @@ variable "ssh_public_key" {
39
38
}
40
39
41
40
variable"resource_tags" {
42
-
description="A list of tags to add to the VSI, block storage, security group, floating IP, and load balancer created by the module."
41
+
description="A list of resource tags to apply to resources created by this solution."
43
42
type=list(string)
44
43
default=[]
45
44
}
46
45
47
46
variable"access_tags" {
48
47
type=list(string)
49
-
description="A list of access tags to apply to the VSI resources created by the module."
48
+
description="A list of access tags to apply to the VSI resources created by this solution."
50
49
default=[]
51
50
}
52
51
53
52
variable"image_name" {
54
-
description="Image ID used for the VSI. Run the 'ibmcloud is images' CLI command to find available images. The IDs are different in each region."
53
+
description="The image ID used for the VSI. You can run the `ibmcloud is images` CLI command to find available images. The IDs are different in each region."
55
54
type=string
56
-
default="ibm-ubuntu-22-04-2-minimal-amd64-1"
55
+
default="ibm-ubuntu-22-04-3-minimal-amd64-1"
57
56
}
58
57
59
-
variable"machine_type" {
60
-
description="VSI machine type"
58
+
variable"vsi_instance_profile" {
59
+
description="The VSI image profile. You can run the `ibmcloud is instance-profiles` CLI command to see available image profiles."
61
60
type=string
62
-
default="cx2-2x4"
61
+
default="cx2-4x8"
63
62
}
64
63
65
64
variable"user_data" {
66
-
description="User data to initialize VSI deployment."
65
+
description="The user data to transfer to the instance. [Learn more](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data)."
67
66
type=string
68
67
default=null
69
68
}
70
69
71
70
variable"boot_volume_encryption_key" {
72
-
description="The CRN of the boot volume encryption key."
71
+
description="The CRN of the boot volume encryption key. [Learn more](https://cloud.ibm.com/docs/secure-infrastructure-vpc?topic=secure-infrastructure-vpc-ext-with-vsi)."
73
72
type=string
74
73
}
75
74
76
-
variable"existing_kms_instance_guid" {
77
-
description="The GUID of the KMS instance that holds the key specified in `var.boot_volume_encryption_key`."
78
-
type=string
79
-
}
80
-
81
-
variable"skip_iam_authorization_policy" {
82
-
type=bool
83
-
description="By default (true), the Landing Zone VPC creates an IAM authorization policy that permits all storage blocks to read the encryption key from the KMS instance. Set to false to create the authorization policy in a different KMS instance, and specify the GUID of the KMS instance in the existing_kms_instance_guid variable."
84
-
default=true
85
-
}
86
-
87
75
variable"vsi_per_subnet" {
88
-
description="The number of VSI instances for each subnet."
76
+
description="The number of virtual servers to create on each VSI subnet."
89
77
type=number
90
78
default=1
91
79
}
92
80
93
81
variable"subnet_names" {
94
-
description="The subnets to deploy the VSI instances to."
82
+
description="A list of subnet names where you want to deploy a VSI. If not specified, the VSI is deployed to all the subnets in the VPC. [Learn more](https://cloud.ibm.com/docs/secure-infrastructure-vpc?topic=secure-infrastructure-vpc-ext-with-vsi)."
95
83
type=list(string)
96
-
default=[
97
-
"vpe-zone-1",
98
-
"vpe-zone-2",
99
-
"vpe-zone-3"
100
-
]
84
+
default=null
85
+
86
+
validation {
87
+
error_message="subnet_names cannot be an empty list."
description="IDs of additional security groups to add to the VSI deployment primary interface. A VSI interface can have a maximum of 5 securitygroups."
93
+
description="The IDs of additional security groups to add to the VSI primary network interface (5 or fewer). [Learn more](https://cloud.ibm.com/docs/vpc?topic=vpc-using-security-groups)."
105
94
type=list(string)
106
95
default=[]
107
96
}
108
97
109
98
variable"block_storage_volumes" {
110
-
description="The list of block storage volumes to attach to each VSI."
99
+
description="The list of block storage volumes to attach to each VSI. [Learn more](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-block-storage&interface=ui#create-from-vsi)."
description="Set to `true` to create a floating IP for each virtual server."
113
+
description="Whether to create a floating IP for each virtual server."
125
114
type=bool
126
115
default=false
127
116
}
128
117
129
118
variable"placement_group_id" {
130
-
description="Unique Identifier of the Placement Group for restricting the placement of the instance, default behaviour is placement on any host"
119
+
description="Unique ID of the Placement Group for restricting the placement of the instance. If not specified (the default), the VSI are placed on any host. [Learn more](https://cloud.ibm.com/docs/vpc?topic=vpc-about-placement-groups-for-vpc)."
131
120
type=string
132
121
default=null
133
122
}
@@ -183,15 +172,3 @@ variable "load_balancers" {
183
172
)
184
173
default=[]
185
174
}
186
-
187
-
variable"prerequisite_workspace_id" {
188
-
type=string
189
-
description="IBM Cloud Schematics workspace ID of the prerequisite IBM VPC landing zone. If you do not have an existing deployment yet, create a new architecture using the same catalog tile."
190
-
default=null
191
-
}
192
-
193
-
variable"existing_vpc_name" {
194
-
type=string
195
-
description="Name of the VPC to be used for deploying the VSI from the list of VPCs retrived from the IBM Cloud Schematics workspace."
0 commit comments