com.pulumi.awsnative.s3outposts.kotlin.Bucket.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.s3outposts.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.s3outposts.kotlin.outputs.BucketLifecycleConfiguration
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.s3outposts.kotlin.outputs.BucketLifecycleConfiguration.Companion.toKotlin as bucketLifecycleConfigurationToKotlin
/**
* Builder for [Bucket].
*/
@PulumiTagMarker
public class BucketResourceBuilder internal constructor() {
public var name: String? = null
public var args: BucketArgs = BucketArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend BucketArgsBuilder.() -> Unit) {
val builder = BucketArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Bucket {
val builtJavaResource = com.pulumi.awsnative.s3outposts.Bucket(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Bucket(builtJavaResource)
}
}
/**
* Resource Type Definition for AWS::S3Outposts::Bucket
*/
public class Bucket internal constructor(
override val javaResource: com.pulumi.awsnative.s3outposts.Bucket,
) : KotlinCustomResource(javaResource, BucketMapper) {
/**
* The Amazon Resource Name (ARN) of the specified bucket.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* A name for the bucket.
*/
public val bucketName: Output
get() = javaResource.bucketName().applyValue({ args0 -> args0 })
/**
* Rules that define how Amazon S3Outposts manages objects during their lifetime.
*/
public val lifecycleConfiguration: Output?
get() = javaResource.lifecycleConfiguration().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> bucketLifecycleConfigurationToKotlin(args0) })
}).orElse(null)
})
/**
* The id of the customer outpost on which the bucket resides.
*/
public val outpostId: Output
get() = javaResource.outpostId().applyValue({ args0 -> args0 })
/**
* An arbitrary set of tags (key-value pairs) for this S3Outposts bucket.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object BucketMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.s3outposts.Bucket::class == javaResource::class
override fun map(javaResource: Resource): Bucket = Bucket(
javaResource as
com.pulumi.awsnative.s3outposts.Bucket,
)
}
/**
* @see [Bucket].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Bucket].
*/
public suspend fun bucket(name: String, block: suspend BucketResourceBuilder.() -> Unit): Bucket {
val builder = BucketResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Bucket].
* @param name The _unique_ name of the resulting resource.
*/
public fun bucket(name: String): Bucket {
val builder = BucketResourceBuilder()
builder.name(name)
return builder.build()
}