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),
});
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)
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
})
}
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),
});
});
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());
}
}
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
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 string
- The unique name of the resource.
- args CwpLicenseBindAttachmentArgs
- 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 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 string
- The unique name of the resource.
- args CwpLicenseBindAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CwpLicenseBindAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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:
- License
Id double - License ID.
- License
Type double - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- Quuid string
- Machine quota that needs to be bound.
- Resource
Id string - Resource ID.
- Cwp
License stringBind Attachment Id - ID of the resource.
- License
Id float64 - License ID.
- License
Type float64 - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- Quuid string
- Machine quota that needs to be bound.
- Resource
Id string - Resource ID.
- Cwp
License stringBind Attachment Id - ID of the resource.
- license
Id Double - License ID.
- license
Type Double - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- quuid String
- Machine quota that needs to be bound.
- resource
Id String - Resource ID.
- cwp
License StringBind Attachment Id - ID of the resource.
- license
Id number - License ID.
- license
Type number - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- quuid string
- Machine quota that needs to be bound.
- resource
Id string - Resource ID.
- cwp
License stringBind Attachment Id - ID of the resource.
- 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.
- quuid str
- Machine quota that needs to be bound.
- resource_
id str - Resource ID.
- cwp_
license_ strbind_ attachment_ id - ID of the resource.
- license
Id Number - License ID.
- license
Type Number - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- quuid String
- Machine quota that needs to be bound.
- resource
Id String - Resource ID.
- cwp
License StringBind Attachment Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the CwpLicenseBindAttachment resource produces the following output properties:
- Agent
Status string - agent status.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Switch boolBind - 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 string - machine ip.
- Machine
Name string - machine name.
- Machine
Wan stringIp - machine wan ip.
- Uuid string
- uuid.
- Agent
Status string - agent status.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Switch boolBind - 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 string - machine ip.
- Machine
Name string - machine name.
- Machine
Wan stringIp - machine wan ip.
- Uuid string
- uuid.
- agent
Status String - agent status.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Switch BooleanBind - Is it allowed to change the binding, false is not allowed to change the binding.
- is
Unbind Boolean - Allow unbinding, false does not allow unbinding.
- machine
Ip String - machine ip.
- machine
Name String - machine name.
- machine
Wan StringIp - machine wan ip.
- uuid String
- uuid.
- agent
Status string - agent status.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Switch booleanBind - Is it allowed to change the binding, false is not allowed to change the binding.
- is
Unbind boolean - Allow unbinding, false does not allow unbinding.
- machine
Ip string - machine ip.
- machine
Name string - machine name.
- machine
Wan stringIp - machine wan ip.
- uuid string
- uuid.
- agent_
status str - agent status.
- id str
- The provider-assigned unique ID for this managed resource.
- is_
switch_ boolbind - 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_ strip - machine wan ip.
- uuid str
- uuid.
- agent
Status String - agent status.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Switch BooleanBind - Is it allowed to change the binding, false is not allowed to change the binding.
- is
Unbind Boolean - Allow unbinding, false does not allow unbinding.
- machine
Ip String - machine ip.
- machine
Name String - machine name.
- machine
Wan StringIp - 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
- 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.
- Agent
Status string - agent status.
- Cwp
License stringBind Attachment Id - ID of the resource.
- Is
Switch boolBind - 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 double - License ID.
- License
Type double - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- Machine
Ip string - machine ip.
- Machine
Name string - machine name.
- Machine
Wan stringIp - machine wan ip.
- Quuid string
- Machine quota that needs to be bound.
- Resource
Id string - Resource ID.
- Uuid string
- uuid.
- Agent
Status string - agent status.
- Cwp
License stringBind Attachment Id - ID of the resource.
- Is
Switch boolBind - 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 float64 - License ID.
- License
Type float64 - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- Machine
Ip string - machine ip.
- Machine
Name string - machine name.
- Machine
Wan stringIp - machine wan ip.
- Quuid string
- Machine quota that needs to be bound.
- Resource
Id string - Resource ID.
- Uuid string
- uuid.
- agent
Status String - agent status.
- cwp
License StringBind Attachment Id - ID of the resource.
- is
Switch BooleanBind - Is it allowed to change the binding, false is not allowed to change the binding.
- is
Unbind Boolean - Allow unbinding, false does not allow unbinding.
- license
Id Double - License ID.
- license
Type Double - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- machine
Ip String - machine ip.
- machine
Name String - machine name.
- machine
Wan StringIp - machine wan ip.
- quuid String
- Machine quota that needs to be bound.
- resource
Id String - Resource ID.
- uuid String
- uuid.
- agent
Status string - agent status.
- cwp
License stringBind Attachment Id - ID of the resource.
- is
Switch booleanBind - Is it allowed to change the binding, false is not allowed to change the binding.
- is
Unbind boolean - Allow unbinding, false does not allow unbinding.
- license
Id number - License ID.
- license
Type number - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- machine
Ip string - machine ip.
- machine
Name string - machine name.
- machine
Wan stringIp - machine wan ip.
- quuid string
- Machine quota that needs to be bound.
- resource
Id string - Resource ID.
- uuid string
- uuid.
- agent_
status str - agent status.
- cwp_
license_ strbind_ attachment_ id - ID of the resource.
- is_
switch_ boolbind - 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_ strip - machine wan ip.
- quuid str
- Machine quota that needs to be bound.
- resource_
id str - Resource ID.
- uuid str
- uuid.
- agent
Status String - agent status.
- cwp
License StringBind Attachment Id - ID of the resource.
- is
Switch BooleanBind - Is it allowed to change the binding, false is not allowed to change the binding.
- is
Unbind Boolean - Allow unbinding, false does not allow unbinding.
- license
Id Number - License ID.
- license
Type Number - LicenseType, 0 CWP Pro - Pay as you go, 1 CWP Pro - Monthly subscription, 2 CWP Ultimate - Monthly subscription. Default is 0.
- machine
Ip String - machine ip.
- machine
Name String - machine name.
- machine
Wan StringIp - machine wan ip.
- quuid String
- Machine quota that needs to be bound.
- resource
Id 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
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.