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

tencentcloud.CosBucketReferer

Explore with Pulumi AI

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

    Provides a resource to create a cos bucket_referer

    NOTE: The current resource does not support cdc.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const bucketReferer = new tencentcloud.CosBucketReferer("bucketReferer", {
        bucket: "mycos-1258798060",
        domainLists: [
            "127.0.0.1",
            "terraform.com",
        ],
        emptyReferConfiguration: "Allow",
        refererType: "Black-List",
        status: "Enabled",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    bucket_referer = tencentcloud.CosBucketReferer("bucketReferer",
        bucket="mycos-1258798060",
        domain_lists=[
            "127.0.0.1",
            "terraform.com",
        ],
        empty_refer_configuration="Allow",
        referer_type="Black-List",
        status="Enabled")
    
    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.NewCosBucketReferer(ctx, "bucketReferer", &tencentcloud.CosBucketRefererArgs{
    			Bucket: pulumi.String("mycos-1258798060"),
    			DomainLists: pulumi.StringArray{
    				pulumi.String("127.0.0.1"),
    				pulumi.String("terraform.com"),
    			},
    			EmptyReferConfiguration: pulumi.String("Allow"),
    			RefererType:             pulumi.String("Black-List"),
    			Status:                  pulumi.String("Enabled"),
    		})
    		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 bucketReferer = new Tencentcloud.CosBucketReferer("bucketReferer", new()
        {
            Bucket = "mycos-1258798060",
            DomainLists = new[]
            {
                "127.0.0.1",
                "terraform.com",
            },
            EmptyReferConfiguration = "Allow",
            RefererType = "Black-List",
            Status = "Enabled",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CosBucketReferer;
    import com.pulumi.tencentcloud.CosBucketRefererArgs;
    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 bucketReferer = new CosBucketReferer("bucketReferer", CosBucketRefererArgs.builder()
                .bucket("mycos-1258798060")
                .domainLists(            
                    "127.0.0.1",
                    "terraform.com")
                .emptyReferConfiguration("Allow")
                .refererType("Black-List")
                .status("Enabled")
                .build());
    
        }
    }
    
    resources:
      bucketReferer:
        type: tencentcloud:CosBucketReferer
        properties:
          bucket: mycos-1258798060
          domainLists:
            - 127.0.0.1
            - terraform.com
          emptyReferConfiguration: Allow
          refererType: Black-List
          status: Enabled
    

    Create CosBucketReferer Resource

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

    Constructor syntax

    new CosBucketReferer(name: string, args: CosBucketRefererArgs, opts?: CustomResourceOptions);
    @overload
    def CosBucketReferer(resource_name: str,
                         args: CosBucketRefererArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def CosBucketReferer(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         bucket: Optional[str] = None,
                         domain_lists: Optional[Sequence[str]] = None,
                         referer_type: Optional[str] = None,
                         status: Optional[str] = None,
                         cos_bucket_referer_id: Optional[str] = None,
                         empty_refer_configuration: Optional[str] = None)
    func NewCosBucketReferer(ctx *Context, name string, args CosBucketRefererArgs, opts ...ResourceOption) (*CosBucketReferer, error)
    public CosBucketReferer(string name, CosBucketRefererArgs args, CustomResourceOptions? opts = null)
    public CosBucketReferer(String name, CosBucketRefererArgs args)
    public CosBucketReferer(String name, CosBucketRefererArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CosBucketReferer
    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 CosBucketRefererArgs
    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 CosBucketRefererArgs
    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 CosBucketRefererArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CosBucketRefererArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CosBucketRefererArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Bucket string
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    DomainLists List<string>
    A list of domain names in the blocklist/allowlist.
    RefererType string
    Hotlink protection type. Enumerated values: Black-List, White-List.
    Status string
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    CosBucketRefererId string
    ID of the resource.
    EmptyReferConfiguration string
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    Bucket string
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    DomainLists []string
    A list of domain names in the blocklist/allowlist.
    RefererType string
    Hotlink protection type. Enumerated values: Black-List, White-List.
    Status string
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    CosBucketRefererId string
    ID of the resource.
    EmptyReferConfiguration string
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    bucket String
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    domainLists List<String>
    A list of domain names in the blocklist/allowlist.
    refererType String
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status String
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    cosBucketRefererId String
    ID of the resource.
    emptyReferConfiguration String
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    bucket string
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    domainLists string[]
    A list of domain names in the blocklist/allowlist.
    refererType string
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status string
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    cosBucketRefererId string
    ID of the resource.
    emptyReferConfiguration string
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    bucket str
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    domain_lists Sequence[str]
    A list of domain names in the blocklist/allowlist.
    referer_type str
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status str
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    cos_bucket_referer_id str
    ID of the resource.
    empty_refer_configuration str
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    bucket String
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    domainLists List<String>
    A list of domain names in the blocklist/allowlist.
    refererType String
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status String
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    cosBucketRefererId String
    ID of the resource.
    emptyReferConfiguration String
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).

    Outputs

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

    Get an existing CosBucketReferer 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?: CosBucketRefererState, opts?: CustomResourceOptions): CosBucketReferer
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket: Optional[str] = None,
            cos_bucket_referer_id: Optional[str] = None,
            domain_lists: Optional[Sequence[str]] = None,
            empty_refer_configuration: Optional[str] = None,
            referer_type: Optional[str] = None,
            status: Optional[str] = None) -> CosBucketReferer
    func GetCosBucketReferer(ctx *Context, name string, id IDInput, state *CosBucketRefererState, opts ...ResourceOption) (*CosBucketReferer, error)
    public static CosBucketReferer Get(string name, Input<string> id, CosBucketRefererState? state, CustomResourceOptions? opts = null)
    public static CosBucketReferer get(String name, Output<String> id, CosBucketRefererState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CosBucketReferer    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:
    Bucket string
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    CosBucketRefererId string
    ID of the resource.
    DomainLists List<string>
    A list of domain names in the blocklist/allowlist.
    EmptyReferConfiguration string
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    RefererType string
    Hotlink protection type. Enumerated values: Black-List, White-List.
    Status string
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    Bucket string
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    CosBucketRefererId string
    ID of the resource.
    DomainLists []string
    A list of domain names in the blocklist/allowlist.
    EmptyReferConfiguration string
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    RefererType string
    Hotlink protection type. Enumerated values: Black-List, White-List.
    Status string
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    bucket String
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    cosBucketRefererId String
    ID of the resource.
    domainLists List<String>
    A list of domain names in the blocklist/allowlist.
    emptyReferConfiguration String
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    refererType String
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status String
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    bucket string
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    cosBucketRefererId string
    ID of the resource.
    domainLists string[]
    A list of domain names in the blocklist/allowlist.
    emptyReferConfiguration string
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    refererType string
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status string
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    bucket str
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    cos_bucket_referer_id str
    ID of the resource.
    domain_lists Sequence[str]
    A list of domain names in the blocklist/allowlist.
    empty_refer_configuration str
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    referer_type str
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status str
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.
    bucket String
    Bucket format should be [custom name]-[appid], for example mycos-1258798060.
    cosBucketRefererId String
    ID of the resource.
    domainLists List<String>
    A list of domain names in the blocklist/allowlist.
    emptyReferConfiguration String
    Whether to allow access with an empty referer. Enumerated values: Allow, Deny (default).
    refererType String
    Hotlink protection type. Enumerated values: Black-List, White-List.
    status String
    Whether to enable hotlink protection. Enumerated values: Enabled, Disabled.

    Import

    cos bucket_referer can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/cosBucketReferer:CosBucketReferer bucket_referer bucket_id
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack