com.pulumi.awsnative.s3.kotlin.outputs.BucketRule.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.s3.kotlin.outputs
import com.pulumi.awsnative.s3.kotlin.enums.BucketRuleStatus
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
/**
* Specifies lifecycle rules for an Amazon S3 bucket. For more information, see [Put Bucket Lifecycle Configuration](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html) in the *Amazon S3 API Reference*.
* You must specify at least one of the following properties: ``AbortIncompleteMultipartUpload``, ``ExpirationDate``, ``ExpirationInDays``, ``NoncurrentVersionExpirationInDays``, ``NoncurrentVersionTransition``, ``NoncurrentVersionTransitions``, ``Transition``, or ``Transitions``.
* @property abortIncompleteMultipartUpload Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket.
* @property expirationDate Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. The date value must be in ISO 8601 format. The time is always midnight UTC. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
* @property expirationInDays Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time.
* @property expiredObjectDeleteMarker Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions. If set to true, the delete marker will be removed if there are no noncurrent versions. This cannot be specified with ``ExpirationInDays``, ``ExpirationDate``, or ``TagFilters``.
* @property id Unique identifier for the rule. The value can't be longer than 255 characters.
* @property noncurrentVersionExpiration Specifies when noncurrent object versions expire. Upon expiration, S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that S3 delete noncurrent object versions at a specific period in the object's lifetime.
* @property noncurrentVersionExpirationInDays (Deprecated.) For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.
* @property noncurrentVersionTransition (Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don't specify the ``NoncurrentVersionTransitions`` property.
* @property noncurrentVersionTransitions For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don't specify the ``NoncurrentVersionTransition`` property.
* @property objectSizeGreaterThan Specifies the minimum object size in bytes for this rule to apply to. Objects must be larger than this value in bytes. For more information about size based rules, see [Lifecycle configuration using size-based rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) in the *Amazon S3 User Guide*.
* @property objectSizeLessThan Specifies the maximum object size in bytes for this rule to apply to. Objects must be smaller than this value in bytes. For more information about sized based rules, see [Lifecycle configuration using size-based rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) in the *Amazon S3 User Guide*.
* @property prefix Object key prefix that identifies one or more objects to which this rule applies.
* Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
* @property status If ``Enabled``, the rule is currently being applied. If ``Disabled``, the rule is not currently being applied.
* @property tagFilters Tags to use to identify a subset of objects to which the lifecycle rule applies.
* @property transition (Deprecated.) Specifies when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don't specify the ``Transitions`` property.
* @property transitions One or more transition rules that specify when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don't specify the ``Transition`` property.
*/
public data class BucketRule(
public val abortIncompleteMultipartUpload: BucketAbortIncompleteMultipartUpload? = null,
public val expirationDate: String? = null,
public val expirationInDays: Int? = null,
public val expiredObjectDeleteMarker: Boolean? = null,
public val id: String? = null,
public val noncurrentVersionExpiration: BucketNoncurrentVersionExpiration? = null,
public val noncurrentVersionExpirationInDays: Int? = null,
public val noncurrentVersionTransition: BucketNoncurrentVersionTransition? = null,
public val noncurrentVersionTransitions: List? = null,
public val objectSizeGreaterThan: String? = null,
public val objectSizeLessThan: String? = null,
public val prefix: String? = null,
public val status: BucketRuleStatus,
public val tagFilters: List? = null,
public val transition: BucketTransition? = null,
public val transitions: List? = null,
) {
public companion object {
public fun toKotlin(javaType: com.pulumi.awsnative.s3.outputs.BucketRule): BucketRule =
BucketRule(
abortIncompleteMultipartUpload = javaType.abortIncompleteMultipartUpload().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.s3.kotlin.outputs.BucketAbortIncompleteMultipartUpload.Companion.toKotlin(args0)
})
}).orElse(null),
expirationDate = javaType.expirationDate().map({ args0 -> args0 }).orElse(null),
expirationInDays = javaType.expirationInDays().map({ args0 -> args0 }).orElse(null),
expiredObjectDeleteMarker = javaType.expiredObjectDeleteMarker().map({ args0 ->
args0
}).orElse(null),
id = javaType.id().map({ args0 -> args0 }).orElse(null),
noncurrentVersionExpiration = javaType.noncurrentVersionExpiration().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.s3.kotlin.outputs.BucketNoncurrentVersionExpiration.Companion.toKotlin(args0)
})
}).orElse(null),
noncurrentVersionExpirationInDays = javaType.noncurrentVersionExpirationInDays().map({ args0 ->
args0
}).orElse(null),
noncurrentVersionTransition = javaType.noncurrentVersionTransition().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.s3.kotlin.outputs.BucketNoncurrentVersionTransition.Companion.toKotlin(args0)
})
}).orElse(null),
noncurrentVersionTransitions = javaType.noncurrentVersionTransitions().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.s3.kotlin.outputs.BucketNoncurrentVersionTransition.Companion.toKotlin(args0)
})
}),
objectSizeGreaterThan = javaType.objectSizeGreaterThan().map({ args0 -> args0 }).orElse(null),
objectSizeLessThan = javaType.objectSizeLessThan().map({ args0 -> args0 }).orElse(null),
prefix = javaType.prefix().map({ args0 -> args0 }).orElse(null),
status = javaType.status().let({ args0 ->
com.pulumi.awsnative.s3.kotlin.enums.BucketRuleStatus.Companion.toKotlin(args0)
}),
tagFilters = javaType.tagFilters().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.s3.kotlin.outputs.BucketTagFilter.Companion.toKotlin(args0)
})
}),
transition = javaType.transition().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.s3.kotlin.outputs.BucketTransition.Companion.toKotlin(args0)
})
}).orElse(null),
transitions = javaType.transitions().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.s3.kotlin.outputs.BucketTransition.Companion.toKotlin(args0)
})
}),
)
}
}