ibm.PiPlacementGroup
Explore with Pulumi AI
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:
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Placement stringGroup Name - The name of the placement group.
- Pi
Placement stringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - Pi
Placement stringGroup Id - (String) The unique identifier of the placement group.
- Timeouts
Pi
Placement Group Timeouts
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Placement stringGroup Name - The name of the placement group.
- Pi
Placement stringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - Pi
Placement stringGroup Id - (String) The unique identifier of the placement group.
- Timeouts
Pi
Placement Group Timeouts Args
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Placement StringGroup Name - The name of the placement group.
- pi
Placement StringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - pi
Placement StringGroup Id - (String) The unique identifier of the placement group.
- timeouts
Pi
Placement Group Timeouts
- pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- pi
Placement stringGroup Name - The name of the placement group.
- pi
Placement stringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - pi
Placement stringGroup Id - (String) The unique identifier of the placement group.
- timeouts
Pi
Placement Group Timeouts
- pi_
cloud_ strinstance_ id - The GUID of the service instance associated with an account.
- pi_
placement_ strgroup_ name - The name of the placement group.
- pi_
placement_ strgroup_ policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - pi_
placement_ strgroup_ id - (String) The unique identifier of the placement group.
- timeouts
Pi
Placement Group Timeouts Args
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Placement StringGroup Name - The name of the placement group.
- pi
Placement StringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - pi
Placement StringGroup Id - (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.
- Placement
Group stringId - (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.
- Placement
Group stringId - (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.
- placement
Group StringId - (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.
- placement
Group stringId - (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_ strid - (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.
- placement
Group StringId - (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.
- Members List<string>
- (List of strings) The list of server instances IDs that are members of the placement group.
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Placement stringGroup Id - (String) The unique identifier of the placement group.
- Pi
Placement stringGroup Name - The name of the placement group.
- Pi
Placement stringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - Placement
Group stringId - (String) The placement group ID.
- Timeouts
Pi
Placement Group Timeouts
- Members []string
- (List of strings) The list of server instances IDs that are members of the placement group.
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Placement stringGroup Id - (String) The unique identifier of the placement group.
- Pi
Placement stringGroup Name - The name of the placement group.
- Pi
Placement stringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - Placement
Group stringId - (String) The placement group ID.
- Timeouts
Pi
Placement Group Timeouts Args
- members List<String>
- (List of strings) The list of server instances IDs that are members of the placement group.
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Placement StringGroup Id - (String) The unique identifier of the placement group.
- pi
Placement StringGroup Name - The name of the placement group.
- pi
Placement StringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - placement
Group StringId - (String) The placement group ID.
- timeouts
Pi
Placement Group Timeouts
- members string[]
- (List of strings) The list of server instances IDs that are members of the placement group.
- pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- pi
Placement stringGroup Id - (String) The unique identifier of the placement group.
- pi
Placement stringGroup Name - The name of the placement group.
- pi
Placement stringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - placement
Group stringId - (String) The placement group ID.
- timeouts
Pi
Placement Group Timeouts
- members Sequence[str]
- (List of strings) The list of server instances IDs that are members of the placement group.
- pi_
cloud_ strinstance_ id - The GUID of the service instance associated with an account.
- pi_
placement_ strgroup_ id - (String) The unique identifier of the placement group.
- pi_
placement_ strgroup_ name - The name of the placement group.
- pi_
placement_ strgroup_ policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - placement_
group_ strid - (String) The placement group ID.
- timeouts
Pi
Placement Group Timeouts Args
- members List<String>
- (List of strings) The list of server instances IDs that are members of the placement group.
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Placement StringGroup Id - (String) The unique identifier of the placement group.
- pi
Placement StringGroup Name - The name of the placement group.
- pi
Placement StringGroup Policy - The value of the group's affinity policy. Valid values are
affinity
andanti-affinity
. - placement
Group StringId - (String) The placement group ID.
- timeouts Property Map
Supporting Types
PiPlacementGroupTimeouts, PiPlacementGroupTimeoutsArgs
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.