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";
import pulumi
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
return await Deployment.RunAsync(() =>
{
});
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) {
}
}
{}
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());
}
}
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
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 string
- The unique name of the resource.
- args IsInstanceGroupManagerPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args IsInstanceGroupManagerPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IsInstanceGroupManagerPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var isInstanceGroupManagerPolicyResource = new IsInstanceGroupManagerPolicy("isInstanceGroupManagerPolicyResource", IsInstanceGroupManagerPolicyArgs.builder()
.instanceGroup("string")
.instanceGroupManager("string")
.metricType("string")
.metricValue(0)
.policyType("string")
.isInstanceGroupManagerPolicyId("string")
.name("string")
.build());
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")
const isInstanceGroupManagerPolicyResource = new ibm.IsInstanceGroupManagerPolicy("isInstanceGroupManagerPolicyResource", {
instanceGroup: "string",
instanceGroupManager: "string",
metricType: "string",
metricValue: 0,
policyType: "string",
isInstanceGroupManagerPolicyId: "string",
name: "string",
});
type: ibm:IsInstanceGroupManagerPolicy
properties:
instanceGroup: string
instanceGroupManager: string
isInstanceGroupManagerPolicyId: string
metricType: string
metricValue: 0
name: string
policyType: string
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:
- Instance
Group string - The instance group ID.
- Instance
Group stringManager - The instance group manager ID for policy creation.
- Metric
Type string - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - Metric
Value double - The metric value to evaluate.
- Policy
Type string - The type of metric to evaluate.
- Is
Instance stringGroup Manager Policy Id - (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 string - The instance group ID.
- Instance
Group stringManager - The instance group manager ID for policy creation.
- Metric
Type string - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - Metric
Value float64 - The metric value to evaluate.
- Policy
Type string - The type of metric to evaluate.
- Is
Instance stringGroup Manager Policy Id - (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 String - The instance group ID.
- instance
Group StringManager - The instance group manager ID for policy creation.
- metric
Type String - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - metric
Value Double - The metric value to evaluate.
- policy
Type String - The type of metric to evaluate.
- is
Instance StringGroup Manager Policy Id - (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 string - The instance group ID.
- instance
Group stringManager - The instance group manager ID for policy creation.
- metric
Type string - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - metric
Value number - The metric value to evaluate.
- policy
Type string - The type of metric to evaluate.
- is
Instance stringGroup Manager Policy Id - (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 str - The instance group ID.
- instance_
group_ strmanager - The instance group manager ID for policy creation.
- metric_
type str - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - metric_
value float - The metric value to evaluate.
- policy_
type str - The type of metric to evaluate.
- is_
instance_ strgroup_ manager_ policy_ id - (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.
- instance
Group String - The instance group ID.
- instance
Group StringManager - The instance group manager ID for policy creation.
- metric
Type String - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - metric
Value Number - The metric value to evaluate.
- policy
Type String - The type of metric to evaluate.
- is
Instance StringGroup Manager Policy Id - (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:
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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Instance
Group string - The instance group ID.
- Instance
Group stringManager - The instance group manager ID for policy creation.
- Is
Instance stringGroup Manager Policy Id - (String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
- Metric
Type string - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - Metric
Value double - The metric value to evaluate.
- Name string
- The name of the policy.
- Policy
Id string - (String) The policy ID.
- Policy
Type string - The type of metric to evaluate.
- Instance
Group string - The instance group ID.
- Instance
Group stringManager - The instance group manager ID for policy creation.
- Is
Instance stringGroup Manager Policy Id - (String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
- Metric
Type string - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - Metric
Value float64 - The metric value to evaluate.
- Name string
- The name of the policy.
- Policy
Id string - (String) The policy ID.
- Policy
Type string - The type of metric to evaluate.
- instance
Group String - The instance group ID.
- instance
Group StringManager - The instance group manager ID for policy creation.
- is
Instance StringGroup Manager Policy Id - (String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
- metric
Type String - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - metric
Value Double - The metric value to evaluate.
- name String
- The name of the policy.
- policy
Id String - (String) The policy ID.
- policy
Type String - The type of metric to evaluate.
- instance
Group string - The instance group ID.
- instance
Group stringManager - The instance group manager ID for policy creation.
- is
Instance stringGroup Manager Policy Id - (String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
- metric
Type string - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - metric
Value number - The metric value to evaluate.
- name string
- The name of the policy.
- policy
Id string - (String) The policy ID.
- policy
Type string - The type of metric to evaluate.
- instance_
group str - The instance group ID.
- instance_
group_ strmanager - The instance group manager ID for policy creation.
- is_
instance_ strgroup_ manager_ policy_ id - (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
, andnetwork_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.
- instance
Group String - The instance group ID.
- instance
Group StringManager - The instance group manager ID for policy creation.
- is
Instance StringGroup Manager Policy Id - (String) The ID in the combination of instance group ID, instance group manager ID, and instance group manager policy ID.
- metric
Type String - The type of metric to evaluate. The possible values for metric types are
cpu
,memory
,network_in
, andnetwork_out
. - metric
Value Number - The metric value to evaluate.
- name String
- The name of the policy.
- policy
Id String - (String) The policy ID.
- policy
Type 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
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.