IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
342 stars 671 forks source link

ibm_is_instance_group with multi NIC instance_templates #3597

Closed bkoohi closed 2 years ago

bkoohi commented 2 years ago

Community Note

Question

I have an issue with using a multi nic instance_template to create an instance_group for auto-scaling feature in VPC. It generates an error that is at the end of this page.

New or Affected Resource(s) or Datasource(s)

Potential Terraform Configuration

resource "ibm_is_instance_template" "vnf_instance_template" { name = "vnf-instance-template" image = ibm_is_image.vnf_custom_image.id profile = "bx2-8x32" resource_group = data.ibm_resource_group.group.id

primary_network_interface { subnet = ibm_is_subnet.vnf_subnet[0].id security_groups = [ibm_is_security_group.pub_alb_security_group.id] allow_ip_spoofing = true } network_interfaces { name = "eth1" security_groups = [ibm_is_security_group.pub_alb_security_group.id] subnet = ibm_is_subnet.web_subnet[0].id allow_ip_spoofing = true }

vpc = ibm_is_vpc.vpc.id zone = "${var.region}-1" keys = [data.ibm_is_ssh_key.sshkey.id] user_data = var.enable_end_to_end_encryption ? file("./scripts/setup_vnf.sh") : file("./scripts/setup_vnf.sh" ) } resource "ibm_is_instance_group" "vnf_instance_group" { name = "${var.basename}-vnf-instance" instance_template = ibm_is_instance_template.vnf_instance_template.id instance_count = 1 subnets = [ibm_is_subnet.vnf_subnet[0].id,ibm_is_subnet.web_subnet[0].id]

load_balancer = ibm_is_lb.pub_alb.id

load_balancer_pool = element(split("/", ibm_is_lb_pool.pub_alb_pool.id), 1)

application_port = var.enable_end_to_end_encryption ? 443 : 80

resource_group = data.ibm_resource_group.group.id

depends_on = [ibm_is_lb_listener.pub_alb_listner, ibm_is_lb_pool.pub_alb_pool, ibm_is_lb.pub_alb]

//User can configure timeouts timeouts { create = "15m" delete = "15m" update = "10m" } }

resource "ibm_is_instance_group_manager" "vnf_instance_group_manager" { name = "${var.basename}-instance-group-manager" aggregation_window = 90 instance_group = ibm_is_instance_group.vnf_instance_group.id cooldown = 120 manager_type = "autoscale" enable_manager = true min_membership_count = 1 max_membership_count = 2 }

resource "ibm_is_instance_group_manager_policy" "cpuPolicy" { instance_group = ibm_is_instance_group.vnf_instance_group.id instance_group_manager = ibm_is_instance_group_manager.vnf_instance_group_manager.manager_id metric_type = "cpu" metric_value = 10 policy_type = "target" name = "${var.basename}-instance-group-manager-policy" }

Copy-paste your Terraform configurations here - for large Terraform configs,

please use a service like Dropbox and share a link to the ZIP file. For

security, you can also encrypt the files using our GPG public key.

References

astha-jain commented 2 years ago

good to close? FYI @deepaksibm

astha-jain commented 2 years ago

This feature is not supported in the Autoscale service at the moment. I'll close this issue now. Thanks.

hkantare commented 2 years ago

closing the issue based on above comments