From dc7b73a198f3c288fc809b8e413358b151a1c92f Mon Sep 17 00:00:00 2001 From: James Dubee Date: Fri, 4 Mar 2022 16:18:34 -0500 Subject: [PATCH] Add VSI validation (#4) * Add VSI validation * Update VSI template --- vsi-validation/main.tf | 24 ++++++++++++++++++++++++ vsi-validation/variables.tf | 34 ++++++++++++++++++++++++++++++++++ vsi-validation/versions.tf | 8 ++++++++ 3 files changed, 66 insertions(+) create mode 100644 vsi-validation/main.tf create mode 100644 vsi-validation/variables.tf create mode 100644 vsi-validation/versions.tf diff --git a/vsi-validation/main.tf b/vsi-validation/main.tf new file mode 100644 index 0000000..07f4b50 --- /dev/null +++ b/vsi-validation/main.tf @@ -0,0 +1,24 @@ +resource "ibm_is_instance" "validation_instance" { + name = var.vsi_instance_name + image = var.vsi_id + profile = var.vpc_profile + + primary_network_interface { + subnet = var.subnet_id + } + + network_interfaces { + name = "eth1" + subnet = var.subnet_id + } + + vpc = var.vpc_id + zone = var.subnet_zone + keys = [var.ssh_key_id] + + timeouts { + create = "15m" + update = "15m" + delete = "15m" + } +} \ No newline at end of file diff --git a/vsi-validation/variables.tf b/vsi-validation/variables.tf new file mode 100644 index 0000000..964d3c8 --- /dev/null +++ b/vsi-validation/variables.tf @@ -0,0 +1,34 @@ +variable "vsi_instance_name" { + description = "Name of the VSI instance to create" + type = string +} + +variable "vsi_id" { + description = "ID of VSI to deploy" + type = string +} + +variable "vpc_profile" { + description = "Profile of VPC" + type = string +} + +variable "subnet_id" { + description = "ID of subnet to provision with" + type = string +} + +variable "vpc_id" { + description = "ID of the VPC to deploy to" + type = string +} + +variable "subnet_zone" { + description = "Zone of the subnet" + type = string +} + +variable "ssh_key_id" { + description = "ID of SSH key to provision with" + type = string +} \ No newline at end of file diff --git a/vsi-validation/versions.tf b/vsi-validation/versions.tf new file mode 100644 index 0000000..0b1f324 --- /dev/null +++ b/vsi-validation/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + ibm = { + source = "IBM-Cloud/ibm" + version = "~> 1.39.0" + } + } +} \ No newline at end of file