1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getR2BucketLock
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.getR2BucketLock

Explore with Pulumi AI

Cloudflare v6.0.1 published on Wednesday, Apr 16, 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",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_r2_bucket_lock = cloudflare.get_r2_bucket_lock(account_id="023e105f4ecef8ad9ca31a8372d0c353",
    bucket_name="example-bucket")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  exampleR2BucketLock:
    fn::invoke:
      function: cloudflare:getR2BucketLock
      arguments:
        accountId: 023e105f4ecef8ad9ca31a8372d0c353
        bucketName: example-bucket
Copy

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>
Copy
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]
Copy
func LookupR2BucketLock(ctx *Context, args *LookupR2BucketLockArgs, opts ...InvokeOption) (*LookupR2BucketLockResult, error)
func LookupR2BucketLockOutput(ctx *Context, args *LookupR2BucketLockOutputArgs, opts ...InvokeOption) LookupR2BucketLockResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetR2BucketLockResult> getR2BucketLock(GetR2BucketLockArgs args, InvokeOptions options)
public static Output<GetR2BucketLockResult> getR2BucketLock(GetR2BucketLockArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cloudflare:index/getR2BucketLock:getR2BucketLock
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountId This property is required. string
Account ID
BucketName This property is required. string
Name of the bucket
AccountId This property is required. string
Account ID
BucketName This property is required. string
Name of the bucket
accountId This property is required. String
Account ID
bucketName This property is required. String
Name of the bucket
accountId This property is required. string
Account ID
bucketName This property is required. string
Name of the bucket
account_id This property is required. str
Account ID
bucket_name This property is required. str
Name of the bucket
accountId This property is required. String
Account ID
bucketName This property is required. 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 This property is required. GetR2BucketLockRuleCondition
Condition to apply a lock rule to an object for how long in seconds
Enabled This property is required. bool
Whether or not this rule is in effect
Id This property is required. string
Unique identifier for this rule
Prefix This property is required. 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 This property is required. GetR2BucketLockRuleCondition
Condition to apply a lock rule to an object for how long in seconds
Enabled This property is required. bool
Whether or not this rule is in effect
Id This property is required. string
Unique identifier for this rule
Prefix This property is required. 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 This property is required. GetR2BucketLockRuleCondition
Condition to apply a lock rule to an object for how long in seconds
enabled This property is required. Boolean
Whether or not this rule is in effect
id This property is required. String
Unique identifier for this rule
prefix This property is required. 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 This property is required. GetR2BucketLockRuleCondition
Condition to apply a lock rule to an object for how long in seconds
enabled This property is required. boolean
Whether or not this rule is in effect
id This property is required. string
Unique identifier for this rule
prefix This property is required. 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 This property is required. GetR2BucketLockRuleCondition
Condition to apply a lock rule to an object for how long in seconds
enabled This property is required. bool
Whether or not this rule is in effect
id This property is required. str
Unique identifier for this rule
prefix This property is required. 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 This property is required. Property Map
Condition to apply a lock rule to an object for how long in seconds
enabled This property is required. Boolean
Whether or not this rule is in effect
id This property is required. String
Unique identifier for this rule
prefix This property is required. 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 This property is required. string
MaxAgeSeconds This property is required. int
Type This property is required. string
Available values: "Age".
Date This property is required. string
MaxAgeSeconds This property is required. int
Type This property is required. string
Available values: "Age".
date This property is required. String
maxAgeSeconds This property is required. Integer
type This property is required. String
Available values: "Age".
date This property is required. string
maxAgeSeconds This property is required. number
type This property is required. string
Available values: "Age".
date This property is required. str
max_age_seconds This property is required. int
type This property is required. str
Available values: "Age".
date This property is required. String
maxAgeSeconds This property is required. Number
type This property is required. 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 v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi