1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. DcdbCancelDcnJobOperation
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.DcdbCancelDcnJobOperation

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a dcdb cancel_dcn_job_operation

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const internal = tencentcloud.getSecurityGroups({
        name: "default",
    });
    const vpc = tencentcloud.getVpcInstances({
        name: "Default-VPC",
    });
    const subnet = vpc.then(vpc => tencentcloud.getVpcSubnets({
        vpcId: vpc.instanceLists?.[0]?.vpcId,
    }));
    const vpcId = subnet.then(subnet => subnet.instanceLists?.[0]?.vpcId);
    const subnetId = subnet.then(subnet => subnet.instanceLists?.[0]?.subnetId);
    const sgId = internal.then(internal => internal.securityGroups?.[0]?.securityGroupId);
    const hourdbInstanceDcn = new tencentcloud.DcdbHourdbInstance("hourdbInstanceDcn", {
        instanceName: "test_dcdb_db_hourdb_instance_dcn",
        zones: [_var.default_az],
        shardMemory: 2,
        shardStorage: 10,
        shardNodeCount: 2,
        shardCount: 2,
        vpcId: vpcId,
        subnetId: subnetId,
        securityGroupId: sgId,
        dbVersionId: "8.0",
        dcnRegion: "ap-guangzhou",
        dcnInstanceId: local.dcdb_id,
        resourceTags: [{
            tagKey: "aaa",
            tagValue: "bbb",
        }],
    });
    const dcnDcdbId = hourdbInstanceDcn.dcdbHourdbInstanceId;
    const cancelOperation = new tencentcloud.DcdbCancelDcnJobOperation("cancelOperation", {instanceId: dcnDcdbId});
    // cancel the dcn/readonly instance
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    internal = tencentcloud.get_security_groups(name="default")
    vpc = tencentcloud.get_vpc_instances(name="Default-VPC")
    subnet = tencentcloud.get_vpc_subnets(vpc_id=vpc.instance_lists[0].vpc_id)
    vpc_id = subnet.instance_lists[0].vpc_id
    subnet_id = subnet.instance_lists[0].subnet_id
    sg_id = internal.security_groups[0].security_group_id
    hourdb_instance_dcn = tencentcloud.DcdbHourdbInstance("hourdbInstanceDcn",
        instance_name="test_dcdb_db_hourdb_instance_dcn",
        zones=[var["default_az"]],
        shard_memory=2,
        shard_storage=10,
        shard_node_count=2,
        shard_count=2,
        vpc_id=vpc_id,
        subnet_id=subnet_id,
        security_group_id=sg_id,
        db_version_id="8.0",
        dcn_region="ap-guangzhou",
        dcn_instance_id=local["dcdb_id"],
        resource_tags=[{
            "tag_key": "aaa",
            "tag_value": "bbb",
        }])
    dcn_dcdb_id = hourdb_instance_dcn.dcdb_hourdb_instance_id
    cancel_operation = tencentcloud.DcdbCancelDcnJobOperation("cancelOperation", instance_id=dcn_dcdb_id)
    # cancel the dcn/readonly instance
    
    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 {
    		internal, err := tencentcloud.GetSecurityGroups(ctx, &tencentcloud.GetSecurityGroupsArgs{
    			Name: pulumi.StringRef("default"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vpc, err := tencentcloud.GetVpcInstances(ctx, &tencentcloud.GetVpcInstancesArgs{
    			Name: pulumi.StringRef("Default-VPC"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		subnet, err := tencentcloud.GetVpcSubnets(ctx, &tencentcloud.GetVpcSubnetsArgs{
    			VpcId: pulumi.StringRef(vpc.InstanceLists[0].VpcId),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vpcId := subnet.InstanceLists[0].VpcId
    		subnetId := subnet.InstanceLists[0].SubnetId
    		sgId := internal.SecurityGroups[0].SecurityGroupId
    		hourdbInstanceDcn, err := tencentcloud.NewDcdbHourdbInstance(ctx, "hourdbInstanceDcn", &tencentcloud.DcdbHourdbInstanceArgs{
    			InstanceName: pulumi.String("test_dcdb_db_hourdb_instance_dcn"),
    			Zones: pulumi.StringArray{
    				_var.Default_az,
    			},
    			ShardMemory:     pulumi.Float64(2),
    			ShardStorage:    pulumi.Float64(10),
    			ShardNodeCount:  pulumi.Float64(2),
    			ShardCount:      pulumi.Float64(2),
    			VpcId:           pulumi.String(vpcId),
    			SubnetId:        pulumi.String(subnetId),
    			SecurityGroupId: pulumi.String(sgId),
    			DbVersionId:     pulumi.String("8.0"),
    			DcnRegion:       pulumi.String("ap-guangzhou"),
    			DcnInstanceId:   pulumi.Any(local.Dcdb_id),
    			ResourceTags: tencentcloud.DcdbHourdbInstanceResourceTagArray{
    				&tencentcloud.DcdbHourdbInstanceResourceTagArgs{
    					TagKey:   pulumi.String("aaa"),
    					TagValue: pulumi.String("bbb"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		dcnDcdbId := hourdbInstanceDcn.DcdbHourdbInstanceId
    		_, err = tencentcloud.NewDcdbCancelDcnJobOperation(ctx, "cancelOperation", &tencentcloud.DcdbCancelDcnJobOperationArgs{
    			InstanceId: pulumi.String(dcnDcdbId),
    		})
    		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 @internal = Tencentcloud.GetSecurityGroups.Invoke(new()
        {
            Name = "default",
        });
    
        var vpc = Tencentcloud.GetVpcInstances.Invoke(new()
        {
            Name = "Default-VPC",
        });
    
        var subnet = Tencentcloud.GetVpcSubnets.Invoke(new()
        {
            VpcId = vpc.Apply(getVpcInstancesResult => getVpcInstancesResult.InstanceLists[0]?.VpcId),
        });
    
        var vpcId = subnet.Apply(getVpcSubnetsResult => getVpcSubnetsResult.InstanceLists[0]?.VpcId);
    
        var subnetId = subnet.Apply(getVpcSubnetsResult => getVpcSubnetsResult.InstanceLists[0]?.SubnetId);
    
        var sgId = @internal.Apply(@internal => @internal.Apply(getSecurityGroupsResult => getSecurityGroupsResult.SecurityGroups[0]?.SecurityGroupId));
    
        var hourdbInstanceDcn = new Tencentcloud.DcdbHourdbInstance("hourdbInstanceDcn", new()
        {
            InstanceName = "test_dcdb_db_hourdb_instance_dcn",
            Zones = new[]
            {
                @var.Default_az,
            },
            ShardMemory = 2,
            ShardStorage = 10,
            ShardNodeCount = 2,
            ShardCount = 2,
            VpcId = vpcId,
            SubnetId = subnetId,
            SecurityGroupId = sgId,
            DbVersionId = "8.0",
            DcnRegion = "ap-guangzhou",
            DcnInstanceId = local.Dcdb_id,
            ResourceTags = new[]
            {
                new Tencentcloud.Inputs.DcdbHourdbInstanceResourceTagArgs
                {
                    TagKey = "aaa",
                    TagValue = "bbb",
                },
            },
        });
    
        var dcnDcdbId = hourdbInstanceDcn.DcdbHourdbInstanceId;
    
        var cancelOperation = new Tencentcloud.DcdbCancelDcnJobOperation("cancelOperation", new()
        {
            InstanceId = dcnDcdbId,
        });
    
        // cancel the dcn/readonly instance
    });
    
    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.GetSecurityGroupsArgs;
    import com.pulumi.tencentcloud.inputs.GetVpcInstancesArgs;
    import com.pulumi.tencentcloud.inputs.GetVpcSubnetsArgs;
    import com.pulumi.tencentcloud.DcdbHourdbInstance;
    import com.pulumi.tencentcloud.DcdbHourdbInstanceArgs;
    import com.pulumi.tencentcloud.inputs.DcdbHourdbInstanceResourceTagArgs;
    import com.pulumi.tencentcloud.DcdbCancelDcnJobOperation;
    import com.pulumi.tencentcloud.DcdbCancelDcnJobOperationArgs;
    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 internal = TencentcloudFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .name("default")
                .build());
    
            final var vpc = TencentcloudFunctions.getVpcInstances(GetVpcInstancesArgs.builder()
                .name("Default-VPC")
                .build());
    
            final var subnet = TencentcloudFunctions.getVpcSubnets(GetVpcSubnetsArgs.builder()
                .vpcId(vpc.applyValue(getVpcInstancesResult -> getVpcInstancesResult.instanceLists()[0].vpcId()))
                .build());
    
            final var vpcId = subnet.applyValue(getVpcSubnetsResult -> getVpcSubnetsResult.instanceLists()[0].vpcId());
    
            final var subnetId = subnet.applyValue(getVpcSubnetsResult -> getVpcSubnetsResult.instanceLists()[0].subnetId());
    
            final var sgId = internal.applyValue(getSecurityGroupsResult -> getSecurityGroupsResult.securityGroups()[0].securityGroupId());
    
            var hourdbInstanceDcn = new DcdbHourdbInstance("hourdbInstanceDcn", DcdbHourdbInstanceArgs.builder()
                .instanceName("test_dcdb_db_hourdb_instance_dcn")
                .zones(var_.default_az())
                .shardMemory("2")
                .shardStorage("10")
                .shardNodeCount("2")
                .shardCount("2")
                .vpcId(vpcId)
                .subnetId(subnetId)
                .securityGroupId(sgId)
                .dbVersionId("8.0")
                .dcnRegion("ap-guangzhou")
                .dcnInstanceId(local.dcdb_id())
                .resourceTags(DcdbHourdbInstanceResourceTagArgs.builder()
                    .tagKey("aaa")
                    .tagValue("bbb")
                    .build())
                .build());
    
            final var dcnDcdbId = hourdbInstanceDcn.dcdbHourdbInstanceId();
    
            var cancelOperation = new DcdbCancelDcnJobOperation("cancelOperation", DcdbCancelDcnJobOperationArgs.builder()
                .instanceId(dcnDcdbId)
                .build());
    
            // cancel the dcn/readonly instance
        }
    }
    
    resources:
      hourdbInstanceDcn:
        type: tencentcloud:DcdbHourdbInstance
        properties:
          instanceName: test_dcdb_db_hourdb_instance_dcn
          zones:
            - ${var.default_az}
          shardMemory: '2'
          shardStorage: '10'
          shardNodeCount: '2'
          shardCount: '2'
          vpcId: ${vpcId}
          subnetId: ${subnetId}
          securityGroupId: ${sgId}
          dbVersionId: '8.0'
          dcnRegion: ap-guangzhou
          dcnInstanceId: ${local.dcdb_id}
          # master_instance
          resourceTags:
            - tagKey: aaa
              tagValue: bbb
      cancelOperation:
        type: tencentcloud:DcdbCancelDcnJobOperation
        properties:
          instanceId: ${dcnDcdbId}
    variables:
      internal:
        fn::invoke:
          function: tencentcloud:getSecurityGroups
          arguments:
            name: default
      vpc:
        fn::invoke:
          function: tencentcloud:getVpcInstances
          arguments:
            name: Default-VPC
      subnet:
        fn::invoke:
          function: tencentcloud:getVpcSubnets
          arguments:
            vpcId: ${vpc.instanceLists[0].vpcId}
      vpcId: ${subnet.instanceLists[0].vpcId}
      subnetId: ${subnet.instanceLists[0].subnetId}
      sgId: ${internal.securityGroups[0].securityGroupId}
      dcnDcdbId: ${hourdbInstanceDcn.dcdbHourdbInstanceId}
    

    Create DcdbCancelDcnJobOperation Resource

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

    Constructor syntax

    new DcdbCancelDcnJobOperation(name: string, args: DcdbCancelDcnJobOperationArgs, opts?: CustomResourceOptions);
    @overload
    def DcdbCancelDcnJobOperation(resource_name: str,
                                  args: DcdbCancelDcnJobOperationArgs,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def DcdbCancelDcnJobOperation(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  instance_id: Optional[str] = None,
                                  dcdb_cancel_dcn_job_operation_id: Optional[str] = None)
    func NewDcdbCancelDcnJobOperation(ctx *Context, name string, args DcdbCancelDcnJobOperationArgs, opts ...ResourceOption) (*DcdbCancelDcnJobOperation, error)
    public DcdbCancelDcnJobOperation(string name, DcdbCancelDcnJobOperationArgs args, CustomResourceOptions? opts = null)
    public DcdbCancelDcnJobOperation(String name, DcdbCancelDcnJobOperationArgs args)
    public DcdbCancelDcnJobOperation(String name, DcdbCancelDcnJobOperationArgs args, CustomResourceOptions options)
    
    type: tencentcloud:DcdbCancelDcnJobOperation
    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 DcdbCancelDcnJobOperationArgs
    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 DcdbCancelDcnJobOperationArgs
    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 DcdbCancelDcnJobOperationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DcdbCancelDcnJobOperationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DcdbCancelDcnJobOperationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    InstanceId string
    Instance ID.
    DcdbCancelDcnJobOperationId string
    ID of the resource.
    InstanceId string
    Instance ID.
    DcdbCancelDcnJobOperationId string
    ID of the resource.
    instanceId String
    Instance ID.
    dcdbCancelDcnJobOperationId String
    ID of the resource.
    instanceId string
    Instance ID.
    dcdbCancelDcnJobOperationId string
    ID of the resource.
    instance_id str
    Instance ID.
    dcdb_cancel_dcn_job_operation_id str
    ID of the resource.
    instanceId String
    Instance ID.
    dcdbCancelDcnJobOperationId String
    ID of the resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DcdbCancelDcnJobOperation Resource

    Get an existing DcdbCancelDcnJobOperation 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?: DcdbCancelDcnJobOperationState, opts?: CustomResourceOptions): DcdbCancelDcnJobOperation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dcdb_cancel_dcn_job_operation_id: Optional[str] = None,
            instance_id: Optional[str] = None) -> DcdbCancelDcnJobOperation
    func GetDcdbCancelDcnJobOperation(ctx *Context, name string, id IDInput, state *DcdbCancelDcnJobOperationState, opts ...ResourceOption) (*DcdbCancelDcnJobOperation, error)
    public static DcdbCancelDcnJobOperation Get(string name, Input<string> id, DcdbCancelDcnJobOperationState? state, CustomResourceOptions? opts = null)
    public static DcdbCancelDcnJobOperation get(String name, Output<String> id, DcdbCancelDcnJobOperationState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:DcdbCancelDcnJobOperation    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.
    The following state arguments are supported:
    DcdbCancelDcnJobOperationId string
    ID of the resource.
    InstanceId string
    Instance ID.
    DcdbCancelDcnJobOperationId string
    ID of the resource.
    InstanceId string
    Instance ID.
    dcdbCancelDcnJobOperationId String
    ID of the resource.
    instanceId String
    Instance ID.
    dcdbCancelDcnJobOperationId string
    ID of the resource.
    instanceId string
    Instance ID.
    dcdb_cancel_dcn_job_operation_id str
    ID of the resource.
    instance_id str
    Instance ID.
    dcdbCancelDcnJobOperationId String
    ID of the resource.
    instanceId String
    Instance ID.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack