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

tencentcloud.CwpLicenseBindAttachment

Explore with Pulumi AI

Provides a resource to create a cwp license_bind_attachment

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const exampleCwpMachinesSimple = tencentcloud.getCwpMachinesSimple({
    machineType: "CVM",
    machineRegion: "ap-guangzhou",
    projectIds: [1210293],
    filters: [{
        name: "Version",
        values: ["BASIC_VERSION"],
        exactMatch: true,
    }],
});
const exampleCwpLicenseOrder = new tencentcloud.CwpLicenseOrder("exampleCwpLicenseOrder", {
    alias: "tf_example",
    licenseType: 0,
    licenseNum: 1,
    regionId: 1,
    projectId: 0,
    tags: {
        createdBy: "terraform",
    },
});
const exampleCwpLicenseBindAttachment = new tencentcloud.CwpLicenseBindAttachment("exampleCwpLicenseBindAttachment", {
    resourceId: exampleCwpLicenseOrder.resourceId,
    licenseId: exampleCwpLicenseOrder.licenseId,
    licenseType: 0,
    quuid: exampleCwpMachinesSimple.then(exampleCwpMachinesSimple => exampleCwpMachinesSimple.machines?.[0]?.quuid),
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

example_cwp_machines_simple = tencentcloud.get_cwp_machines_simple(machine_type="CVM",
    machine_region="ap-guangzhou",
    project_ids=[1210293],
    filters=[{
        "name": "Version",
        "values": ["BASIC_VERSION"],
        "exact_match": True,
    }])
example_cwp_license_order = tencentcloud.CwpLicenseOrder("exampleCwpLicenseOrder",
    alias="tf_example",
    license_type=0,
    license_num=1,
    region_id=1,
    project_id=0,
    tags={
        "createdBy": "terraform",
    })
example_cwp_license_bind_attachment = tencentcloud.CwpLicenseBindAttachment("exampleCwpLicenseBindAttachment",
    resource_id=example_cwp_license_order.resource_id,
    license_id=example_cwp_license_order.license_id,
    license_type=0,
    quuid=example_cwp_machines_simple.machines[0].quuid)
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 {
		exampleCwpMachinesSimple, err := tencentcloud.GetCwpMachinesSimple(ctx, &tencentcloud.GetCwpMachinesSimpleArgs{
			MachineType:   "CVM",
			MachineRegion: "ap-guangzhou",
			ProjectIds: []float64{
				1210293,
			},
			Filters: []tencentcloud.GetCwpMachinesSimpleFilter{
				{
					Name: "Version",
					Values: []string{
						"BASIC_VERSION",
					},
					ExactMatch: pulumi.BoolRef(true),
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		exampleCwpLicenseOrder, err := tencentcloud.NewCwpLicenseOrder(ctx, "exampleCwpLicenseOrder", &tencentcloud.CwpLicenseOrderArgs{
			Alias:       pulumi.String("tf_example"),
			LicenseType: pulumi.Float64(0),
			LicenseNum:  pulumi.Float64(1),
			RegionId:    pulumi.Float64(1),
			ProjectId:   pulumi.Float64(0),
			Tags: pulumi.StringMap{
				"createdBy": pulumi.String("terraform"),
			},
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewCwpLicenseBindAttachment(ctx, "exampleCwpLicenseBindAttachment", &tencentcloud.CwpLicenseBindAttachmentArgs{
			ResourceId:  exampleCwpLicenseOrder.ResourceId,
			LicenseId:   exampleCwpLicenseOrder.LicenseId,
			LicenseType: pulumi.Float64(0),
			Quuid:       pulumi.String(exampleCwpMachinesSimple.Machines[0].Quuid),
		})
		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 exampleCwpMachinesSimple = Tencentcloud.GetCwpMachinesSimple.Invoke(new()
    {
        MachineType = "CVM",
        MachineRegion = "ap-guangzhou",
        ProjectIds = new[]
        {
            1210293,
        },
        Filters = new[]
        {
            new Tencentcloud.Inputs.GetCwpMachinesSimpleFilterInputArgs
            {
                Name = "Version",
                Values = new[]
                {
                    "BASIC_VERSION",
                },
                ExactMatch = true,
            },
        },
    });

    var exampleCwpLicenseOrder = new Tencentcloud.CwpLicenseOrder("exampleCwpLicenseOrder", new()
    {
        Alias = "tf_example",
        LicenseType = 0,
        LicenseNum = 1,
        RegionId = 1,
        ProjectId = 0,
        Tags = 
        {
            { "createdBy", "terraform" },
        },
    });

    var exampleCwpLicenseBindAttachment = new Tencentcloud.CwpLicenseBindAttachment("exampleCwpLicenseBindAttachment", new()
    {
        ResourceId = exampleCwpLicenseOrder.ResourceId,
        LicenseId = exampleCwpLicenseOrder.LicenseId,
        LicenseType = 0,
        Quuid = exampleCwpMachinesSimple.Apply(getCwpMachinesSimpleResult => getCwpMachinesSimpleResult.Machines[0]?.Quuid),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetCwpMachinesSimpleArgs;
import com.pulumi.tencentcloud.CwpLicenseOrder;
import com.pulumi.tencentcloud.CwpLicenseOrderArgs;
import com.pulumi.tencentcloud.CwpLicenseBindAttachment;
import com.pulumi.tencentcloud.CwpLicenseBindAttachmentArgs;
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) {
        final var exampleCwpMachinesSimple = TencentcloudFunctions.getCwpMachinesSimple(GetCwpMachinesSimpleArgs.builder()
            .machineType("CVM")
            .machineRegion("ap-guangzhou")
            .projectIds(1210293)
            .filters(GetCwpMachinesSimpleFilterArgs.builder()
                .name("Version")
                .values("BASIC_VERSION")
                .exactMatch(true)
                .build())
            .build());

        var exampleCwpLicenseOrder = new CwpLicenseOrder("exampleCwpLicenseOrder", CwpLicenseOrderArgs.builder()
            .alias("tf_example")
            .licenseType(0)
            .licenseNum(1)
            .regionId(1)
            .projectId(0)
            .tags(Map.of("createdBy", "terraform"))
            .build());

        var exampleCwpLicenseBindAttachment = new CwpLicenseBindAttachment("exampleCwpLicenseBindAttachment", CwpLicenseBindAttachmentArgs.builder()
            .resourceId(exampleCwpLicenseOrder.resourceId())
            .licenseId(exampleCwpLicenseOrder.licenseId())
            .licenseType(0)
            .quuid(exampleCwpMachinesSimple.applyValue(getCwpMachinesSimpleResult -> getCwpMachinesSimpleResult.machines()[0].quuid()))
            .build());

    }
}
Copy
resources:
  exampleCwpLicenseOrder:
    type: tencentcloud:CwpLicenseOrder
    properties:
      alias: tf_example
      licenseType: 0
      licenseNum: 1
      regionId: 1
      projectId: 0
      tags:
        createdBy: terraform
  exampleCwpLicenseBindAttachment:
    type: tencentcloud:CwpLicenseBindAttachment
    properties:
      resourceId: ${exampleCwpLicenseOrder.resourceId}
      licenseId: ${exampleCwpLicenseOrder.licenseId}
      licenseType: 0
      quuid: ${exampleCwpMachinesSimple.machines[0].quuid}
variables:
  exampleCwpMachinesSimple:
    fn::invoke:
      function: tencentcloud:getCwpMachinesSimple
      arguments:
        machineType: CVM
        machineRegion: ap-guangzhou
        projectIds:
          - 1.210293e+06
        filters:
          - name: Version
            values:
              - BASIC_VERSION
            exactMatch: true
Copy

Create CwpLicenseBindAttachment Resource

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

Constructor syntax

new CwpLicenseBindAttachment(name: string, args: CwpLicenseBindAttachmentArgs, opts?: CustomResourceOptions);
@overload
def CwpLicenseBindAttachment(resource_name: str,
                             args: CwpLicenseBindAttachmentArgs,
                             opts: Optional[ResourceOptions] = None)

@overload
def CwpLicenseBindAttachment(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             license_id: Optional[float] = None,
                             license_type: Optional[float] = None,
                             quuid: Optional[str] = None,
                             resource_id: Optional[str] = None,
                             cwp_license_bind_attachment_id: Optional[str] = None)
func NewCwpLicenseBindAttachment(ctx *Context, name string, args CwpLicenseBindAttachmentArgs, opts ...ResourceOption) (*CwpLicenseBindAttachment, error)
public CwpLicenseBindAttachment(string name, CwpLicenseBindAttachmentArgs args, CustomResourceOptions? opts = null)
public CwpLicenseBindAttachment(String name, CwpLicenseBindAttachmentArgs args)
public CwpLicenseBindAttachment(String name, CwpLicenseBindAttachmentArgs args, CustomResourceOptions options)
type: tencentcloud:CwpLicenseBindAttachment
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. CwpLicenseBindAttachmentArgs
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. CwpLicenseBindAttachmentArgs
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. CwpLicenseBindAttachmentArgs
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. CwpLicenseBindAttachmentArgs
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. CwpLicenseBindAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

LicenseId This property is required. double
License ID.
LicenseType This property is required. double
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
Quuid This property is required. string
Machine quota that needs to be bound.
ResourceId This property is required. string
Resource ID.
CwpLicenseBindAttachmentId string
ID of the resource.
LicenseId This property is required. float64
License ID.
LicenseType This property is required. float64
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
Quuid This property is required. string
Machine quota that needs to be bound.
ResourceId This property is required. string
Resource ID.
CwpLicenseBindAttachmentId string
ID of the resource.
licenseId This property is required. Double
License ID.
licenseType This property is required. Double
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
quuid This property is required. String
Machine quota that needs to be bound.
resourceId This property is required. String
Resource ID.
cwpLicenseBindAttachmentId String
ID of the resource.
licenseId This property is required. number
License ID.
licenseType This property is required. number
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
quuid This property is required. string
Machine quota that needs to be bound.
resourceId This property is required. string
Resource ID.
cwpLicenseBindAttachmentId string
ID of the resource.
license_id This property is required. float
License ID.
license_type This property is required. float
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
quuid This property is required. str
Machine quota that needs to be bound.
resource_id This property is required. str
Resource ID.
cwp_license_bind_attachment_id str
ID of the resource.
licenseId This property is required. Number
License ID.
licenseType This property is required. Number
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
quuid This property is required. String
Machine quota that needs to be bound.
resourceId This property is required. String
Resource ID.
cwpLicenseBindAttachmentId String
ID of the resource.

Outputs

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

AgentStatus string
agent status.
Id string
The provider-assigned unique ID for this managed resource.
IsSwitchBind bool
Is it allowed to change the binding, false is not allowed to change the binding.
IsUnbind bool
Allow unbinding, false does not allow unbinding.
MachineIp string
machine ip.
MachineName string
machine name.
MachineWanIp string
machine wan ip.
Uuid string
uuid.
AgentStatus string
agent status.
Id string
The provider-assigned unique ID for this managed resource.
IsSwitchBind bool
Is it allowed to change the binding, false is not allowed to change the binding.
IsUnbind bool
Allow unbinding, false does not allow unbinding.
MachineIp string
machine ip.
MachineName string
machine name.
MachineWanIp string
machine wan ip.
Uuid string
uuid.
agentStatus String
agent status.
id String
The provider-assigned unique ID for this managed resource.
isSwitchBind Boolean
Is it allowed to change the binding, false is not allowed to change the binding.
isUnbind Boolean
Allow unbinding, false does not allow unbinding.
machineIp String
machine ip.
machineName String
machine name.
machineWanIp String
machine wan ip.
uuid String
uuid.
agentStatus string
agent status.
id string
The provider-assigned unique ID for this managed resource.
isSwitchBind boolean
Is it allowed to change the binding, false is not allowed to change the binding.
isUnbind boolean
Allow unbinding, false does not allow unbinding.
machineIp string
machine ip.
machineName string
machine name.
machineWanIp string
machine wan ip.
uuid string
uuid.
agent_status str
agent status.
id str
The provider-assigned unique ID for this managed resource.
is_switch_bind bool
Is it allowed to change the binding, false is not allowed to change the binding.
is_unbind bool
Allow unbinding, false does not allow unbinding.
machine_ip str
machine ip.
machine_name str
machine name.
machine_wan_ip str
machine wan ip.
uuid str
uuid.
agentStatus String
agent status.
id String
The provider-assigned unique ID for this managed resource.
isSwitchBind Boolean
Is it allowed to change the binding, false is not allowed to change the binding.
isUnbind Boolean
Allow unbinding, false does not allow unbinding.
machineIp String
machine ip.
machineName String
machine name.
machineWanIp String
machine wan ip.
uuid String
uuid.

Look up Existing CwpLicenseBindAttachment Resource

Get an existing CwpLicenseBindAttachment 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?: CwpLicenseBindAttachmentState, opts?: CustomResourceOptions): CwpLicenseBindAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        agent_status: Optional[str] = None,
        cwp_license_bind_attachment_id: Optional[str] = None,
        is_switch_bind: Optional[bool] = None,
        is_unbind: Optional[bool] = None,
        license_id: Optional[float] = None,
        license_type: Optional[float] = None,
        machine_ip: Optional[str] = None,
        machine_name: Optional[str] = None,
        machine_wan_ip: Optional[str] = None,
        quuid: Optional[str] = None,
        resource_id: Optional[str] = None,
        uuid: Optional[str] = None) -> CwpLicenseBindAttachment
func GetCwpLicenseBindAttachment(ctx *Context, name string, id IDInput, state *CwpLicenseBindAttachmentState, opts ...ResourceOption) (*CwpLicenseBindAttachment, error)
public static CwpLicenseBindAttachment Get(string name, Input<string> id, CwpLicenseBindAttachmentState? state, CustomResourceOptions? opts = null)
public static CwpLicenseBindAttachment get(String name, Output<String> id, CwpLicenseBindAttachmentState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:CwpLicenseBindAttachment    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:
AgentStatus string
agent status.
CwpLicenseBindAttachmentId string
ID of the resource.
IsSwitchBind bool
Is it allowed to change the binding, false is not allowed to change the binding.
IsUnbind bool
Allow unbinding, false does not allow unbinding.
LicenseId double
License ID.
LicenseType double
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
MachineIp string
machine ip.
MachineName string
machine name.
MachineWanIp string
machine wan ip.
Quuid string
Machine quota that needs to be bound.
ResourceId string
Resource ID.
Uuid string
uuid.
AgentStatus string
agent status.
CwpLicenseBindAttachmentId string
ID of the resource.
IsSwitchBind bool
Is it allowed to change the binding, false is not allowed to change the binding.
IsUnbind bool
Allow unbinding, false does not allow unbinding.
LicenseId float64
License ID.
LicenseType float64
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
MachineIp string
machine ip.
MachineName string
machine name.
MachineWanIp string
machine wan ip.
Quuid string
Machine quota that needs to be bound.
ResourceId string
Resource ID.
Uuid string
uuid.
agentStatus String
agent status.
cwpLicenseBindAttachmentId String
ID of the resource.
isSwitchBind Boolean
Is it allowed to change the binding, false is not allowed to change the binding.
isUnbind Boolean
Allow unbinding, false does not allow unbinding.
licenseId Double
License ID.
licenseType Double
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
machineIp String
machine ip.
machineName String
machine name.
machineWanIp String
machine wan ip.
quuid String
Machine quota that needs to be bound.
resourceId String
Resource ID.
uuid String
uuid.
agentStatus string
agent status.
cwpLicenseBindAttachmentId string
ID of the resource.
isSwitchBind boolean
Is it allowed to change the binding, false is not allowed to change the binding.
isUnbind boolean
Allow unbinding, false does not allow unbinding.
licenseId number
License ID.
licenseType number
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
machineIp string
machine ip.
machineName string
machine name.
machineWanIp string
machine wan ip.
quuid string
Machine quota that needs to be bound.
resourceId string
Resource ID.
uuid string
uuid.
agent_status str
agent status.
cwp_license_bind_attachment_id str
ID of the resource.
is_switch_bind bool
Is it allowed to change the binding, false is not allowed to change the binding.
is_unbind bool
Allow unbinding, false does not allow unbinding.
license_id float
License ID.
license_type float
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
machine_ip str
machine ip.
machine_name str
machine name.
machine_wan_ip str
machine wan ip.
quuid str
Machine quota that needs to be bound.
resource_id str
Resource ID.
uuid str
uuid.
agentStatus String
agent status.
cwpLicenseBindAttachmentId String
ID of the resource.
isSwitchBind Boolean
Is it allowed to change the binding, false is not allowed to change the binding.
isUnbind Boolean
Allow unbinding, false does not allow unbinding.
licenseId Number
License ID.
licenseType Number
LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
machineIp String
machine ip.
machineName String
machine name.
machineWanIp String
machine wan ip.
quuid String
Machine quota that needs to be bound.
resourceId String
Resource ID.
uuid String
uuid.

Import

cwp license_bind_attachment can be imported using the id, e.g.

$ pulumi import tencentcloud:index/cwpLicenseBindAttachment:CwpLicenseBindAttachment example cwplic-ab3edffa#44#2c7e5cce-1cec-4456-8d18-018f160dd987#0
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.