1. Packages
  2. Ibm Provider
  3. API Docs
  4. IsInstanceGroupManagerPolicy
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.IsInstanceGroupManagerPolicy

Explore with Pulumi AI

Create, update or delete a policy of an instance group manager. For more information, about instance group manager policy, see creating an instance group for auto scaling.

Note: VPC infrastructure services are a regional specific based endpoint, by default targets to us-south. Please make sure to target right region in the provider block as shown in the provider.tf file, if VPC service is created in region other than us-south.

provider.tf

import * as pulumi from "@pulumi/pulumi";
Copy
import pulumi
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => 
{
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
    }
}
Copy
{}
Copy

Example Usage

In the following example, you can create a policy for instance group manager.

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IsVpc;
import com.pulumi.ibm.IsSubnet;
import com.pulumi.ibm.IsSubnetArgs;
import com.pulumi.ibm.IsSshKey;
import com.pulumi.ibm.IsSshKeyArgs;
import com.pulumi.ibm.IsInstanceTemplate;
import com.pulumi.ibm.IsInstanceTemplateArgs;
import com.pulumi.ibm.inputs.IsInstanceTemplatePrimaryNetworkInterfaceArgs;
import com.pulumi.ibm.IsInstanceGroup;
import com.pulumi.ibm.IsInstanceGroupArgs;
import com.pulumi.ibm.IsInstanceGroupManager;
import com.pulumi.ibm.IsInstanceGroupManagerArgs;
import com.pulumi.ibm.IsInstanceGroupManagerPolicy;
import com.pulumi.ibm.IsInstanceGroupManagerPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleIsVpc = new IsVpc("exampleIsVpc");

        var exampleIsSubnet = new IsSubnet("exampleIsSubnet", IsSubnetArgs.builder()
            .vpc(exampleIsVpc.isVpcId())
            .zone("us-south-2")
            .ipv4CidrBlock("10.240.64.0/28")
            .build());

        var exampleIsSshKey = new IsSshKey("exampleIsSshKey", IsSshKeyArgs.builder()
            .publicKey("SSH_KEY")
            .build());

        var exampleIsInstanceTemplate = new IsInstanceTemplate("exampleIsInstanceTemplate", IsInstanceTemplateArgs.builder()
            .image(ibm_is_image.example().id())
            .profile("bx2-8x32")
            .primaryNetworkInterface(IsInstanceTemplatePrimaryNetworkInterfaceArgs.builder()
                .subnet(exampleIsSubnet.isSubnetId())
                .build())
            .vpc(exampleIsVpc.isVpcId())
            .zone("us-south-2")
            .keys(exampleIsSshKey.isSshKeyId())
            .build());

        var exampleIsInstanceGroup = new IsInstanceGroup("exampleIsInstanceGroup", IsInstanceGroupArgs.builder()
            .instanceTemplate(exampleIsInstanceTemplate.isInstanceTemplateId())
            .instanceCount(2)
            .subnets(exampleIsSubnet.isSubnetId())
            .timeouts(IsInstanceGroupTimeoutsArgs.builder()
                .create("15m")
                .delete("15m")
                .update("10m")
                .build())
            .build());

        var exampleIsInstanceGroupManager = new IsInstanceGroupManager("exampleIsInstanceGroupManager", IsInstanceGroupManagerArgs.builder()
            .aggregationWindow(120)
            .instanceGroup(exampleIsInstanceGroup.isInstanceGroupId())
            .cooldown(300)
            .managerType("autoscale")
            .enableManager(true)
            .maxMembershipCount(2)
            .minMembershipCount(1)
            .build());

        var exampleIsInstanceGroupManagerPolicy = new IsInstanceGroupManagerPolicy("exampleIsInstanceGroupManagerPolicy", IsInstanceGroupManagerPolicyArgs.builder()
            .instanceGroup(exampleIsInstanceGroup.isInstanceGroupId())
            .instanceGroupManager(exampleIsInstanceGroupManager.managerId())
            .metricType("cpu")
            .metricValue(70)
            .policyType("target")
            .build());

    }
}
Copy
resources:
  exampleIsVpc:
    type: ibm:IsVpc
  exampleIsSubnet:
    type: ibm:IsSubnet
    properties:
      vpc: ${exampleIsVpc.isVpcId}
      zone: us-south-2
      ipv4CidrBlock: 10.240.64.0/28
  exampleIsSshKey:
    type: ibm:IsSshKey
    properties:
      publicKey: SSH_KEY
  exampleIsInstanceTemplate:
    type: ibm:IsInstanceTemplate
    properties:
      image: ${ibm_is_image.example.id}
      profile: bx2-8x32
      primaryNetworkInterface:
        subnet: ${exampleIsSubnet.isSubnetId}
      vpc: ${exampleIsVpc.isVpcId}
      zone: us-south-2
      keys:
        - ${exampleIsSshKey.isSshKeyId}
  exampleIsInstanceGroup:
    type: ibm:IsInstanceGroup
    properties:
      instanceTemplate: ${exampleIsInstanceTemplate.isInstanceTemplateId}
      instanceCount: 2
      subnets:
        - ${exampleIsSubnet.isSubnetId}
      # User can configure timeouts
      timeouts:
        - create: 15m
          delete: 15m
          update: 10m
  exampleIsInstanceGroupManager:
    type: ibm:IsInstanceGroupManager
    properties:
      aggregationWindow: 120
      instanceGroup: ${exampleIsInstanceGroup.isInstanceGroupId}
      cooldown: 300
      managerType: autoscale
      enableManager: true
      maxMembershipCount: 2
      minMembershipCount: 1
  exampleIsInstanceGroupManagerPolicy:
    type: ibm:IsInstanceGroupManagerPolicy
    properties:
      instanceGroup: ${exampleIsInstanceGroup.isInstanceGroupId}
      instanceGroupManager: ${exampleIsInstanceGroupManager.managerId}
      metricType: cpu
      metricValue: 70
      policyType: target
Copy

Create IsInstanceGroupManagerPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new IsInstanceGroupManagerPolicy(name: string, args: IsInstanceGroupManagerPolicyArgs, opts?: CustomResourceOptions);
@overload
def IsInstanceGroupManagerPolicy(resource_name: str,
                                 args: IsInstanceGroupManagerPolicyArgs,
                                 opts: Optional[ResourceOptions] = None)

@overload
def IsInstanceGroupManagerPolicy(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 instance_group: Optional[str] = None,
                                 instance_group_manager: Optional[str] = None,
                                 metric_type: Optional[str] = None,
                                 metric_value: Optional[float] = None,
                                 policy_type: Optional[str] = None,
                                 is_instance_group_manager_policy_id: Optional[str] = None,
                                 name: Optional[str] = None)
func NewIsInstanceGroupManagerPolicy(ctx *Context, name string, args IsInstanceGroupManagerPolicyArgs, opts ...ResourceOption) (*IsInstanceGroupManagerPolicy, error)
public IsInstanceGroupManagerPolicy(string name, IsInstanceGroupManagerPolicyArgs args, CustomResourceOptions? opts = null)
public IsInstanceGroupManagerPolicy(String name, IsInstanceGroupManagerPolicyArgs args)
public IsInstanceGroupManagerPolicy(String name, IsInstanceGroupManagerPolicyArgs args, CustomResourceOptions options)
type: ibm:IsInstanceGroupManagerPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. IsInstanceGroupManagerPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. IsInstanceGroupManagerPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. IsInstanceGroupManagerPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. IsInstanceGroupManagerPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. IsInstanceGroupManagerPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var isInstanceGroupManagerPolicyResource = new Ibm.IsInstanceGroupManagerPolicy("isInstanceGroupManagerPolicyResource", new()
{
    InstanceGroup = "string",
    InstanceGroupManager = "string",
    MetricType = "string",
    MetricValue = 0,
    PolicyType = "string",
    IsInstanceGroupManagerPolicyId = "string",
    Name = "string",
});
Copy
example, err := ibm.NewIsInstanceGroupManagerPolicy(ctx, "isInstanceGroupManagerPolicyResource", &ibm.IsInstanceGroupManagerPolicyArgs{
	InstanceGroup:                  pulumi.String("string"),
	InstanceGroupManager:           pulumi.String("string"),
	MetricType:                     pulumi.String("string"),
	MetricValue:                    pulumi.Float64(0),
	PolicyType:                     pulumi.String("string"),
	IsInstanceGroupManagerPolicyId: pulumi.String("string"),
	Name:                           pulumi.String("string"),
})
Copy
var isInstanceGroupManagerPolicyResource = new IsInstanceGroupManagerPolicy("isInstanceGroupManagerPolicyResource", IsInstanceGroupManagerPolicyArgs.builder()
    .instanceGroup("string")
    .instanceGroupManager("string")
    .metricType("string")
    .metricValue(0)
    .policyType("string")
    .isInstanceGroupManagerPolicyId("string")
    .name("string")
    .build());
Copy
is_instance_group_manager_policy_resource = ibm.IsInstanceGroupManagerPolicy("isInstanceGroupManagerPolicyResource",
    instance_group="string",
    instance_group_manager="string",
    metric_type="string",
    metric_value=0,
    policy_type="string",
    is_instance_group_manager_policy_id="string",
    name="string")
Copy
const isInstanceGroupManagerPolicyResource = new ibm.IsInstanceGroupManagerPolicy("isInstanceGroupManagerPolicyResource", {
    instanceGroup: "string",
    instanceGroupManager: "string",
    metricType: "string",
    metricValue: 0,
    policyType: "string",
    isInstanceGroupManagerPolicyId: "string",
    name: "string",
});
Copy
type: ibm:IsInstanceGroupManagerPolicy
properties:
    instanceGroup: string
    instanceGroupManager: string
    isInstanceGroupManagerPolicyId: string
    metricType: string
    metricValue: 0
    name: string
    policyType: string
Copy

IsInstanceGroupManagerPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The IsInstanceGroupManagerPolicy resource accepts the following input properties:

InstanceGroup This property is required. string
The instance group ID.
InstanceGroupManager This property is required. string
The instance group manager ID for policy creation.
MetricType This property is required. string
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
MetricValue This property is required. double
The metric value to evaluate.
PolicyType This property is required. string
The type of metric to evaluate.
IsInstanceGroupManagerPolicyId string
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
Name string
The name of the policy.
InstanceGroup This property is required. string
The instance group ID.
InstanceGroupManager This property is required. string
The instance group manager ID for policy creation.
MetricType This property is required. string
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
MetricValue This property is required. float64
The metric value to evaluate.
PolicyType This property is required. string
The type of metric to evaluate.
IsInstanceGroupManagerPolicyId string
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
Name string
The name of the policy.
instanceGroup This property is required. String
The instance group ID.
instanceGroupManager This property is required. String
The instance group manager ID for policy creation.
metricType This property is required. String
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metricValue This property is required. Double
The metric value to evaluate.
policyType This property is required. String
The type of metric to evaluate.
isInstanceGroupManagerPolicyId String
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
name String
The name of the policy.
instanceGroup This property is required. string
The instance group ID.
instanceGroupManager This property is required. string
The instance group manager ID for policy creation.
metricType This property is required. string
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metricValue This property is required. number
The metric value to evaluate.
policyType This property is required. string
The type of metric to evaluate.
isInstanceGroupManagerPolicyId string
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
name string
The name of the policy.
instance_group This property is required. str
The instance group ID.
instance_group_manager This property is required. str
The instance group manager ID for policy creation.
metric_type This property is required. str
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metric_value This property is required. float
The metric value to evaluate.
policy_type This property is required. str
The type of metric to evaluate.
is_instance_group_manager_policy_id str
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
name str
The name of the policy.
instanceGroup This property is required. String
The instance group ID.
instanceGroupManager This property is required. String
The instance group manager ID for policy creation.
metricType This property is required. String
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metricValue This property is required. Number
The metric value to evaluate.
policyType This property is required. String
The type of metric to evaluate.
isInstanceGroupManagerPolicyId String
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
name String
The name of the policy.

Outputs

All input properties are implicitly available as output properties. Additionally, the IsInstanceGroupManagerPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
PolicyId string
(String) The policy ID.
Id string
The provider-assigned unique ID for this managed resource.
PolicyId string
(String) The policy ID.
id String
The provider-assigned unique ID for this managed resource.
policyId String
(String) The policy ID.
id string
The provider-assigned unique ID for this managed resource.
policyId string
(String) The policy ID.
id str
The provider-assigned unique ID for this managed resource.
policy_id str
(String) The policy ID.
id String
The provider-assigned unique ID for this managed resource.
policyId String
(String) The policy ID.

Look up Existing IsInstanceGroupManagerPolicy Resource

Get an existing IsInstanceGroupManagerPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: IsInstanceGroupManagerPolicyState, opts?: CustomResourceOptions): IsInstanceGroupManagerPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        instance_group: Optional[str] = None,
        instance_group_manager: Optional[str] = None,
        is_instance_group_manager_policy_id: Optional[str] = None,
        metric_type: Optional[str] = None,
        metric_value: Optional[float] = None,
        name: Optional[str] = None,
        policy_id: Optional[str] = None,
        policy_type: Optional[str] = None) -> IsInstanceGroupManagerPolicy
func GetIsInstanceGroupManagerPolicy(ctx *Context, name string, id IDInput, state *IsInstanceGroupManagerPolicyState, opts ...ResourceOption) (*IsInstanceGroupManagerPolicy, error)
public static IsInstanceGroupManagerPolicy Get(string name, Input<string> id, IsInstanceGroupManagerPolicyState? state, CustomResourceOptions? opts = null)
public static IsInstanceGroupManagerPolicy get(String name, Output<String> id, IsInstanceGroupManagerPolicyState state, CustomResourceOptions options)
resources:  _:    type: ibm:IsInstanceGroupManagerPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
InstanceGroup string
The instance group ID.
InstanceGroupManager string
The instance group manager ID for policy creation.
IsInstanceGroupManagerPolicyId string
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
MetricType string
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
MetricValue double
The metric value to evaluate.
Name string
The name of the policy.
PolicyId string
(String) The policy ID.
PolicyType string
The type of metric to evaluate.
InstanceGroup string
The instance group ID.
InstanceGroupManager string
The instance group manager ID for policy creation.
IsInstanceGroupManagerPolicyId string
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
MetricType string
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
MetricValue float64
The metric value to evaluate.
Name string
The name of the policy.
PolicyId string
(String) The policy ID.
PolicyType string
The type of metric to evaluate.
instanceGroup String
The instance group ID.
instanceGroupManager String
The instance group manager ID for policy creation.
isInstanceGroupManagerPolicyId String
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
metricType String
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metricValue Double
The metric value to evaluate.
name String
The name of the policy.
policyId String
(String) The policy ID.
policyType String
The type of metric to evaluate.
instanceGroup string
The instance group ID.
instanceGroupManager string
The instance group manager ID for policy creation.
isInstanceGroupManagerPolicyId string
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
metricType string
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metricValue number
The metric value to evaluate.
name string
The name of the policy.
policyId string
(String) The policy ID.
policyType string
The type of metric to evaluate.
instance_group str
The instance group ID.
instance_group_manager str
The instance group manager ID for policy creation.
is_instance_group_manager_policy_id str
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
metric_type str
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metric_value float
The metric value to evaluate.
name str
The name of the policy.
policy_id str
(String) The policy ID.
policy_type str
The type of metric to evaluate.
instanceGroup String
The instance group ID.
instanceGroupManager String
The instance group manager ID for policy creation.
isInstanceGroupManagerPolicyId String
(String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
metricType String
The type of metric to evaluate. The possible values for metric types are cpu, memory, network_in, and network_out.
metricValue Number
The metric value to evaluate.
name String
The name of the policy.
policyId String
(String) The policy ID.
policyType String
The type of metric to evaluate.

Import

The ibm_is_instance_group_manager_policy resource can be imported by using instance group ID, instance group manager ID and instance group manager policy ID.

Example

$ pulumi import ibm:index/isInstanceGroupManagerPolicy:IsInstanceGroupManagerPolicy policy r006-eea6b0b7-babd-47a8-82c5-ad73d1e10bef/r006-160b9a68-58c8-4ec3-84b0-ad553ccb1e5a/r006-94d99d1d-be65-4939-9006-1a1a767245b5
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
ibm ibm-cloud/terraform-provider-ibm
License
Notes
This Pulumi package is based on the ibm Terraform Provider.