Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi
cloudflare.getSnippets
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleSnippets = cloudflare.getSnippets({
zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
snippetName: "snippet_name_01",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_snippets = cloudflare.get_snippets(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
snippet_name="snippet_name_01")
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.LookupSnippets(ctx, &cloudflare.LookupSnippetsArgs{
ZoneId: "023e105f4ecef8ad9ca31a8372d0c353",
SnippetName: "snippet_name_01",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleSnippets = Cloudflare.GetSnippets.Invoke(new()
{
ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
SnippetName = "snippet_name_01",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CloudflareFunctions;
import com.pulumi.cloudflare.inputs.GetSnippetsArgs;
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 exampleSnippets = CloudflareFunctions.getSnippets(GetSnippetsArgs.builder()
.zoneId("023e105f4ecef8ad9ca31a8372d0c353")
.snippetName("snippet_name_01")
.build());
}
}
variables:
exampleSnippets:
fn::invoke:
function: cloudflare:getSnippets
arguments:
zoneId: 023e105f4ecef8ad9ca31a8372d0c353
snippetName: snippet_name_01
Using getSnippets
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSnippets(args: GetSnippetsArgs, opts?: InvokeOptions): Promise<GetSnippetsResult>
function getSnippetsOutput(args: GetSnippetsOutputArgs, opts?: InvokeOptions): Output<GetSnippetsResult>
def get_snippets(snippet_name: Optional[str] = None,
zone_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSnippetsResult
def get_snippets_output(snippet_name: Optional[pulumi.Input[str]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSnippetsResult]
func LookupSnippets(ctx *Context, args *LookupSnippetsArgs, opts ...InvokeOption) (*LookupSnippetsResult, error)
func LookupSnippetsOutput(ctx *Context, args *LookupSnippetsOutputArgs, opts ...InvokeOption) LookupSnippetsResultOutput
> Note: This function is named LookupSnippets
in the Go SDK.
public static class GetSnippets
{
public static Task<GetSnippetsResult> InvokeAsync(GetSnippetsArgs args, InvokeOptions? opts = null)
public static Output<GetSnippetsResult> Invoke(GetSnippetsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSnippetsResult> getSnippets(GetSnippetsArgs args, InvokeOptions options)
public static Output<GetSnippetsResult> getSnippets(GetSnippetsArgs args, InvokeOptions options)
fn::invoke:
function: cloudflare:index/getSnippets:getSnippets
arguments:
# arguments dictionary
The following arguments are supported:
- Snippet
Name string - Snippet identifying name
- Zone
Id string - Identifier
- Snippet
Name string - Snippet identifying name
- Zone
Id string - Identifier
- snippet
Name String - Snippet identifying name
- zone
Id String - Identifier
- snippet
Name string - Snippet identifying name
- zone
Id string - Identifier
- snippet_
name str - Snippet identifying name
- zone_
id str - Identifier
- snippet
Name String - Snippet identifying name
- zone
Id String - Identifier
getSnippets Result
The following output properties are available:
- Created
On string - Creation time of the snippet
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - Modification time of the snippet
- Snippet
Name string - Snippet identifying name
- Zone
Id string - Identifier
- Created
On string - Creation time of the snippet
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - Modification time of the snippet
- Snippet
Name string - Snippet identifying name
- Zone
Id string - Identifier
- created
On String - Creation time of the snippet
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - Modification time of the snippet
- snippet
Name String - Snippet identifying name
- zone
Id String - Identifier
- created
On string - Creation time of the snippet
- id string
- The provider-assigned unique ID for this managed resource.
- modified
On string - Modification time of the snippet
- snippet
Name string - Snippet identifying name
- zone
Id string - Identifier
- 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
- snippet_
name str - Snippet identifying name
- zone_
id str - Identifier
- created
On String - Creation time of the snippet
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - Modification time of the snippet
- snippet
Name String - Snippet identifying name
- zone
Id String - Identifier
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.