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

cloudflare.getR2BucketLock

Explore with Pulumi AI

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleR2BucketLock = cloudflare.getR2BucketLock({
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        bucketName: "example-bucket",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_r2_bucket_lock = cloudflare.get_r2_bucket_lock(account_id="023e105f4ecef8ad9ca31a8372d0c353",
        bucket_name="example-bucket")
    
    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.LookupR2BucketLock(ctx, &cloudflare.LookupR2BucketLockArgs{
    			AccountId:  "023e105f4ecef8ad9ca31a8372d0c353",
    			BucketName: "example-bucket",
    		}, 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 exampleR2BucketLock = Cloudflare.GetR2BucketLock.Invoke(new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            BucketName = "example-bucket",
        });
    
    });
    
    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.GetR2BucketLockArgs;
    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 exampleR2BucketLock = CloudflareFunctions.getR2BucketLock(GetR2BucketLockArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .bucketName("example-bucket")
                .build());
    
        }
    }
    
    variables:
      exampleR2BucketLock:
        fn::invoke:
          function: cloudflare:getR2BucketLock
          arguments:
            accountId: 023e105f4ecef8ad9ca31a8372d0c353
            bucketName: example-bucket
    

    Using getR2BucketLock

    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 getR2BucketLock(args: GetR2BucketLockArgs, opts?: InvokeOptions): Promise<GetR2BucketLockResult>
    function getR2BucketLockOutput(args: GetR2BucketLockOutputArgs, opts?: InvokeOptions): Output<GetR2BucketLockResult>
    def get_r2_bucket_lock(account_id: Optional[str] = None,
                           bucket_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetR2BucketLockResult
    def get_r2_bucket_lock_output(account_id: Optional[pulumi.Input[str]] = None,
                           bucket_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetR2BucketLockResult]
    func LookupR2BucketLock(ctx *Context, args *LookupR2BucketLockArgs, opts ...InvokeOption) (*LookupR2BucketLockResult, error)
    func LookupR2BucketLockOutput(ctx *Context, args *LookupR2BucketLockOutputArgs, opts ...InvokeOption) LookupR2BucketLockResultOutput

    > Note: This function is named LookupR2BucketLock in the Go SDK.

    public static class GetR2BucketLock 
    {
        public static Task<GetR2BucketLockResult> InvokeAsync(GetR2BucketLockArgs args, InvokeOptions? opts = null)
        public static Output<GetR2BucketLockResult> Invoke(GetR2BucketLockInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetR2BucketLockResult> getR2BucketLock(GetR2BucketLockArgs args, InvokeOptions options)
    public static Output<GetR2BucketLockResult> getR2BucketLock(GetR2BucketLockArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getR2BucketLock:getR2BucketLock
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    accountId string
    Account ID
    bucketName string
    Name of the bucket
    account_id str
    Account ID
    bucket_name str
    Name of the bucket
    accountId String
    Account ID
    bucketName String
    Name of the bucket

    getR2BucketLock Result

    The following output properties are available:

    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    Id string
    The provider-assigned unique ID for this managed resource.
    Rules List<GetR2BucketLockRule>
    AccountId string
    Account ID
    BucketName string
    Name of the bucket
    Id string
    The provider-assigned unique ID for this managed resource.
    Rules []GetR2BucketLockRule
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    id String
    The provider-assigned unique ID for this managed resource.
    rules List<GetR2BucketLockRule>
    accountId string
    Account ID
    bucketName string
    Name of the bucket
    id string
    The provider-assigned unique ID for this managed resource.
    rules GetR2BucketLockRule[]
    account_id str
    Account ID
    bucket_name str
    Name of the bucket
    id str
    The provider-assigned unique ID for this managed resource.
    rules Sequence[GetR2BucketLockRule]
    accountId String
    Account ID
    bucketName String
    Name of the bucket
    id String
    The provider-assigned unique ID for this managed resource.
    rules List<Property Map>

    Supporting Types

    GetR2BucketLockRule

    Condition GetR2BucketLockRuleCondition
    Condition to apply a lock rule to an object for how long in seconds
    Enabled bool
    Whether or not this rule is in effect
    Id string
    Unique identifier for this rule
    Prefix string
    Rule will only apply to objects/uploads in the bucket that start with the given prefix, an empty prefix can be provided to scope rule to all objects/uploads
    Condition GetR2BucketLockRuleCondition
    Condition to apply a lock rule to an object for how long in seconds
    Enabled bool
    Whether or not this rule is in effect
    Id string
    Unique identifier for this rule
    Prefix string
    Rule will only apply to objects/uploads in the bucket that start with the given prefix, an empty prefix can be provided to scope rule to all objects/uploads
    condition GetR2BucketLockRuleCondition
    Condition to apply a lock rule to an object for how long in seconds
    enabled Boolean
    Whether or not this rule is in effect
    id String
    Unique identifier for this rule
    prefix String
    Rule will only apply to objects/uploads in the bucket that start with the given prefix, an empty prefix can be provided to scope rule to all objects/uploads
    condition GetR2BucketLockRuleCondition
    Condition to apply a lock rule to an object for how long in seconds
    enabled boolean
    Whether or not this rule is in effect
    id string
    Unique identifier for this rule
    prefix string
    Rule will only apply to objects/uploads in the bucket that start with the given prefix, an empty prefix can be provided to scope rule to all objects/uploads
    condition GetR2BucketLockRuleCondition
    Condition to apply a lock rule to an object for how long in seconds
    enabled bool
    Whether or not this rule is in effect
    id str
    Unique identifier for this rule
    prefix str
    Rule will only apply to objects/uploads in the bucket that start with the given prefix, an empty prefix can be provided to scope rule to all objects/uploads
    condition Property Map
    Condition to apply a lock rule to an object for how long in seconds
    enabled Boolean
    Whether or not this rule is in effect
    id String
    Unique identifier for this rule
    prefix String
    Rule will only apply to objects/uploads in the bucket that start with the given prefix, an empty prefix can be provided to scope rule to all objects/uploads

    GetR2BucketLockRuleCondition

    Date string
    MaxAgeSeconds int
    Type string
    Available values: "Age".
    Date string
    MaxAgeSeconds int
    Type string
    Available values: "Age".
    date String
    maxAgeSeconds Integer
    type String
    Available values: "Age".
    date string
    maxAgeSeconds number
    type string
    Available values: "Age".
    date str
    max_age_seconds int
    type str
    Available values: "Age".
    date String
    maxAgeSeconds Number
    type String
    Available values: "Age".

    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