cloudflare.R2BucketLifecycle
Explore with Pulumi AI
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
exampleR2BucketLifecycle:
type: cloudflare:R2BucketLifecycle
name: example_r2_bucket_lifecycle
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
bucketName: example-bucket
rules:
- id: Expire all objects older than 24 hours
conditions:
prefix: prefix
enabled: true
abort_multipart_uploads_transition:
condition:
maxAge: 0
type: Age
delete_objects_transition:
condition:
maxAge: 0
type: Age
storage_class_transitions:
- condition:
maxAge: 0
type: Age
storageClass: InfrequentAccess
Create R2BucketLifecycle Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new R2BucketLifecycle(name: string, args: R2BucketLifecycleArgs, opts?: CustomResourceOptions);
@overload
def R2BucketLifecycle(resource_name: str,
args: R2BucketLifecycleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def R2BucketLifecycle(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
bucket_name: Optional[str] = None,
jurisdiction: Optional[str] = None,
rules: Optional[Sequence[R2BucketLifecycleRuleArgs]] = None)
func NewR2BucketLifecycle(ctx *Context, name string, args R2BucketLifecycleArgs, opts ...ResourceOption) (*R2BucketLifecycle, error)
public R2BucketLifecycle(string name, R2BucketLifecycleArgs args, CustomResourceOptions? opts = null)
public R2BucketLifecycle(String name, R2BucketLifecycleArgs args)
public R2BucketLifecycle(String name, R2BucketLifecycleArgs args, CustomResourceOptions options)
type: cloudflare:R2BucketLifecycle
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 R2BucketLifecycleArgs
- 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 R2BucketLifecycleArgs
- 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 R2BucketLifecycleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args R2BucketLifecycleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args R2BucketLifecycleArgs
- 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 r2bucketLifecycleResource = new Cloudflare.R2BucketLifecycle("r2bucketLifecycleResource", new()
{
AccountId = "string",
BucketName = "string",
Jurisdiction = "string",
Rules = new[]
{
new Cloudflare.Inputs.R2BucketLifecycleRuleArgs
{
Conditions = new Cloudflare.Inputs.R2BucketLifecycleRuleConditionsArgs
{
Prefix = "string",
},
Enabled = false,
Id = "string",
AbortMultipartUploadsTransition = new Cloudflare.Inputs.R2BucketLifecycleRuleAbortMultipartUploadsTransitionArgs
{
Condition = new Cloudflare.Inputs.R2BucketLifecycleRuleAbortMultipartUploadsTransitionConditionArgs
{
MaxAge = 0,
Type = "string",
},
},
DeleteObjectsTransition = new Cloudflare.Inputs.R2BucketLifecycleRuleDeleteObjectsTransitionArgs
{
Condition = new Cloudflare.Inputs.R2BucketLifecycleRuleDeleteObjectsTransitionConditionArgs
{
Type = "string",
Date = "string",
MaxAge = 0,
},
},
StorageClassTransitions = new[]
{
new Cloudflare.Inputs.R2BucketLifecycleRuleStorageClassTransitionArgs
{
Condition = new Cloudflare.Inputs.R2BucketLifecycleRuleStorageClassTransitionConditionArgs
{
Type = "string",
Date = "string",
MaxAge = 0,
},
StorageClass = "string",
},
},
},
},
});
example, err := cloudflare.NewR2BucketLifecycle(ctx, "r2bucketLifecycleResource", &cloudflare.R2BucketLifecycleArgs{
AccountId: pulumi.String("string"),
BucketName: pulumi.String("string"),
Jurisdiction: pulumi.String("string"),
Rules: cloudflare.R2BucketLifecycleRuleArray{
&cloudflare.R2BucketLifecycleRuleArgs{
Conditions: &cloudflare.R2BucketLifecycleRuleConditionsArgs{
Prefix: pulumi.String("string"),
},
Enabled: pulumi.Bool(false),
Id: pulumi.String("string"),
AbortMultipartUploadsTransition: &cloudflare.R2BucketLifecycleRuleAbortMultipartUploadsTransitionArgs{
Condition: &cloudflare.R2BucketLifecycleRuleAbortMultipartUploadsTransitionConditionArgs{
MaxAge: pulumi.Int(0),
Type: pulumi.String("string"),
},
},
DeleteObjectsTransition: &cloudflare.R2BucketLifecycleRuleDeleteObjectsTransitionArgs{
Condition: &cloudflare.R2BucketLifecycleRuleDeleteObjectsTransitionConditionArgs{
Type: pulumi.String("string"),
Date: pulumi.String("string"),
MaxAge: pulumi.Int(0),
},
},
StorageClassTransitions: cloudflare.R2BucketLifecycleRuleStorageClassTransitionArray{
&cloudflare.R2BucketLifecycleRuleStorageClassTransitionArgs{
Condition: &cloudflare.R2BucketLifecycleRuleStorageClassTransitionConditionArgs{
Type: pulumi.String("string"),
Date: pulumi.String("string"),
MaxAge: pulumi.Int(0),
},
StorageClass: pulumi.String("string"),
},
},
},
},
})
var r2bucketLifecycleResource = new R2BucketLifecycle("r2bucketLifecycleResource", R2BucketLifecycleArgs.builder()
.accountId("string")
.bucketName("string")
.jurisdiction("string")
.rules(R2BucketLifecycleRuleArgs.builder()
.conditions(R2BucketLifecycleRuleConditionsArgs.builder()
.prefix("string")
.build())
.enabled(false)
.id("string")
.abortMultipartUploadsTransition(R2BucketLifecycleRuleAbortMultipartUploadsTransitionArgs.builder()
.condition(R2BucketLifecycleRuleAbortMultipartUploadsTransitionConditionArgs.builder()
.maxAge(0)
.type("string")
.build())
.build())
.deleteObjectsTransition(R2BucketLifecycleRuleDeleteObjectsTransitionArgs.builder()
.condition(R2BucketLifecycleRuleDeleteObjectsTransitionConditionArgs.builder()
.type("string")
.date("string")
.maxAge(0)
.build())
.build())
.storageClassTransitions(R2BucketLifecycleRuleStorageClassTransitionArgs.builder()
.condition(R2BucketLifecycleRuleStorageClassTransitionConditionArgs.builder()
.type("string")
.date("string")
.maxAge(0)
.build())
.storageClass("string")
.build())
.build())
.build());
r2bucket_lifecycle_resource = cloudflare.R2BucketLifecycle("r2bucketLifecycleResource",
account_id="string",
bucket_name="string",
jurisdiction="string",
rules=[{
"conditions": {
"prefix": "string",
},
"enabled": False,
"id": "string",
"abort_multipart_uploads_transition": {
"condition": {
"max_age": 0,
"type": "string",
},
},
"delete_objects_transition": {
"condition": {
"type": "string",
"date": "string",
"max_age": 0,
},
},
"storage_class_transitions": [{
"condition": {
"type": "string",
"date": "string",
"max_age": 0,
},
"storage_class": "string",
}],
}])
const r2bucketLifecycleResource = new cloudflare.R2BucketLifecycle("r2bucketLifecycleResource", {
accountId: "string",
bucketName: "string",
jurisdiction: "string",
rules: [{
conditions: {
prefix: "string",
},
enabled: false,
id: "string",
abortMultipartUploadsTransition: {
condition: {
maxAge: 0,
type: "string",
},
},
deleteObjectsTransition: {
condition: {
type: "string",
date: "string",
maxAge: 0,
},
},
storageClassTransitions: [{
condition: {
type: "string",
date: "string",
maxAge: 0,
},
storageClass: "string",
}],
}],
});
type: cloudflare:R2BucketLifecycle
properties:
accountId: string
bucketName: string
jurisdiction: string
rules:
- abortMultipartUploadsTransition:
condition:
maxAge: 0
type: string
conditions:
prefix: string
deleteObjectsTransition:
condition:
date: string
maxAge: 0
type: string
enabled: false
id: string
storageClassTransitions:
- condition:
date: string
maxAge: 0
type: string
storageClass: string
R2BucketLifecycle 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 R2BucketLifecycle resource accepts the following input properties:
- Account
Id string - Account ID
- Bucket
Name string - Name of the bucket
- Jurisdiction string
- Jurisdiction of the bucket
- Rules
List<R2Bucket
Lifecycle Rule>
- Account
Id string - Account ID
- Bucket
Name string - Name of the bucket
- Jurisdiction string
- Jurisdiction of the bucket
- Rules
[]R2Bucket
Lifecycle Rule Args
- account
Id String - Account ID
- bucket
Name String - Name of the bucket
- jurisdiction String
- Jurisdiction of the bucket
- rules
List<R2Bucket
Lifecycle Rule>
- account
Id string - Account ID
- bucket
Name string - Name of the bucket
- jurisdiction string
- Jurisdiction of the bucket
- rules
R2Bucket
Lifecycle Rule[]
- account_
id str - Account ID
- bucket_
name str - Name of the bucket
- jurisdiction str
- Jurisdiction of the bucket
- rules
Sequence[R2Bucket
Lifecycle Rule Args]
- account
Id String - Account ID
- bucket
Name String - Name of the bucket
- jurisdiction String
- Jurisdiction of the bucket
- rules List<Property Map>
Outputs
All input properties are implicitly available as output properties. Additionally, the R2BucketLifecycle 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 R2BucketLifecycle Resource
Get an existing R2BucketLifecycle 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?: R2BucketLifecycleState, opts?: CustomResourceOptions): R2BucketLifecycle
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
bucket_name: Optional[str] = None,
jurisdiction: Optional[str] = None,
rules: Optional[Sequence[R2BucketLifecycleRuleArgs]] = None) -> R2BucketLifecycle
func GetR2BucketLifecycle(ctx *Context, name string, id IDInput, state *R2BucketLifecycleState, opts ...ResourceOption) (*R2BucketLifecycle, error)
public static R2BucketLifecycle Get(string name, Input<string> id, R2BucketLifecycleState? state, CustomResourceOptions? opts = null)
public static R2BucketLifecycle get(String name, Output<String> id, R2BucketLifecycleState state, CustomResourceOptions options)
resources: _: type: cloudflare:R2BucketLifecycle 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.
- Account
Id string - Account ID
- Bucket
Name string - Name of the bucket
- Jurisdiction string
- Jurisdiction of the bucket
- Rules
List<R2Bucket
Lifecycle Rule>
- Account
Id string - Account ID
- Bucket
Name string - Name of the bucket
- Jurisdiction string
- Jurisdiction of the bucket
- Rules
[]R2Bucket
Lifecycle Rule Args
- account
Id String - Account ID
- bucket
Name String - Name of the bucket
- jurisdiction String
- Jurisdiction of the bucket
- rules
List<R2Bucket
Lifecycle Rule>
- account
Id string - Account ID
- bucket
Name string - Name of the bucket
- jurisdiction string
- Jurisdiction of the bucket
- rules
R2Bucket
Lifecycle Rule[]
- account_
id str - Account ID
- bucket_
name str - Name of the bucket
- jurisdiction str
- Jurisdiction of the bucket
- rules
Sequence[R2Bucket
Lifecycle Rule Args]
- account
Id String - Account ID
- bucket
Name String - Name of the bucket
- jurisdiction String
- Jurisdiction of the bucket
- rules List<Property Map>
Supporting Types
R2BucketLifecycleRule, R2BucketLifecycleRuleArgs
- Conditions
R2Bucket
Lifecycle Rule Conditions - Conditions that apply to all transitions of this rule
- Enabled bool
- Whether or not this rule is in effect
- Id string
- Unique identifier for this rule
- Abort
Multipart R2BucketUploads Transition Lifecycle Rule Abort Multipart Uploads Transition - Transition to abort ongoing multipart uploads
- Delete
Objects R2BucketTransition Lifecycle Rule Delete Objects Transition - Transition to delete objects
- Storage
Class List<R2BucketTransitions Lifecycle Rule Storage Class Transition> - Transitions to change the storage class of objects
- Conditions
R2Bucket
Lifecycle Rule Conditions - Conditions that apply to all transitions of this rule
- Enabled bool
- Whether or not this rule is in effect
- Id string
- Unique identifier for this rule
- Abort
Multipart R2BucketUploads Transition Lifecycle Rule Abort Multipart Uploads Transition - Transition to abort ongoing multipart uploads
- Delete
Objects R2BucketTransition Lifecycle Rule Delete Objects Transition - Transition to delete objects
- Storage
Class []R2BucketTransitions Lifecycle Rule Storage Class Transition - Transitions to change the storage class of objects
- conditions
R2Bucket
Lifecycle Rule Conditions - Conditions that apply to all transitions of this rule
- enabled Boolean
- Whether or not this rule is in effect
- id String
- Unique identifier for this rule
- abort
Multipart R2BucketUploads Transition Lifecycle Rule Abort Multipart Uploads Transition - Transition to abort ongoing multipart uploads
- delete
Objects R2BucketTransition Lifecycle Rule Delete Objects Transition - Transition to delete objects
- storage
Class List<R2BucketTransitions Lifecycle Rule Storage Class Transition> - Transitions to change the storage class of objects
- conditions
R2Bucket
Lifecycle Rule Conditions - Conditions that apply to all transitions of this rule
- enabled boolean
- Whether or not this rule is in effect
- id string
- Unique identifier for this rule
- abort
Multipart R2BucketUploads Transition Lifecycle Rule Abort Multipart Uploads Transition - Transition to abort ongoing multipart uploads
- delete
Objects R2BucketTransition Lifecycle Rule Delete Objects Transition - Transition to delete objects
- storage
Class R2BucketTransitions Lifecycle Rule Storage Class Transition[] - Transitions to change the storage class of objects
- conditions
R2Bucket
Lifecycle Rule Conditions - Conditions that apply to all transitions of this rule
- enabled bool
- Whether or not this rule is in effect
- id str
- Unique identifier for this rule
- abort_
multipart_ R2Bucketuploads_ transition Lifecycle Rule Abort Multipart Uploads Transition - Transition to abort ongoing multipart uploads
- delete_
objects_ R2Buckettransition Lifecycle Rule Delete Objects Transition - Transition to delete objects
- storage_
class_ Sequence[R2Buckettransitions Lifecycle Rule Storage Class Transition] - Transitions to change the storage class of objects
- conditions Property Map
- Conditions that apply to all transitions of this rule
- enabled Boolean
- Whether or not this rule is in effect
- id String
- Unique identifier for this rule
- abort
Multipart Property MapUploads Transition - Transition to abort ongoing multipart uploads
- delete
Objects Property MapTransition - Transition to delete objects
- storage
Class List<Property Map>Transitions - Transitions to change the storage class of objects
R2BucketLifecycleRuleAbortMultipartUploadsTransition, R2BucketLifecycleRuleAbortMultipartUploadsTransitionArgs
- Condition
R2Bucket
Lifecycle Rule Abort Multipart Uploads Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- Condition
R2Bucket
Lifecycle Rule Abort Multipart Uploads Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition
R2Bucket
Lifecycle Rule Abort Multipart Uploads Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition
R2Bucket
Lifecycle Rule Abort Multipart Uploads Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition
R2Bucket
Lifecycle Rule Abort Multipart Uploads Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition Property Map
- Condition for lifecycle transitions to apply after an object reaches an age in seconds
R2BucketLifecycleRuleAbortMultipartUploadsTransitionCondition, R2BucketLifecycleRuleAbortMultipartUploadsTransitionConditionArgs
R2BucketLifecycleRuleConditions, R2BucketLifecycleRuleConditionsArgs
- Prefix string
- Transitions 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
- Prefix string
- Transitions 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
- prefix String
- Transitions 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
- prefix string
- Transitions 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
- prefix str
- Transitions 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
- prefix String
- Transitions 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
R2BucketLifecycleRuleDeleteObjectsTransition, R2BucketLifecycleRuleDeleteObjectsTransitionArgs
- Condition
R2Bucket
Lifecycle Rule Delete Objects Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- Condition
R2Bucket
Lifecycle Rule Delete Objects Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition
R2Bucket
Lifecycle Rule Delete Objects Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition
R2Bucket
Lifecycle Rule Delete Objects Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition
R2Bucket
Lifecycle Rule Delete Objects Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- condition Property Map
- Condition for lifecycle transitions to apply after an object reaches an age in seconds
R2BucketLifecycleRuleDeleteObjectsTransitionCondition, R2BucketLifecycleRuleDeleteObjectsTransitionConditionArgs
R2BucketLifecycleRuleStorageClassTransition, R2BucketLifecycleRuleStorageClassTransitionArgs
- Condition
R2Bucket
Lifecycle Rule Storage Class Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- Storage
Class string - Available values: "InfrequentAccess".
- Condition
R2Bucket
Lifecycle Rule Storage Class Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- Storage
Class string - Available values: "InfrequentAccess".
- condition
R2Bucket
Lifecycle Rule Storage Class Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- storage
Class String - Available values: "InfrequentAccess".
- condition
R2Bucket
Lifecycle Rule Storage Class Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- storage
Class string - Available values: "InfrequentAccess".
- condition
R2Bucket
Lifecycle Rule Storage Class Transition Condition - Condition for lifecycle transitions to apply after an object reaches an age in seconds
- storage_
class str - Available values: "InfrequentAccess".
- condition Property Map
- Condition for lifecycle transitions to apply after an object reaches an age in seconds
- storage
Class String - Available values: "InfrequentAccess".
R2BucketLifecycleRuleStorageClassTransitionCondition, R2BucketLifecycleRuleStorageClassTransitionConditionArgs
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.