1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. PlacementGroup
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.PlacementGroup

Explore with Pulumi AI

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", {
    affinity: 2,
    tags: {
        createBy: "terraform",
    },
    type: "HOST",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

foo = tencentcloud.PlacementGroup("foo",
    affinity=2,
    tags={
        "createBy": "terraform",
    },
    type="HOST")
Copy
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{
			Affinity: pulumi.Float64(2),
			Tags: pulumi.StringMap{
				"createBy": pulumi.String("terraform"),
			},
			Type: pulumi.String("HOST"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var foo = new Tencentcloud.PlacementGroup("foo", new()
    {
        Affinity = 2,
        Tags = 
        {
            { "createBy", "terraform" },
        },
        Type = "HOST",
    });

});
Copy
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()
            .affinity(2)
            .tags(Map.of("createBy", "terraform"))
            .type("HOST")
            .build());

    }
}
Copy
resources:
  foo:
    type: tencentcloud:PlacementGroup
    properties:
      affinity: 2
      tags:
        createBy: terraform
      type: HOST
Copy

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,
                   placement_group_id: 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.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PlacementGroupArgs
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. 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 This property is required. string
The unique name of the resource.
args This property is required. PlacementGroupArgs
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. PlacementGroupArgs
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. 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 This property is required. string
Type of the placement group. Valid values: HOST, SW and RACK.
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.
PlacementGroupId string
ID of the resource.
Tags Dictionary<string, string>
Tags of the placement group.
Type This property is required. string
Type of the placement group. Valid values: HOST, SW and RACK.
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.
PlacementGroupId string
ID of the resource.
Tags map[string]string
Tags of the placement group.
type This property is required. String
Type of the placement group. Valid values: HOST, SW and RACK.
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.
placementGroupId String
ID of the resource.
tags Map<String,String>
Tags of the placement group.
type This property is required. string
Type of the placement group. Valid values: HOST, SW and RACK.
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.
placementGroupId string
ID of the resource.
tags {[key: string]: string}
Tags of the placement group.
type This property is required. str
Type of the placement group. Valid values: HOST, SW and RACK.
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.
placement_group_id str
ID of the resource.
tags Mapping[str, str]
Tags of the placement group.
type This property is required. String
Type of the placement group. Valid values: HOST, SW and RACK.
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.
placementGroupId String
ID of the resource.
tags 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:

CreateTime string
Creation time of the placement group.
CurrentNum double
Number of hosts in the placement group.
CvmQuotaTotal double
Maximum number of hosts in the placement group.
Id string
The provider-assigned unique ID for this managed resource.
CreateTime string
Creation time of the placement group.
CurrentNum float64
Number of hosts in the placement group.
CvmQuotaTotal float64
Maximum number of hosts in the placement group.
Id string
The provider-assigned unique ID for this managed resource.
createTime String
Creation time of the placement group.
currentNum Double
Number of hosts in the placement group.
cvmQuotaTotal Double
Maximum number of hosts in the placement group.
id String
The provider-assigned unique ID for this managed resource.
createTime string
Creation time of the placement group.
currentNum number
Number of hosts in the placement group.
cvmQuotaTotal number
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_total float
Maximum number of hosts in the placement group.
id str
The provider-assigned unique ID for this managed resource.
createTime String
Creation time of the placement group.
currentNum Number
Number of hosts in the placement group.
cvmQuotaTotal Number
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,
        placement_group_id: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        type: Optional[str] = None) -> PlacementGroup
func 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}
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:
Affinity double
Affinity of the placement group.Valid values: 1~10, default is 1.
CreateTime string
Creation time of the placement group.
CurrentNum double
Number of hosts in the placement group.
CvmQuotaTotal double
Maximum number of hosts in the placement group.
Name string
Name of the placement group, 1-60 characters in length.
PlacementGroupId string
ID of the resource.
Tags Dictionary<string, string>
Tags of the placement group.
Type string
Type of the placement group. Valid values: HOST, SW and RACK.
Affinity float64
Affinity of the placement group.Valid values: 1~10, default is 1.
CreateTime string
Creation time of the placement group.
CurrentNum float64
Number of hosts in the placement group.
CvmQuotaTotal float64
Maximum number of hosts in the placement group.
Name string
Name of the placement group, 1-60 characters in length.
PlacementGroupId string
ID of the resource.
Tags map[string]string
Tags of the placement group.
Type string
Type of the placement group. Valid values: HOST, SW and RACK.
affinity Double
Affinity of the placement group.Valid values: 1~10, default is 1.
createTime String
Creation time of the placement group.
currentNum Double
Number of hosts in the placement group.
cvmQuotaTotal Double
Maximum number of hosts in the placement group.
name String
Name of the placement group, 1-60 characters in length.
placementGroupId String
ID of the resource.
tags Map<String,String>
Tags of the placement group.
type String
Type of the placement group. Valid values: HOST, SW and RACK.
affinity number
Affinity of the placement group.Valid values: 1~10, default is 1.
createTime string
Creation time of the placement group.
currentNum number
Number of hosts in the placement group.
cvmQuotaTotal number
Maximum number of hosts in the placement group.
name string
Name of the placement group, 1-60 characters in length.
placementGroupId string
ID of the resource.
tags {[key: string]: string}
Tags of the placement group.
type string
Type of the placement group. Valid values: HOST, SW and RACK.
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_total float
Maximum number of hosts in the placement group.
name str
Name of the placement group, 1-60 characters in length.
placement_group_id str
ID of the resource.
tags Mapping[str, str]
Tags of the placement group.
type str
Type of the placement group. Valid values: HOST, SW and RACK.
affinity Number
Affinity of the placement group.Valid values: 1~10, default is 1.
createTime String
Creation time of the placement group.
currentNum Number
Number of hosts in the placement group.
cvmQuotaTotal Number
Maximum number of hosts in the placement group.
name String
Name of the placement group, 1-60 characters in length.
placementGroupId String
ID of the resource.
tags Map<String>
Tags of the placement group.
type String
Type of the placement group. Valid values: HOST, SW and RACK.

Import

Placement group can be imported using the id, e.g.

$ pulumi import tencentcloud:index/placementGroup:PlacementGroup foo ps-ilan8vjf
Copy

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 tencentcloud Terraform Provider.