1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. Snippets
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.Snippets

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    Create Snippets Resource

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

    Constructor syntax

    new Snippets(name: string, args: SnippetsArgs, opts?: CustomResourceOptions);
    @overload
    def Snippets(resource_name: str,
                 args: SnippetsArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Snippets(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 snippet_name: Optional[str] = None,
                 zone_id: Optional[str] = None,
                 files: Optional[str] = None,
                 metadata: Optional[SnippetsMetadataArgs] = None)
    func NewSnippets(ctx *Context, name string, args SnippetsArgs, opts ...ResourceOption) (*Snippets, error)
    public Snippets(string name, SnippetsArgs args, CustomResourceOptions? opts = null)
    public Snippets(String name, SnippetsArgs args)
    public Snippets(String name, SnippetsArgs args, CustomResourceOptions options)
    
    type: cloudflare:Snippets
    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 SnippetsArgs
    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 SnippetsArgs
    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 SnippetsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SnippetsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SnippetsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

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

    var snippetsResource = new Cloudflare.Snippets("snippetsResource", new()
    {
        SnippetName = "string",
        ZoneId = "string",
        Files = "string",
        Metadata = new Cloudflare.Inputs.SnippetsMetadataArgs
        {
            MainModule = "string",
        },
    });
    
    example, err := cloudflare.NewSnippets(ctx, "snippetsResource", &cloudflare.SnippetsArgs{
    	SnippetName: pulumi.String("string"),
    	ZoneId:      pulumi.String("string"),
    	Files:       pulumi.String("string"),
    	Metadata: &cloudflare.SnippetsMetadataArgs{
    		MainModule: pulumi.String("string"),
    	},
    })
    
    var snippetsResource = new Snippets("snippetsResource", SnippetsArgs.builder()
        .snippetName("string")
        .zoneId("string")
        .files("string")
        .metadata(SnippetsMetadataArgs.builder()
            .mainModule("string")
            .build())
        .build());
    
    snippets_resource = cloudflare.Snippets("snippetsResource",
        snippet_name="string",
        zone_id="string",
        files="string",
        metadata={
            "main_module": "string",
        })
    
    const snippetsResource = new cloudflare.Snippets("snippetsResource", {
        snippetName: "string",
        zoneId: "string",
        files: "string",
        metadata: {
            mainModule: "string",
        },
    });
    
    type: cloudflare:Snippets
    properties:
        files: string
        metadata:
            mainModule: string
        snippetName: string
        zoneId: string
    

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

    SnippetName string
    Snippet identifying name
    ZoneId string
    Identifier
    Files string
    Content files of uploaded snippet
    Metadata SnippetsMetadata
    SnippetName string
    Snippet identifying name
    ZoneId string
    Identifier
    Files string
    Content files of uploaded snippet
    Metadata SnippetsMetadataArgs
    snippetName String
    Snippet identifying name
    zoneId String
    Identifier
    files String
    Content files of uploaded snippet
    metadata SnippetsMetadata
    snippetName string
    Snippet identifying name
    zoneId string
    Identifier
    files string
    Content files of uploaded snippet
    metadata SnippetsMetadata
    snippet_name str
    Snippet identifying name
    zone_id str
    Identifier
    files str
    Content files of uploaded snippet
    metadata SnippetsMetadataArgs
    snippetName String
    Snippet identifying name
    zoneId String
    Identifier
    files String
    Content files of uploaded snippet
    metadata Property Map

    Outputs

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

    CreatedOn string
    Creation time of the snippet
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    Modification time of the snippet
    CreatedOn string
    Creation time of the snippet
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    Modification time of the snippet
    createdOn String
    Creation time of the snippet
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    Modification time of the snippet
    createdOn string
    Creation time of the snippet
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedOn string
    Modification time of the snippet
    created_on str
    Creation time of the snippet
    id str
    The provider-assigned unique ID for this managed resource.
    modified_on str
    Modification time of the snippet
    createdOn String
    Creation time of the snippet
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    Modification time of the snippet

    Look up Existing Snippets Resource

    Get an existing Snippets 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?: SnippetsState, opts?: CustomResourceOptions): Snippets
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_on: Optional[str] = None,
            files: Optional[str] = None,
            metadata: Optional[SnippetsMetadataArgs] = None,
            modified_on: Optional[str] = None,
            snippet_name: Optional[str] = None,
            zone_id: Optional[str] = None) -> Snippets
    func GetSnippets(ctx *Context, name string, id IDInput, state *SnippetsState, opts ...ResourceOption) (*Snippets, error)
    public static Snippets Get(string name, Input<string> id, SnippetsState? state, CustomResourceOptions? opts = null)
    public static Snippets get(String name, Output<String> id, SnippetsState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:Snippets    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:
    CreatedOn string
    Creation time of the snippet
    Files string
    Content files of uploaded snippet
    Metadata SnippetsMetadata
    ModifiedOn string
    Modification time of the snippet
    SnippetName string
    Snippet identifying name
    ZoneId string
    Identifier
    CreatedOn string
    Creation time of the snippet
    Files string
    Content files of uploaded snippet
    Metadata SnippetsMetadataArgs
    ModifiedOn string
    Modification time of the snippet
    SnippetName string
    Snippet identifying name
    ZoneId string
    Identifier
    createdOn String
    Creation time of the snippet
    files String
    Content files of uploaded snippet
    metadata SnippetsMetadata
    modifiedOn String
    Modification time of the snippet
    snippetName String
    Snippet identifying name
    zoneId String
    Identifier
    createdOn string
    Creation time of the snippet
    files string
    Content files of uploaded snippet
    metadata SnippetsMetadata
    modifiedOn string
    Modification time of the snippet
    snippetName string
    Snippet identifying name
    zoneId string
    Identifier
    created_on str
    Creation time of the snippet
    files str
    Content files of uploaded snippet
    metadata SnippetsMetadataArgs
    modified_on str
    Modification time of the snippet
    snippet_name str
    Snippet identifying name
    zone_id str
    Identifier
    createdOn String
    Creation time of the snippet
    files String
    Content files of uploaded snippet
    metadata Property Map
    modifiedOn String
    Modification time of the snippet
    snippetName String
    Snippet identifying name
    zoneId String
    Identifier

    Supporting Types

    SnippetsMetadata, SnippetsMetadataArgs

    MainModule string
    Main module name of uploaded snippet
    MainModule string
    Main module name of uploaded snippet
    mainModule String
    Main module name of uploaded snippet
    mainModule string
    Main module name of uploaded snippet
    main_module str
    Main module name of uploaded snippet
    mainModule String
    Main module name of uploaded snippet

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi