1. Packages
  2. Ibm Provider
  3. API Docs
  4. PiPlacementGroup
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.PiPlacementGroup

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create or delete a placement group.

    Example Usage

    The following example enables you to create a placement group with a group policy of affinity:

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const testaccPlacementGroup = new ibm.PiPlacementGroup("testaccPlacementGroup", {
        piCloudInstanceId: "<value of the cloud_instance_id>",
        piPlacementGroupName: "my_pg",
        piPlacementGroupPolicy: "affinity",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    testacc_placement_group = ibm.PiPlacementGroup("testaccPlacementGroup",
        pi_cloud_instance_id="<value of the cloud_instance_id>",
        pi_placement_group_name="my_pg",
        pi_placement_group_policy="affinity")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewPiPlacementGroup(ctx, "testaccPlacementGroup", &ibm.PiPlacementGroupArgs{
    			PiCloudInstanceId:      pulumi.String("<value of the cloud_instance_id>"),
    			PiPlacementGroupName:   pulumi.String("my_pg"),
    			PiPlacementGroupPolicy: pulumi.String("affinity"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var testaccPlacementGroup = new Ibm.PiPlacementGroup("testaccPlacementGroup", new()
        {
            PiCloudInstanceId = "<value of the cloud_instance_id>",
            PiPlacementGroupName = "my_pg",
            PiPlacementGroupPolicy = "affinity",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.PiPlacementGroup;
    import com.pulumi.ibm.PiPlacementGroupArgs;
    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 testaccPlacementGroup = new PiPlacementGroup("testaccPlacementGroup", PiPlacementGroupArgs.builder()
                .piCloudInstanceId("<value of the cloud_instance_id>")
                .piPlacementGroupName("my_pg")
                .piPlacementGroupPolicy("affinity")
                .build());
    
        }
    }
    
    resources:
      testaccPlacementGroup:
        type: ibm:PiPlacementGroup
        properties:
          piCloudInstanceId: <value of the cloud_instance_id>
          piPlacementGroupName: my_pg
          piPlacementGroupPolicy: affinity
    

    Notes

    • Please find supported Regions for endpoints.
    • If a Power cloud instance is provisioned at lon04, The provider level attributes should be as follows:
      • region - lon
      • zone - lon04

    Example usage:

    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) {
        }
    }
    
    {}
    

    Create PiPlacementGroup Resource

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

    Constructor syntax

    new PiPlacementGroup(name: string, args: PiPlacementGroupArgs, opts?: CustomResourceOptions);
    @overload
    def PiPlacementGroup(resource_name: str,
                         args: PiPlacementGroupArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def PiPlacementGroup(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         pi_cloud_instance_id: Optional[str] = None,
                         pi_placement_group_name: Optional[str] = None,
                         pi_placement_group_policy: Optional[str] = None,
                         pi_placement_group_id: Optional[str] = None,
                         timeouts: Optional[PiPlacementGroupTimeoutsArgs] = None)
    func NewPiPlacementGroup(ctx *Context, name string, args PiPlacementGroupArgs, opts ...ResourceOption) (*PiPlacementGroup, error)
    public PiPlacementGroup(string name, PiPlacementGroupArgs args, CustomResourceOptions? opts = null)
    public PiPlacementGroup(String name, PiPlacementGroupArgs args)
    public PiPlacementGroup(String name, PiPlacementGroupArgs args, CustomResourceOptions options)
    
    type: ibm:PiPlacementGroup
    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 PiPlacementGroupArgs
    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 PiPlacementGroupArgs
    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 PiPlacementGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PiPlacementGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PiPlacementGroupArgs
    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 piPlacementGroupResource = new Ibm.PiPlacementGroup("piPlacementGroupResource", new()
    {
        PiCloudInstanceId = "string",
        PiPlacementGroupName = "string",
        PiPlacementGroupPolicy = "string",
        PiPlacementGroupId = "string",
        Timeouts = new Ibm.Inputs.PiPlacementGroupTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ibm.NewPiPlacementGroup(ctx, "piPlacementGroupResource", &ibm.PiPlacementGroupArgs{
    	PiCloudInstanceId:      pulumi.String("string"),
    	PiPlacementGroupName:   pulumi.String("string"),
    	PiPlacementGroupPolicy: pulumi.String("string"),
    	PiPlacementGroupId:     pulumi.String("string"),
    	Timeouts: &ibm.PiPlacementGroupTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var piPlacementGroupResource = new PiPlacementGroup("piPlacementGroupResource", PiPlacementGroupArgs.builder()
        .piCloudInstanceId("string")
        .piPlacementGroupName("string")
        .piPlacementGroupPolicy("string")
        .piPlacementGroupId("string")
        .timeouts(PiPlacementGroupTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    pi_placement_group_resource = ibm.PiPlacementGroup("piPlacementGroupResource",
        pi_cloud_instance_id="string",
        pi_placement_group_name="string",
        pi_placement_group_policy="string",
        pi_placement_group_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const piPlacementGroupResource = new ibm.PiPlacementGroup("piPlacementGroupResource", {
        piCloudInstanceId: "string",
        piPlacementGroupName: "string",
        piPlacementGroupPolicy: "string",
        piPlacementGroupId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: ibm:PiPlacementGroup
    properties:
        piCloudInstanceId: string
        piPlacementGroupId: string
        piPlacementGroupName: string
        piPlacementGroupPolicy: string
        timeouts:
            create: string
            delete: string
            update: string
    

    PiPlacementGroup 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 PiPlacementGroup resource accepts the following input properties:

    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiPlacementGroupName string
    The name of the placement group.
    PiPlacementGroupPolicy string
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    PiPlacementGroupId string
    (String) The unique identifier of the placement group.
    Timeouts PiPlacementGroupTimeouts
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiPlacementGroupName string
    The name of the placement group.
    PiPlacementGroupPolicy string
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    PiPlacementGroupId string
    (String) The unique identifier of the placement group.
    Timeouts PiPlacementGroupTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piPlacementGroupName String
    The name of the placement group.
    piPlacementGroupPolicy String
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    piPlacementGroupId String
    (String) The unique identifier of the placement group.
    timeouts PiPlacementGroupTimeouts
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piPlacementGroupName string
    The name of the placement group.
    piPlacementGroupPolicy string
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    piPlacementGroupId string
    (String) The unique identifier of the placement group.
    timeouts PiPlacementGroupTimeouts
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_placement_group_name str
    The name of the placement group.
    pi_placement_group_policy str
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    pi_placement_group_id str
    (String) The unique identifier of the placement group.
    timeouts PiPlacementGroupTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piPlacementGroupName String
    The name of the placement group.
    piPlacementGroupPolicy String
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    piPlacementGroupId String
    (String) The unique identifier of the placement group.
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Members List<string>
    (List of strings) The list of server instances IDs that are members of the placement group.
    PlacementGroupId string
    (String) The placement group ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    Members []string
    (List of strings) The list of server instances IDs that are members of the placement group.
    PlacementGroupId string
    (String) The placement group ID.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<String>
    (List of strings) The list of server instances IDs that are members of the placement group.
    placementGroupId String
    (String) The placement group ID.
    id string
    The provider-assigned unique ID for this managed resource.
    members string[]
    (List of strings) The list of server instances IDs that are members of the placement group.
    placementGroupId string
    (String) The placement group ID.
    id str
    The provider-assigned unique ID for this managed resource.
    members Sequence[str]
    (List of strings) The list of server instances IDs that are members of the placement group.
    placement_group_id str
    (String) The placement group ID.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<String>
    (List of strings) The list of server instances IDs that are members of the placement group.
    placementGroupId String
    (String) The placement group ID.

    Look up Existing PiPlacementGroup Resource

    Get an existing PiPlacementGroup 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?: PiPlacementGroupState, opts?: CustomResourceOptions): PiPlacementGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            members: Optional[Sequence[str]] = None,
            pi_cloud_instance_id: Optional[str] = None,
            pi_placement_group_id: Optional[str] = None,
            pi_placement_group_name: Optional[str] = None,
            pi_placement_group_policy: Optional[str] = None,
            placement_group_id: Optional[str] = None,
            timeouts: Optional[PiPlacementGroupTimeoutsArgs] = None) -> PiPlacementGroup
    func GetPiPlacementGroup(ctx *Context, name string, id IDInput, state *PiPlacementGroupState, opts ...ResourceOption) (*PiPlacementGroup, error)
    public static PiPlacementGroup Get(string name, Input<string> id, PiPlacementGroupState? state, CustomResourceOptions? opts = null)
    public static PiPlacementGroup get(String name, Output<String> id, PiPlacementGroupState state, CustomResourceOptions options)
    resources:  _:    type: ibm:PiPlacementGroup    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.
    The following state arguments are supported:
    Members List<string>
    (List of strings) The list of server instances IDs that are members of the placement group.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiPlacementGroupId string
    (String) The unique identifier of the placement group.
    PiPlacementGroupName string
    The name of the placement group.
    PiPlacementGroupPolicy string
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    PlacementGroupId string
    (String) The placement group ID.
    Timeouts PiPlacementGroupTimeouts
    Members []string
    (List of strings) The list of server instances IDs that are members of the placement group.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiPlacementGroupId string
    (String) The unique identifier of the placement group.
    PiPlacementGroupName string
    The name of the placement group.
    PiPlacementGroupPolicy string
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    PlacementGroupId string
    (String) The placement group ID.
    Timeouts PiPlacementGroupTimeoutsArgs
    members List<String>
    (List of strings) The list of server instances IDs that are members of the placement group.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piPlacementGroupId String
    (String) The unique identifier of the placement group.
    piPlacementGroupName String
    The name of the placement group.
    piPlacementGroupPolicy String
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    placementGroupId String
    (String) The placement group ID.
    timeouts PiPlacementGroupTimeouts
    members string[]
    (List of strings) The list of server instances IDs that are members of the placement group.
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piPlacementGroupId string
    (String) The unique identifier of the placement group.
    piPlacementGroupName string
    The name of the placement group.
    piPlacementGroupPolicy string
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    placementGroupId string
    (String) The placement group ID.
    timeouts PiPlacementGroupTimeouts
    members Sequence[str]
    (List of strings) The list of server instances IDs that are members of the placement group.
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_placement_group_id str
    (String) The unique identifier of the placement group.
    pi_placement_group_name str
    The name of the placement group.
    pi_placement_group_policy str
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    placement_group_id str
    (String) The placement group ID.
    timeouts PiPlacementGroupTimeoutsArgs
    members List<String>
    (List of strings) The list of server instances IDs that are members of the placement group.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piPlacementGroupId String
    (String) The unique identifier of the placement group.
    piPlacementGroupName String
    The name of the placement group.
    piPlacementGroupPolicy String
    The value of the group's affinity policy. Valid values are affinity and anti-affinity.
    placementGroupId String
    (String) The placement group ID.
    timeouts Property Map

    Supporting Types

    PiPlacementGroupTimeouts, PiPlacementGroupTimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update String

    Import

    Example

    bash

    $ pulumi import ibm:index/piPlacementGroup:PiPlacementGroup example d7bec597-4726-451f-8a63-e62e6f19c32c/b17a2b7f-77ab-491c-811e-495f8d4c8947
    

    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.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud