ionoscloud.S3BucketLifecycleConfiguration
Explore with Pulumi AI
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.S3Bucket;
import com.pulumi.ionoscloud.S3BucketLifecycleConfiguration;
import com.pulumi.ionoscloud.S3BucketLifecycleConfigurationArgs;
import com.pulumi.ionoscloud.inputs.S3BucketLifecycleConfigurationRuleArgs;
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) {
var exampleS3Bucket = new S3Bucket("exampleS3Bucket");
var exampleS3BucketLifecycleConfiguration = new S3BucketLifecycleConfiguration("exampleS3BucketLifecycleConfiguration", S3BucketLifecycleConfigurationArgs.builder()
.bucket(exampleS3Bucket.name())
.rules(
S3BucketLifecycleConfigurationRuleArgs.builder()
.id("1")
.status("Enabled")
.prefix("/logs")
.expiration(S3BucketLifecycleConfigurationRuleExpirationArgs.builder()
.days(90)
.build())
.build(),
S3BucketLifecycleConfigurationRuleArgs.builder()
.id("2")
.status("Enabled")
.prefix("/logs")
.noncurrentVersionExpiration(S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs.builder()
.noncurrentDays(90)
.build())
.build(),
S3BucketLifecycleConfigurationRuleArgs.builder()
.id("3")
.status("Enabled")
.prefix("/logs")
.abortIncompleteMultipartUpload(S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs.builder()
.daysAfterInitiation(90)
.build())
.build())
.build());
}
}
resources:
exampleS3Bucket:
type: ionoscloud:S3Bucket
exampleS3BucketLifecycleConfiguration:
type: ionoscloud:S3BucketLifecycleConfiguration
properties:
bucket: ${exampleS3Bucket.name}
rules:
- id: '1'
status: Enabled
prefix: /logs
expiration:
- days: 90
- id: '2'
status: Enabled
prefix: /logs
noncurrentVersionExpiration:
- noncurrentDays: 90
- id: '3'
status: Enabled
prefix: /logs
abortIncompleteMultipartUpload:
- daysAfterInitiation: 90
Create S3BucketLifecycleConfiguration Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new S3BucketLifecycleConfiguration(name: string, args: S3BucketLifecycleConfigurationArgs, opts?: CustomResourceOptions);
@overload
def S3BucketLifecycleConfiguration(resource_name: str,
args: S3BucketLifecycleConfigurationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def S3BucketLifecycleConfiguration(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
rules: Optional[Sequence[S3BucketLifecycleConfigurationRuleArgs]] = None)
func NewS3BucketLifecycleConfiguration(ctx *Context, name string, args S3BucketLifecycleConfigurationArgs, opts ...ResourceOption) (*S3BucketLifecycleConfiguration, error)
public S3BucketLifecycleConfiguration(string name, S3BucketLifecycleConfigurationArgs args, CustomResourceOptions? opts = null)
public S3BucketLifecycleConfiguration(String name, S3BucketLifecycleConfigurationArgs args)
public S3BucketLifecycleConfiguration(String name, S3BucketLifecycleConfigurationArgs args, CustomResourceOptions options)
type: ionoscloud:S3BucketLifecycleConfiguration
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 S3BucketLifecycleConfigurationArgs
- 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 S3BucketLifecycleConfigurationArgs
- 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 S3BucketLifecycleConfigurationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args S3BucketLifecycleConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args S3BucketLifecycleConfigurationArgs
- 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 s3bucketLifecycleConfigurationResource = new Ionoscloud.S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource", new()
{
Bucket = "string",
Rules = new[]
{
new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleArgs
{
Prefix = "string",
Status = "string",
AbortIncompleteMultipartUpload = new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs
{
DaysAfterInitiation = 0,
},
Expiration = new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleExpirationArgs
{
Date = "string",
Days = 0,
ExpiredObjectDeleteMarker = false,
},
Id = "string",
NoncurrentVersionExpiration = new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs
{
NoncurrentDays = 0,
},
},
},
});
example, err := ionoscloud.NewS3BucketLifecycleConfiguration(ctx, "s3bucketLifecycleConfigurationResource", &ionoscloud.S3BucketLifecycleConfigurationArgs{
Bucket: pulumi.String("string"),
Rules: ionoscloud.S3BucketLifecycleConfigurationRuleArray{
&ionoscloud.S3BucketLifecycleConfigurationRuleArgs{
Prefix: pulumi.String("string"),
Status: pulumi.String("string"),
AbortIncompleteMultipartUpload: &ionoscloud.S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs{
DaysAfterInitiation: pulumi.Float64(0),
},
Expiration: &ionoscloud.S3BucketLifecycleConfigurationRuleExpirationArgs{
Date: pulumi.String("string"),
Days: pulumi.Float64(0),
ExpiredObjectDeleteMarker: pulumi.Bool(false),
},
Id: pulumi.String("string"),
NoncurrentVersionExpiration: &ionoscloud.S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs{
NoncurrentDays: pulumi.Float64(0),
},
},
},
})
var s3bucketLifecycleConfigurationResource = new S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource", S3BucketLifecycleConfigurationArgs.builder()
.bucket("string")
.rules(S3BucketLifecycleConfigurationRuleArgs.builder()
.prefix("string")
.status("string")
.abortIncompleteMultipartUpload(S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs.builder()
.daysAfterInitiation(0)
.build())
.expiration(S3BucketLifecycleConfigurationRuleExpirationArgs.builder()
.date("string")
.days(0)
.expiredObjectDeleteMarker(false)
.build())
.id("string")
.noncurrentVersionExpiration(S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs.builder()
.noncurrentDays(0)
.build())
.build())
.build());
s3bucket_lifecycle_configuration_resource = ionoscloud.S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource",
bucket="string",
rules=[{
"prefix": "string",
"status": "string",
"abort_incomplete_multipart_upload": {
"days_after_initiation": 0,
},
"expiration": {
"date": "string",
"days": 0,
"expired_object_delete_marker": False,
},
"id": "string",
"noncurrent_version_expiration": {
"noncurrent_days": 0,
},
}])
const s3bucketLifecycleConfigurationResource = new ionoscloud.S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource", {
bucket: "string",
rules: [{
prefix: "string",
status: "string",
abortIncompleteMultipartUpload: {
daysAfterInitiation: 0,
},
expiration: {
date: "string",
days: 0,
expiredObjectDeleteMarker: false,
},
id: "string",
noncurrentVersionExpiration: {
noncurrentDays: 0,
},
}],
});
type: ionoscloud:S3BucketLifecycleConfiguration
properties:
bucket: string
rules:
- abortIncompleteMultipartUpload:
daysAfterInitiation: 0
expiration:
date: string
days: 0
expiredObjectDeleteMarker: false
id: string
noncurrentVersionExpiration:
noncurrentDays: 0
prefix: string
status: string
S3BucketLifecycleConfiguration 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 S3BucketLifecycleConfiguration resource accepts the following input properties:
- Bucket string
- [string] The name of the bucket where the object will be stored.
- Rules
List<S3Bucket
Lifecycle Configuration Rule> - A list of lifecycle rules for objects in the bucket.
- Bucket string
- [string] The name of the bucket where the object will be stored.
- Rules
[]S3Bucket
Lifecycle Configuration Rule Args - A list of lifecycle rules for objects in the bucket.
- bucket String
- [string] The name of the bucket where the object will be stored.
- rules
List<S3Bucket
Lifecycle Configuration Rule> - A list of lifecycle rules for objects in the bucket.
- bucket string
- [string] The name of the bucket where the object will be stored.
- rules
S3Bucket
Lifecycle Configuration Rule[] - A list of lifecycle rules for objects in the bucket.
- bucket str
- [string] The name of the bucket where the object will be stored.
- rules
Sequence[S3Bucket
Lifecycle Configuration Rule Args] - A list of lifecycle rules for objects in the bucket.
- bucket String
- [string] The name of the bucket where the object will be stored.
- rules List<Property Map>
- A list of lifecycle rules for objects in the bucket.
Outputs
All input properties are implicitly available as output properties. Additionally, the S3BucketLifecycleConfiguration 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 S3BucketLifecycleConfiguration Resource
Get an existing S3BucketLifecycleConfiguration 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?: S3BucketLifecycleConfigurationState, opts?: CustomResourceOptions): S3BucketLifecycleConfiguration
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
rules: Optional[Sequence[S3BucketLifecycleConfigurationRuleArgs]] = None) -> S3BucketLifecycleConfiguration
func GetS3BucketLifecycleConfiguration(ctx *Context, name string, id IDInput, state *S3BucketLifecycleConfigurationState, opts ...ResourceOption) (*S3BucketLifecycleConfiguration, error)
public static S3BucketLifecycleConfiguration Get(string name, Input<string> id, S3BucketLifecycleConfigurationState? state, CustomResourceOptions? opts = null)
public static S3BucketLifecycleConfiguration get(String name, Output<String> id, S3BucketLifecycleConfigurationState state, CustomResourceOptions options)
resources: _: type: ionoscloud:S3BucketLifecycleConfiguration 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.
- Bucket string
- [string] The name of the bucket where the object will be stored.
- Rules
List<S3Bucket
Lifecycle Configuration Rule> - A list of lifecycle rules for objects in the bucket.
- Bucket string
- [string] The name of the bucket where the object will be stored.
- Rules
[]S3Bucket
Lifecycle Configuration Rule Args - A list of lifecycle rules for objects in the bucket.
- bucket String
- [string] The name of the bucket where the object will be stored.
- rules
List<S3Bucket
Lifecycle Configuration Rule> - A list of lifecycle rules for objects in the bucket.
- bucket string
- [string] The name of the bucket where the object will be stored.
- rules
S3Bucket
Lifecycle Configuration Rule[] - A list of lifecycle rules for objects in the bucket.
- bucket str
- [string] The name of the bucket where the object will be stored.
- rules
Sequence[S3Bucket
Lifecycle Configuration Rule Args] - A list of lifecycle rules for objects in the bucket.
- bucket String
- [string] The name of the bucket where the object will be stored.
- rules List<Property Map>
- A list of lifecycle rules for objects in the bucket.
Supporting Types
S3BucketLifecycleConfigurationRule, S3BucketLifecycleConfigurationRuleArgs
- Prefix string
- Object key prefix identifying one or more objects to which the rule applies.
- Status string
- Whether the rule is currently being applied. Valid values: Enabled or Disabled.
- Abort
Incomplete S3BucketMultipart Upload Lifecycle Configuration Rule Abort Incomplete Multipart Upload - Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
- Expiration
S3Bucket
Lifecycle Configuration Rule Expiration - A lifecycle rule for when an object expires.
- Id string
- Unique identifier for the rule.
- Noncurrent
Version S3BucketExpiration Lifecycle Configuration Rule Noncurrent Version Expiration - A lifecycle rule for when non-current object versions expire.
- Prefix string
- Object key prefix identifying one or more objects to which the rule applies.
- Status string
- Whether the rule is currently being applied. Valid values: Enabled or Disabled.
- Abort
Incomplete S3BucketMultipart Upload Lifecycle Configuration Rule Abort Incomplete Multipart Upload - Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
- Expiration
S3Bucket
Lifecycle Configuration Rule Expiration - A lifecycle rule for when an object expires.
- Id string
- Unique identifier for the rule.
- Noncurrent
Version S3BucketExpiration Lifecycle Configuration Rule Noncurrent Version Expiration - A lifecycle rule for when non-current object versions expire.
- prefix String
- Object key prefix identifying one or more objects to which the rule applies.
- status String
- Whether the rule is currently being applied. Valid values: Enabled or Disabled.
- abort
Incomplete S3BucketMultipart Upload Lifecycle Configuration Rule Abort Incomplete Multipart Upload - Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
- expiration
S3Bucket
Lifecycle Configuration Rule Expiration - A lifecycle rule for when an object expires.
- id String
- Unique identifier for the rule.
- noncurrent
Version S3BucketExpiration Lifecycle Configuration Rule Noncurrent Version Expiration - A lifecycle rule for when non-current object versions expire.
- prefix string
- Object key prefix identifying one or more objects to which the rule applies.
- status string
- Whether the rule is currently being applied. Valid values: Enabled or Disabled.
- abort
Incomplete S3BucketMultipart Upload Lifecycle Configuration Rule Abort Incomplete Multipart Upload - Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
- expiration
S3Bucket
Lifecycle Configuration Rule Expiration - A lifecycle rule for when an object expires.
- id string
- Unique identifier for the rule.
- noncurrent
Version S3BucketExpiration Lifecycle Configuration Rule Noncurrent Version Expiration - A lifecycle rule for when non-current object versions expire.
- prefix str
- Object key prefix identifying one or more objects to which the rule applies.
- status str
- Whether the rule is currently being applied. Valid values: Enabled or Disabled.
- abort_
incomplete_ S3Bucketmultipart_ upload Lifecycle Configuration Rule Abort Incomplete Multipart Upload - Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
- expiration
S3Bucket
Lifecycle Configuration Rule Expiration - A lifecycle rule for when an object expires.
- id str
- Unique identifier for the rule.
- noncurrent_
version_ S3Bucketexpiration Lifecycle Configuration Rule Noncurrent Version Expiration - A lifecycle rule for when non-current object versions expire.
- prefix String
- Object key prefix identifying one or more objects to which the rule applies.
- status String
- Whether the rule is currently being applied. Valid values: Enabled or Disabled.
- abort
Incomplete Property MapMultipart Upload - Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
- expiration Property Map
- A lifecycle rule for when an object expires.
- id String
- Unique identifier for the rule.
- noncurrent
Version Property MapExpiration - A lifecycle rule for when non-current object versions expire.
S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUpload, S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs
- Days
After doubleInitiation - Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
- Days
After float64Initiation - Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
- days
After DoubleInitiation - Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
- days
After numberInitiation - Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
- days_
after_ floatinitiation - Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
- days
After NumberInitiation - Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
S3BucketLifecycleConfigurationRuleExpiration, S3BucketLifecycleConfigurationRuleExpirationArgs
- Date string
- Specifies the date when the object expires. Required if 'days' is not specified.
- Days double
- Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
- Expired
Object boolDelete Marker - Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
- Date string
- Specifies the date when the object expires. Required if 'days' is not specified.
- Days float64
- Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
- Expired
Object boolDelete Marker - Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
- date String
- Specifies the date when the object expires. Required if 'days' is not specified.
- days Double
- Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
- expired
Object BooleanDelete Marker - Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
- date string
- Specifies the date when the object expires. Required if 'days' is not specified.
- days number
- Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
- expired
Object booleanDelete Marker - Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
- date str
- Specifies the date when the object expires. Required if 'days' is not specified.
- days float
- Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
- expired_
object_ booldelete_ marker - Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
- date String
- Specifies the date when the object expires. Required if 'days' is not specified.
- days Number
- Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
- expired
Object BooleanDelete Marker - Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
S3BucketLifecycleConfigurationRuleNoncurrentVersionExpiration, S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs
- Noncurrent
Days double - Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
- Noncurrent
Days float64 - Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
- noncurrent
Days Double - Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
- noncurrent
Days number - Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
- noncurrent_
days float - Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
- noncurrent
Days Number - Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
Import
IONOS Object Storage Bucket lifecycle configuration can be imported using the bucket
name.
$ pulumi import ionoscloud:index/s3BucketLifecycleConfiguration:S3BucketLifecycleConfiguration example example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.