1. Packages
  2. Volcengine
  3. API Docs
  4. tos
  5. BucketObject
Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine

volcengine.tos.BucketObject

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine

    Provides a resource to manage tos object

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Volcengine.Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Volcengine.Tos.BucketObject("default", new()
        {
            AccountAcls = new[]
            {
                new Volcengine.Tos.Inputs.BucketObjectAccountAclArgs
                {
                    AccountId = "1",
                    Permission = "READ",
                },
                new Volcengine.Tos.Inputs.BucketObjectAccountAclArgs
                {
                    AccountId = "2001",
                    Permission = "WRITE_ACP",
                },
            },
            BucketName = "test-xym-1",
            Encryption = "AES256",
            FilePath = "/Users/bytedance/Work/Go/build/test.txt",
            ObjectName = "demo_xym",
            PublicAcl = "private",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/tos"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tos.NewBucketObject(ctx, "default", &tos.BucketObjectArgs{
    			AccountAcls: tos.BucketObjectAccountAclArray{
    				&tos.BucketObjectAccountAclArgs{
    					AccountId:  pulumi.String("1"),
    					Permission: pulumi.String("READ"),
    				},
    				&tos.BucketObjectAccountAclArgs{
    					AccountId:  pulumi.String("2001"),
    					Permission: pulumi.String("WRITE_ACP"),
    				},
    			},
    			BucketName: pulumi.String("test-xym-1"),
    			Encryption: pulumi.String("AES256"),
    			FilePath:   pulumi.String("/Users/bytedance/Work/Go/build/test.txt"),
    			ObjectName: pulumi.String("demo_xym"),
    			PublicAcl:  pulumi.String("private"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.tos.BucketObject;
    import com.pulumi.volcengine.tos.BucketObjectArgs;
    import com.pulumi.volcengine.tos.inputs.BucketObjectAccountAclArgs;
    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 default_ = new BucketObject("default", BucketObjectArgs.builder()        
                .accountAcls(            
                    BucketObjectAccountAclArgs.builder()
                        .accountId("1")
                        .permission("READ")
                        .build(),
                    BucketObjectAccountAclArgs.builder()
                        .accountId("2001")
                        .permission("WRITE_ACP")
                        .build())
                .bucketName("test-xym-1")
                .encryption("AES256")
                .filePath("/Users/bytedance/Work/Go/build/test.txt")
                .objectName("demo_xym")
                .publicAcl("private")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    default = volcengine.tos.BucketObject("default",
        account_acls=[
            volcengine.tos.BucketObjectAccountAclArgs(
                account_id="1",
                permission="READ",
            ),
            volcengine.tos.BucketObjectAccountAclArgs(
                account_id="2001",
                permission="WRITE_ACP",
            ),
        ],
        bucket_name="test-xym-1",
        encryption="AES256",
        file_path="/Users/bytedance/Work/Go/build/test.txt",
        object_name="demo_xym",
        public_acl="private")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const _default = new volcengine.tos.BucketObject("default", {
        accountAcls: [
            {
                accountId: "1",
                permission: "READ",
            },
            {
                accountId: "2001",
                permission: "WRITE_ACP",
            },
        ],
        bucketName: "test-xym-1",
        encryption: "AES256",
        filePath: "/Users/bytedance/Work/Go/build/test.txt",
        objectName: "demo_xym",
        publicAcl: "private",
    });
    
    resources:
      default:
        type: volcengine:tos:BucketObject
        properties:
          accountAcls:
            - accountId: '1'
              permission: READ
            - accountId: '2001'
              permission: WRITE_ACP
          bucketName: test-xym-1
          encryption: AES256
          filePath: /Users/bytedance/Work/Go/build/test.txt
          objectName: demo_xym
          # storage_class ="IA"
          publicAcl: private
    

    Create BucketObject Resource

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

    Constructor syntax

    new BucketObject(name: string, args: BucketObjectArgs, opts?: CustomResourceOptions);
    @overload
    def BucketObject(resource_name: str,
                     args: BucketObjectArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def BucketObject(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     bucket_name: Optional[str] = None,
                     file_path: Optional[str] = None,
                     object_name: Optional[str] = None,
                     account_acls: Optional[Sequence[BucketObjectAccountAclArgs]] = None,
                     content_md5: Optional[str] = None,
                     content_type: Optional[str] = None,
                     encryption: Optional[str] = None,
                     public_acl: Optional[str] = None,
                     storage_class: Optional[str] = None)
    func NewBucketObject(ctx *Context, name string, args BucketObjectArgs, opts ...ResourceOption) (*BucketObject, error)
    public BucketObject(string name, BucketObjectArgs args, CustomResourceOptions? opts = null)
    public BucketObject(String name, BucketObjectArgs args)
    public BucketObject(String name, BucketObjectArgs args, CustomResourceOptions options)
    
    type: volcengine:tos:BucketObject
    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 BucketObjectArgs
    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 BucketObjectArgs
    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 BucketObjectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BucketObjectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BucketObjectArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var bucketObjectResource = new Volcengine.Tos.BucketObject("bucketObjectResource", new()
    {
        BucketName = "string",
        FilePath = "string",
        ObjectName = "string",
        AccountAcls = new[]
        {
            new Volcengine.Tos.Inputs.BucketObjectAccountAclArgs
            {
                AccountId = "string",
                Permission = "string",
                AclType = "string",
            },
        },
        ContentMd5 = "string",
        ContentType = "string",
        Encryption = "string",
        PublicAcl = "string",
        StorageClass = "string",
    });
    
    example, err := tos.NewBucketObject(ctx, "bucketObjectResource", &tos.BucketObjectArgs{
    	BucketName: pulumi.String("string"),
    	FilePath:   pulumi.String("string"),
    	ObjectName: pulumi.String("string"),
    	AccountAcls: tos.BucketObjectAccountAclArray{
    		&tos.BucketObjectAccountAclArgs{
    			AccountId:  pulumi.String("string"),
    			Permission: pulumi.String("string"),
    			AclType:    pulumi.String("string"),
    		},
    	},
    	ContentMd5:   pulumi.String("string"),
    	ContentType:  pulumi.String("string"),
    	Encryption:   pulumi.String("string"),
    	PublicAcl:    pulumi.String("string"),
    	StorageClass: pulumi.String("string"),
    })
    
    var bucketObjectResource = new BucketObject("bucketObjectResource", BucketObjectArgs.builder()        
        .bucketName("string")
        .filePath("string")
        .objectName("string")
        .accountAcls(BucketObjectAccountAclArgs.builder()
            .accountId("string")
            .permission("string")
            .aclType("string")
            .build())
        .contentMd5("string")
        .contentType("string")
        .encryption("string")
        .publicAcl("string")
        .storageClass("string")
        .build());
    
    bucket_object_resource = volcengine.tos.BucketObject("bucketObjectResource",
        bucket_name="string",
        file_path="string",
        object_name="string",
        account_acls=[volcengine.tos.BucketObjectAccountAclArgs(
            account_id="string",
            permission="string",
            acl_type="string",
        )],
        content_md5="string",
        content_type="string",
        encryption="string",
        public_acl="string",
        storage_class="string")
    
    const bucketObjectResource = new volcengine.tos.BucketObject("bucketObjectResource", {
        bucketName: "string",
        filePath: "string",
        objectName: "string",
        accountAcls: [{
            accountId: "string",
            permission: "string",
            aclType: "string",
        }],
        contentMd5: "string",
        contentType: "string",
        encryption: "string",
        publicAcl: "string",
        storageClass: "string",
    });
    
    type: volcengine:tos:BucketObject
    properties:
        accountAcls:
            - accountId: string
              aclType: string
              permission: string
        bucketName: string
        contentMd5: string
        contentType: string
        encryption: string
        filePath: string
        objectName: string
        publicAcl: string
        storageClass: string
    

    BucketObject Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The BucketObject resource accepts the following input properties:

    BucketName string
    The name of the bucket.
    FilePath string
    The file path for upload.
    ObjectName string
    The name of the object.
    AccountAcls List<Volcengine.BucketObjectAccountAcl>
    The user set of grant full control.
    ContentMd5 string
    The file md5 sum (32-bit hexadecimal string) for upload.
    ContentType string
    The content type of the object.
    Encryption string
    The encryption of the object.Valid value is AES256.
    PublicAcl string
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    StorageClass string
    The storage type of the object.Valid value is STANDARD|IA.
    BucketName string
    The name of the bucket.
    FilePath string
    The file path for upload.
    ObjectName string
    The name of the object.
    AccountAcls []BucketObjectAccountAclArgs
    The user set of grant full control.
    ContentMd5 string
    The file md5 sum (32-bit hexadecimal string) for upload.
    ContentType string
    The content type of the object.
    Encryption string
    The encryption of the object.Valid value is AES256.
    PublicAcl string
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    StorageClass string
    The storage type of the object.Valid value is STANDARD|IA.
    bucketName String
    The name of the bucket.
    filePath String
    The file path for upload.
    objectName String
    The name of the object.
    accountAcls List<BucketObjectAccountAcl>
    The user set of grant full control.
    contentMd5 String
    The file md5 sum (32-bit hexadecimal string) for upload.
    contentType String
    The content type of the object.
    encryption String
    The encryption of the object.Valid value is AES256.
    publicAcl String
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storageClass String
    The storage type of the object.Valid value is STANDARD|IA.
    bucketName string
    The name of the bucket.
    filePath string
    The file path for upload.
    objectName string
    The name of the object.
    accountAcls BucketObjectAccountAcl[]
    The user set of grant full control.
    contentMd5 string
    The file md5 sum (32-bit hexadecimal string) for upload.
    contentType string
    The content type of the object.
    encryption string
    The encryption of the object.Valid value is AES256.
    publicAcl string
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storageClass string
    The storage type of the object.Valid value is STANDARD|IA.
    bucket_name str
    The name of the bucket.
    file_path str
    The file path for upload.
    object_name str
    The name of the object.
    account_acls Sequence[BucketObjectAccountAclArgs]
    The user set of grant full control.
    content_md5 str
    The file md5 sum (32-bit hexadecimal string) for upload.
    content_type str
    The content type of the object.
    encryption str
    The encryption of the object.Valid value is AES256.
    public_acl str
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storage_class str
    The storage type of the object.Valid value is STANDARD|IA.
    bucketName String
    The name of the bucket.
    filePath String
    The file path for upload.
    objectName String
    The name of the object.
    accountAcls List<Property Map>
    The user set of grant full control.
    contentMd5 String
    The file md5 sum (32-bit hexadecimal string) for upload.
    contentType String
    The content type of the object.
    encryption String
    The encryption of the object.Valid value is AES256.
    publicAcl String
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storageClass String
    The storage type of the object.Valid value is STANDARD|IA.

    Outputs

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

    Content string
    The content the TOS Object when content type is json or text and xml.
    EnableVersion bool
    The flag of enable tos version.
    Id string
    The provider-assigned unique ID for this managed resource.
    VersionIds List<string>
    The version ids of the object if exist.
    Content string
    The content the TOS Object when content type is json or text and xml.
    EnableVersion bool
    The flag of enable tos version.
    Id string
    The provider-assigned unique ID for this managed resource.
    VersionIds []string
    The version ids of the object if exist.
    content String
    The content the TOS Object when content type is json or text and xml.
    enableVersion Boolean
    The flag of enable tos version.
    id String
    The provider-assigned unique ID for this managed resource.
    versionIds List<String>
    The version ids of the object if exist.
    content string
    The content the TOS Object when content type is json or text and xml.
    enableVersion boolean
    The flag of enable tos version.
    id string
    The provider-assigned unique ID for this managed resource.
    versionIds string[]
    The version ids of the object if exist.
    content str
    The content the TOS Object when content type is json or text and xml.
    enable_version bool
    The flag of enable tos version.
    id str
    The provider-assigned unique ID for this managed resource.
    version_ids Sequence[str]
    The version ids of the object if exist.
    content String
    The content the TOS Object when content type is json or text and xml.
    enableVersion Boolean
    The flag of enable tos version.
    id String
    The provider-assigned unique ID for this managed resource.
    versionIds List<String>
    The version ids of the object if exist.

    Look up Existing BucketObject Resource

    Get an existing BucketObject 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?: BucketObjectState, opts?: CustomResourceOptions): BucketObject
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_acls: Optional[Sequence[BucketObjectAccountAclArgs]] = None,
            bucket_name: Optional[str] = None,
            content: Optional[str] = None,
            content_md5: Optional[str] = None,
            content_type: Optional[str] = None,
            enable_version: Optional[bool] = None,
            encryption: Optional[str] = None,
            file_path: Optional[str] = None,
            object_name: Optional[str] = None,
            public_acl: Optional[str] = None,
            storage_class: Optional[str] = None,
            version_ids: Optional[Sequence[str]] = None) -> BucketObject
    func GetBucketObject(ctx *Context, name string, id IDInput, state *BucketObjectState, opts ...ResourceOption) (*BucketObject, error)
    public static BucketObject Get(string name, Input<string> id, BucketObjectState? state, CustomResourceOptions? opts = null)
    public static BucketObject get(String name, Output<String> id, BucketObjectState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AccountAcls List<Volcengine.BucketObjectAccountAcl>
    The user set of grant full control.
    BucketName string
    The name of the bucket.
    Content string
    The content the TOS Object when content type is json or text and xml.
    ContentMd5 string
    The file md5 sum (32-bit hexadecimal string) for upload.
    ContentType string
    The content type of the object.
    EnableVersion bool
    The flag of enable tos version.
    Encryption string
    The encryption of the object.Valid value is AES256.
    FilePath string
    The file path for upload.
    ObjectName string
    The name of the object.
    PublicAcl string
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    StorageClass string
    The storage type of the object.Valid value is STANDARD|IA.
    VersionIds List<string>
    The version ids of the object if exist.
    AccountAcls []BucketObjectAccountAclArgs
    The user set of grant full control.
    BucketName string
    The name of the bucket.
    Content string
    The content the TOS Object when content type is json or text and xml.
    ContentMd5 string
    The file md5 sum (32-bit hexadecimal string) for upload.
    ContentType string
    The content type of the object.
    EnableVersion bool
    The flag of enable tos version.
    Encryption string
    The encryption of the object.Valid value is AES256.
    FilePath string
    The file path for upload.
    ObjectName string
    The name of the object.
    PublicAcl string
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    StorageClass string
    The storage type of the object.Valid value is STANDARD|IA.
    VersionIds []string
    The version ids of the object if exist.
    accountAcls List<BucketObjectAccountAcl>
    The user set of grant full control.
    bucketName String
    The name of the bucket.
    content String
    The content the TOS Object when content type is json or text and xml.
    contentMd5 String
    The file md5 sum (32-bit hexadecimal string) for upload.
    contentType String
    The content type of the object.
    enableVersion Boolean
    The flag of enable tos version.
    encryption String
    The encryption of the object.Valid value is AES256.
    filePath String
    The file path for upload.
    objectName String
    The name of the object.
    publicAcl String
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storageClass String
    The storage type of the object.Valid value is STANDARD|IA.
    versionIds List<String>
    The version ids of the object if exist.
    accountAcls BucketObjectAccountAcl[]
    The user set of grant full control.
    bucketName string
    The name of the bucket.
    content string
    The content the TOS Object when content type is json or text and xml.
    contentMd5 string
    The file md5 sum (32-bit hexadecimal string) for upload.
    contentType string
    The content type of the object.
    enableVersion boolean
    The flag of enable tos version.
    encryption string
    The encryption of the object.Valid value is AES256.
    filePath string
    The file path for upload.
    objectName string
    The name of the object.
    publicAcl string
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storageClass string
    The storage type of the object.Valid value is STANDARD|IA.
    versionIds string[]
    The version ids of the object if exist.
    account_acls Sequence[BucketObjectAccountAclArgs]
    The user set of grant full control.
    bucket_name str
    The name of the bucket.
    content str
    The content the TOS Object when content type is json or text and xml.
    content_md5 str
    The file md5 sum (32-bit hexadecimal string) for upload.
    content_type str
    The content type of the object.
    enable_version bool
    The flag of enable tos version.
    encryption str
    The encryption of the object.Valid value is AES256.
    file_path str
    The file path for upload.
    object_name str
    The name of the object.
    public_acl str
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storage_class str
    The storage type of the object.Valid value is STANDARD|IA.
    version_ids Sequence[str]
    The version ids of the object if exist.
    accountAcls List<Property Map>
    The user set of grant full control.
    bucketName String
    The name of the bucket.
    content String
    The content the TOS Object when content type is json or text and xml.
    contentMd5 String
    The file md5 sum (32-bit hexadecimal string) for upload.
    contentType String
    The content type of the object.
    enableVersion Boolean
    The flag of enable tos version.
    encryption String
    The encryption of the object.Valid value is AES256.
    filePath String
    The file path for upload.
    objectName String
    The name of the object.
    publicAcl String
    The public acl control of object.Valid value is private|public-read|public-read-write|authenticated-read|bucket-owner-read.
    storageClass String
    The storage type of the object.Valid value is STANDARD|IA.
    versionIds List<String>
    The version ids of the object if exist.

    Supporting Types

    BucketObjectAccountAcl, BucketObjectAccountAclArgs

    AccountId string
    The accountId to control.
    Permission string
    The permission to control.Valid value is FULL_CONTROL|READ|READ_ACP|WRITE|WRITE_ACP.
    AclType string
    The acl type to control.Valid value is CanonicalUser.
    AccountId string
    The accountId to control.
    Permission string
    The permission to control.Valid value is FULL_CONTROL|READ|READ_ACP|WRITE|WRITE_ACP.
    AclType string
    The acl type to control.Valid value is CanonicalUser.
    accountId String
    The accountId to control.
    permission String
    The permission to control.Valid value is FULL_CONTROL|READ|READ_ACP|WRITE|WRITE_ACP.
    aclType String
    The acl type to control.Valid value is CanonicalUser.
    accountId string
    The accountId to control.
    permission string
    The permission to control.Valid value is FULL_CONTROL|READ|READ_ACP|WRITE|WRITE_ACP.
    aclType string
    The acl type to control.Valid value is CanonicalUser.
    account_id str
    The accountId to control.
    permission str
    The permission to control.Valid value is FULL_CONTROL|READ|READ_ACP|WRITE|WRITE_ACP.
    acl_type str
    The acl type to control.Valid value is CanonicalUser.
    accountId String
    The accountId to control.
    permission String
    The permission to control.Valid value is FULL_CONTROL|READ|READ_ACP|WRITE|WRITE_ACP.
    aclType String
    The acl type to control.Valid value is CanonicalUser.

    Import

    TOS Object can be imported using the id, e.g.

     $ pulumi import volcengine:tos/bucketObject:BucketObject default bucketName:objectName
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine