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

tencentcloud.CosObjectCopyOperation

Explore with Pulumi AI

Provides a resource to copy object

Example Usage

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

const objectCopy = new tencentcloud.CosObjectCopyOperation("objectCopy", {
    bucket: "keep-copy-xxxxxxx",
    key: "copy-acl.txt",
    sourceUrl: "keep-test-xxxxxx.cos.ap-guangzhou.myqcloud.com/acl.txt",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

object_copy = tencentcloud.CosObjectCopyOperation("objectCopy",
    bucket="keep-copy-xxxxxxx",
    key="copy-acl.txt",
    source_url="keep-test-xxxxxx.cos.ap-guangzhou.myqcloud.com/acl.txt")
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.NewCosObjectCopyOperation(ctx, "objectCopy", &tencentcloud.CosObjectCopyOperationArgs{
			Bucket:    pulumi.String("keep-copy-xxxxxxx"),
			Key:       pulumi.String("copy-acl.txt"),
			SourceUrl: pulumi.String("keep-test-xxxxxx.cos.ap-guangzhou.myqcloud.com/acl.txt"),
		})
		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 objectCopy = new Tencentcloud.CosObjectCopyOperation("objectCopy", new()
    {
        Bucket = "keep-copy-xxxxxxx",
        Key = "copy-acl.txt",
        SourceUrl = "keep-test-xxxxxx.cos.ap-guangzhou.myqcloud.com/acl.txt",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.CosObjectCopyOperation;
import com.pulumi.tencentcloud.CosObjectCopyOperationArgs;
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 objectCopy = new CosObjectCopyOperation("objectCopy", CosObjectCopyOperationArgs.builder()
            .bucket("keep-copy-xxxxxxx")
            .key("copy-acl.txt")
            .sourceUrl("keep-test-xxxxxx.cos.ap-guangzhou.myqcloud.com/acl.txt")
            .build());

    }
}
Copy
resources:
  objectCopy:
    type: tencentcloud:CosObjectCopyOperation
    properties:
      bucket: keep-copy-xxxxxxx
      key: copy-acl.txt
      sourceUrl: keep-test-xxxxxx.cos.ap-guangzhou.myqcloud.com/acl.txt
Copy

Create CosObjectCopyOperation Resource

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

Constructor syntax

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

@overload
def CosObjectCopyOperation(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           bucket: Optional[str] = None,
                           key: Optional[str] = None,
                           source_url: Optional[str] = None,
                           cos_object_copy_operation_id: Optional[str] = None)
func NewCosObjectCopyOperation(ctx *Context, name string, args CosObjectCopyOperationArgs, opts ...ResourceOption) (*CosObjectCopyOperation, error)
public CosObjectCopyOperation(string name, CosObjectCopyOperationArgs args, CustomResourceOptions? opts = null)
public CosObjectCopyOperation(String name, CosObjectCopyOperationArgs args)
public CosObjectCopyOperation(String name, CosObjectCopyOperationArgs args, CustomResourceOptions options)
type: tencentcloud:CosObjectCopyOperation
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. CosObjectCopyOperationArgs
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. CosObjectCopyOperationArgs
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. CosObjectCopyOperationArgs
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. CosObjectCopyOperationArgs
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. CosObjectCopyOperationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Bucket This property is required. string
Bucket.
Key This property is required. string
Object key.
SourceUrl This property is required. string
Source url. In the CDC scenario, the CDC source url is used.
CosObjectCopyOperationId string
ID of the resource.
Bucket This property is required. string
Bucket.
Key This property is required. string
Object key.
SourceUrl This property is required. string
Source url. In the CDC scenario, the CDC source url is used.
CosObjectCopyOperationId string
ID of the resource.
bucket This property is required. String
Bucket.
key This property is required. String
Object key.
sourceUrl This property is required. String
Source url. In the CDC scenario, the CDC source url is used.
cosObjectCopyOperationId String
ID of the resource.
bucket This property is required. string
Bucket.
key This property is required. string
Object key.
sourceUrl This property is required. string
Source url. In the CDC scenario, the CDC source url is used.
cosObjectCopyOperationId string
ID of the resource.
bucket This property is required. str
Bucket.
key This property is required. str
Object key.
source_url This property is required. str
Source url. In the CDC scenario, the CDC source url is used.
cos_object_copy_operation_id str
ID of the resource.
bucket This property is required. String
Bucket.
key This property is required. String
Object key.
sourceUrl This property is required. String
Source url. In the CDC scenario, the CDC source url is used.
cosObjectCopyOperationId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the CosObjectCopyOperation 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 CosObjectCopyOperation Resource

Get an existing CosObjectCopyOperation 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?: CosObjectCopyOperationState, opts?: CustomResourceOptions): CosObjectCopyOperation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        cos_object_copy_operation_id: Optional[str] = None,
        key: Optional[str] = None,
        source_url: Optional[str] = None) -> CosObjectCopyOperation
func GetCosObjectCopyOperation(ctx *Context, name string, id IDInput, state *CosObjectCopyOperationState, opts ...ResourceOption) (*CosObjectCopyOperation, error)
public static CosObjectCopyOperation Get(string name, Input<string> id, CosObjectCopyOperationState? state, CustomResourceOptions? opts = null)
public static CosObjectCopyOperation get(String name, Output<String> id, CosObjectCopyOperationState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:CosObjectCopyOperation    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:
Bucket string
Bucket.
CosObjectCopyOperationId string
ID of the resource.
Key string
Object key.
SourceUrl string
Source url. In the CDC scenario, the CDC source url is used.
Bucket string
Bucket.
CosObjectCopyOperationId string
ID of the resource.
Key string
Object key.
SourceUrl string
Source url. In the CDC scenario, the CDC source url is used.
bucket String
Bucket.
cosObjectCopyOperationId String
ID of the resource.
key String
Object key.
sourceUrl String
Source url. In the CDC scenario, the CDC source url is used.
bucket string
Bucket.
cosObjectCopyOperationId string
ID of the resource.
key string
Object key.
sourceUrl string
Source url. In the CDC scenario, the CDC source url is used.
bucket str
Bucket.
cos_object_copy_operation_id str
ID of the resource.
key str
Object key.
source_url str
Source url. In the CDC scenario, the CDC source url is used.
bucket String
Bucket.
cosObjectCopyOperationId String
ID of the resource.
key String
Object key.
sourceUrl String
Source url. In the CDC scenario, the CDC source url is used.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.