terraform-ibm-modules / terraform-ibm-landing-zone-vsi

Creates virtual server instances (VSI) across multiple subnets with any number of block storage volumes that are connected by any number of load balancers
Apache License 2.0
4 stars 9 forks source link

We need the flexibility with landing-zone-vsi module to provision an instance in a dedicated host that belongs to the provided dedicated host group #747

Open nupurg-ibm opened 2 weeks ago

nupurg-ibm commented 2 weeks ago

Description

If I create the dedicated host by our code, I need to pass the value of dedicated host for the VSI's to join.. I see that the landing zone VSI will not support the attribute to join to the dedicated host -> https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vsi/blob/main/main.tf

We need the flexibility with landing-zone-vsi module to provision an instance in a dedicated host that belongs to the provided dedicated host group

Like : https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/is_instance

resource "ibm_is_instance" "example1" {
  name    = "example-instance-1"
  image   = ibm_is_image.example.id
  profile = "cx2-2x4"

  primary_network_interface {
    subnet          = ibm_is_subnet.example.id
    security_groups = [ibm_is_security_group.example.id]
  }
  dedicated_host = ibm_is_dedicated_host.example.id
  vpc            = ibm_is_vpc.example.id
  zone           = "us-south-1"
  keys           = [ibm_is_ssh_key.example.id]
  depends_on     = [ibm_is_security_group_rule.example3]

As you know if the value is not supported we see the below issue:

 Error: Unsupported argument
│ 
│   on ../../modules/landing_zone_vsi/main.tf line 79, in module "management_vsi":
│   79:   dedicated_host                = var.boot_volume_encryption_key
│ 
│ An argument named "dedicated_host" is not expected here.
╵
vburckhardt commented 4 days ago

Discussion/brainstorming on the call.

2 functions:

  1. Create VSIs on dedicated host or dedicated host group
    • VSI module is updated to take optionally dedicated host id / dedicated host group id
  2. Creating/managing dedicated host
    • New module to create dedicated host, create/manage dedicated host groups + all surrounding (storage management - ibm_is_dedicated_host_disk_management)

The landing zone DA acts a the "glue" between those functions - take additional input parameters: