published on Friday, Aug 14, 2026 by tencentcloudstack
published on Friday, Aug 14, 2026 by tencentcloudstack
Provide a resource to create a placement group.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const foo = new tencentcloud.PlacementGroup("foo", {
name: "test",
type: "HOST",
affinity: 2,
tags: {
createBy: "terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
foo = tencentcloud.PlacementGroup("foo",
name="test",
type="HOST",
affinity=2,
tags={
"createBy": "terraform",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewPlacementGroup(ctx, "foo", &tencentcloud.PlacementGroupArgs{
Name: pulumi.String("test"),
Type: pulumi.String("HOST"),
Affinity: pulumi.Float64(2),
Tags: pulumi.StringMap{
"createBy": pulumi.String("terraform"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var foo = new Tencentcloud.PlacementGroup("foo", new()
{
Name = "test",
Type = "HOST",
Affinity = 2,
Tags =
{
{ "createBy", "terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PlacementGroup;
import com.pulumi.tencentcloud.PlacementGroupArgs;
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 foo = new PlacementGroup("foo", PlacementGroupArgs.builder()
.name("test")
.type("HOST")
.affinity(2.0)
.tags(Map.of("createBy", "terraform"))
.build());
}
}
resources:
foo:
type: tencentcloud:PlacementGroup
properties:
name: test
type: HOST
affinity: 2
tags:
createBy: terraform
Example coming soon!
Create partition placement group
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const bar = new tencentcloud.PlacementGroup("bar", {
name: "test-partition",
type: "HOST",
strategy: "PARTITION",
partitionCount: 5,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
bar = tencentcloud.PlacementGroup("bar",
name="test-partition",
type="HOST",
strategy="PARTITION",
partition_count=5)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewPlacementGroup(ctx, "bar", &tencentcloud.PlacementGroupArgs{
Name: pulumi.String("test-partition"),
Type: pulumi.String("HOST"),
Strategy: pulumi.String("PARTITION"),
PartitionCount: pulumi.Float64(5),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var bar = new Tencentcloud.PlacementGroup("bar", new()
{
Name = "test-partition",
Type = "HOST",
Strategy = "PARTITION",
PartitionCount = 5,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PlacementGroup;
import com.pulumi.tencentcloud.PlacementGroupArgs;
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 bar = new PlacementGroup("bar", PlacementGroupArgs.builder()
.name("test-partition")
.type("HOST")
.strategy("PARTITION")
.partitionCount(5.0)
.build());
}
}
resources:
bar:
type: tencentcloud:PlacementGroup
properties:
name: test-partition
type: HOST
strategy: PARTITION
partitionCount: 5
Example coming soon!
Create PlacementGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PlacementGroup(name: string, args: PlacementGroupArgs, opts?: CustomResourceOptions);@overload
def PlacementGroup(resource_name: str,
args: PlacementGroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PlacementGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
type: Optional[str] = None,
affinity: Optional[float] = None,
name: Optional[str] = None,
partition_count: Optional[float] = None,
placement_group_id: Optional[str] = None,
strategy: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)func NewPlacementGroup(ctx *Context, name string, args PlacementGroupArgs, opts ...ResourceOption) (*PlacementGroup, error)public PlacementGroup(string name, PlacementGroupArgs args, CustomResourceOptions? opts = null)
public PlacementGroup(String name, PlacementGroupArgs args)
public PlacementGroup(String name, PlacementGroupArgs args, CustomResourceOptions options)
type: tencentcloud:PlacementGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "tencentcloud_placement_group" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PlacementGroupArgs
- 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 PlacementGroupArgs
- 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 PlacementGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PlacementGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PlacementGroupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
PlacementGroup 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 PlacementGroup resource accepts the following input properties:
- Type string
- Type of the placement group. Valid values:
HOST,SWandRACK. - Affinity double
- Affinity of the placement group.Valid values: 1~10, default is 1.
- Name string
- Name of the placement group, 1-60 characters in length.
- Partition
Count double - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - Placement
Group stringId - ID of the resource.
- Strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Dictionary<string, string>
- Tags of the placement group.
- Type string
- Type of the placement group. Valid values:
HOST,SWandRACK. - Affinity float64
- Affinity of the placement group.Valid values: 1~10, default is 1.
- Name string
- Name of the placement group, 1-60 characters in length.
- Partition
Count float64 - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - Placement
Group stringId - ID of the resource.
- Strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - map[string]string
- Tags of the placement group.
- type string
- Type of the placement group. Valid values:
HOST,SWandRACK. - affinity number
- Affinity of the placement group.Valid values: 1~10, default is 1.
- name string
- Name of the placement group, 1-60 characters in length.
- partition_
count number - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement_
group_ stringid - ID of the resource.
- strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - map(string)
- Tags of the placement group.
- type String
- Type of the placement group. Valid values:
HOST,SWandRACK. - affinity Double
- Affinity of the placement group.Valid values: 1~10, default is 1.
- name String
- Name of the placement group, 1-60 characters in length.
- partition
Count Double - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement
Group StringId - ID of the resource.
- strategy String
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Map<String,String>
- Tags of the placement group.
- type string
- Type of the placement group. Valid values:
HOST,SWandRACK. - affinity number
- Affinity of the placement group.Valid values: 1~10, default is 1.
- name string
- Name of the placement group, 1-60 characters in length.
- partition
Count number - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement
Group stringId - ID of the resource.
- strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - {[key: string]: string}
- Tags of the placement group.
- type str
- Type of the placement group. Valid values:
HOST,SWandRACK. - affinity float
- Affinity of the placement group.Valid values: 1~10, default is 1.
- name str
- Name of the placement group, 1-60 characters in length.
- partition_
count float - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement_
group_ strid - ID of the resource.
- strategy str
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Mapping[str, str]
- Tags of the placement group.
- type String
- Type of the placement group. Valid values:
HOST,SWandRACK. - affinity Number
- Affinity of the placement group.Valid values: 1~10, default is 1.
- name String
- Name of the placement group, 1-60 characters in length.
- partition
Count Number - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement
Group StringId - ID of the resource.
- strategy String
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Map<String>
- Tags of the placement group.
Outputs
All input properties are implicitly available as output properties. Additionally, the PlacementGroup resource produces the following output properties:
- Create
Time string - Creation time of the placement group.
- Current
Num double - Number of hosts in the placement group.
- Cvm
Quota doubleTotal - Maximum number of hosts in the placement group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - Creation time of the placement group.
- Current
Num float64 - Number of hosts in the placement group.
- Cvm
Quota float64Total - Maximum number of hosts in the placement group.
- Id string
- The provider-assigned unique ID for this managed resource.
- create_
time string - Creation time of the placement group.
- current_
num number - Number of hosts in the placement group.
- cvm_
quota_ numbertotal - Maximum number of hosts in the placement group.
- id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - Creation time of the placement group.
- current
Num Double - Number of hosts in the placement group.
- cvm
Quota DoubleTotal - Maximum number of hosts in the placement group.
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time string - Creation time of the placement group.
- current
Num number - Number of hosts in the placement group.
- cvm
Quota numberTotal - Maximum number of hosts in the placement group.
- id string
- The provider-assigned unique ID for this managed resource.
- create_
time str - Creation time of the placement group.
- current_
num float - Number of hosts in the placement group.
- cvm_
quota_ floattotal - Maximum number of hosts in the placement group.
- id str
- The provider-assigned unique ID for this managed resource.
- create
Time String - Creation time of the placement group.
- current
Num Number - Number of hosts in the placement group.
- cvm
Quota NumberTotal - Maximum number of hosts in the placement group.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing PlacementGroup Resource
Get an existing PlacementGroup 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?: PlacementGroupState, opts?: CustomResourceOptions): PlacementGroup@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
affinity: Optional[float] = None,
create_time: Optional[str] = None,
current_num: Optional[float] = None,
cvm_quota_total: Optional[float] = None,
name: Optional[str] = None,
partition_count: Optional[float] = None,
placement_group_id: Optional[str] = None,
strategy: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
type: Optional[str] = None) -> PlacementGroupfunc GetPlacementGroup(ctx *Context, name string, id IDInput, state *PlacementGroupState, opts ...ResourceOption) (*PlacementGroup, error)public static PlacementGroup Get(string name, Input<string> id, PlacementGroupState? state, CustomResourceOptions? opts = null)public static PlacementGroup get(String name, Output<String> id, PlacementGroupState state, CustomResourceOptions options)resources: _: type: tencentcloud:PlacementGroup get: id: ${id}import {
to = tencentcloud_placement_group.example
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.
- Affinity double
- Affinity of the placement group.Valid values: 1~10, default is 1.
- Create
Time string - Creation time of the placement group.
- Current
Num double - Number of hosts in the placement group.
- Cvm
Quota doubleTotal - Maximum number of hosts in the placement group.
- Name string
- Name of the placement group, 1-60 characters in length.
- Partition
Count double - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - Placement
Group stringId - ID of the resource.
- Strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Dictionary<string, string>
- Tags of the placement group.
- Type string
- Type of the placement group. Valid values:
HOST,SWandRACK.
- Affinity float64
- Affinity of the placement group.Valid values: 1~10, default is 1.
- Create
Time string - Creation time of the placement group.
- Current
Num float64 - Number of hosts in the placement group.
- Cvm
Quota float64Total - Maximum number of hosts in the placement group.
- Name string
- Name of the placement group, 1-60 characters in length.
- Partition
Count float64 - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - Placement
Group stringId - ID of the resource.
- Strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - map[string]string
- Tags of the placement group.
- Type string
- Type of the placement group. Valid values:
HOST,SWandRACK.
- affinity number
- Affinity of the placement group.Valid values: 1~10, default is 1.
- create_
time string - Creation time of the placement group.
- current_
num number - Number of hosts in the placement group.
- cvm_
quota_ numbertotal - Maximum number of hosts in the placement group.
- name string
- Name of the placement group, 1-60 characters in length.
- partition_
count number - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement_
group_ stringid - ID of the resource.
- strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - map(string)
- Tags of the placement group.
- type string
- Type of the placement group. Valid values:
HOST,SWandRACK.
- affinity Double
- Affinity of the placement group.Valid values: 1~10, default is 1.
- create
Time String - Creation time of the placement group.
- current
Num Double - Number of hosts in the placement group.
- cvm
Quota DoubleTotal - Maximum number of hosts in the placement group.
- name String
- Name of the placement group, 1-60 characters in length.
- partition
Count Double - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement
Group StringId - ID of the resource.
- strategy String
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Map<String,String>
- Tags of the placement group.
- type String
- Type of the placement group. Valid values:
HOST,SWandRACK.
- affinity number
- Affinity of the placement group.Valid values: 1~10, default is 1.
- create
Time string - Creation time of the placement group.
- current
Num number - Number of hosts in the placement group.
- cvm
Quota numberTotal - Maximum number of hosts in the placement group.
- name string
- Name of the placement group, 1-60 characters in length.
- partition
Count number - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement
Group stringId - ID of the resource.
- strategy string
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - {[key: string]: string}
- Tags of the placement group.
- type string
- Type of the placement group. Valid values:
HOST,SWandRACK.
- affinity float
- Affinity of the placement group.Valid values: 1~10, default is 1.
- create_
time str - Creation time of the placement group.
- current_
num float - Number of hosts in the placement group.
- cvm_
quota_ floattotal - Maximum number of hosts in the placement group.
- name str
- Name of the placement group, 1-60 characters in length.
- partition_
count float - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement_
group_ strid - ID of the resource.
- strategy str
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Mapping[str, str]
- Tags of the placement group.
- type str
- Type of the placement group. Valid values:
HOST,SWandRACK.
- affinity Number
- Affinity of the placement group.Valid values: 1~10, default is 1.
- create
Time String - Creation time of the placement group.
- current
Num Number - Number of hosts in the placement group.
- cvm
Quota NumberTotal - Maximum number of hosts in the placement group.
- name String
- Name of the placement group, 1-60 characters in length.
- partition
Count Number - Partition count of the placement group. Valid values: 2~30. Only valid when
strategyis set toPARTITION. - placement
Group StringId - ID of the resource.
- strategy String
- Strategy of the placement group. Valid values:
SPREADandPARTITION.SPREADis the default strategy. When strategy isPARTITION,partition_countmust be set. This field cannot be modified after creation. - Map<String>
- Tags of the placement group.
- type String
- Type of the placement group. Valid values:
HOST,SWandRACK.
Import
Placement group can be imported using the id, e.g.
$ pulumi import tencentcloud:index/placementGroup:PlacementGroup foo ps-ilan8vjf
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloudTerraform Provider.
published on Friday, Aug 14, 2026 by tencentcloudstack