com.pulumi.awsnative.lightsail.kotlin.Bucket.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.lightsail.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.lightsail.kotlin.outputs.BucketAccessRules
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.lightsail.kotlin.outputs.BucketAccessRules.Companion.toKotlin as bucketAccessRulesToKotlin
/**
* 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.lightsail.Bucket(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Bucket(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::Lightsail::Bucket
*/
public class Bucket internal constructor(
override val javaResource: com.pulumi.awsnative.lightsail.Bucket,
) : KotlinCustomResource(javaResource, BucketMapper) {
/**
* Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle. You can update a bucket's bundle only one time within a monthly AWS billing cycle.
*/
public val ableToUpdateBundle: Output
get() = javaResource.ableToUpdateBundle().applyValue({ args0 -> args0 })
/**
* An object that describes the access rules for the bucket.
*/
public val accessRules: Output?
get() = javaResource.accessRules().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
bucketAccessRulesToKotlin(args0)
})
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the bucket.
*/
public val bucketArn: Output
get() = javaResource.bucketArn().applyValue({ args0 -> args0 })
/**
* The name for the bucket.
*/
public val bucketName: Output
get() = javaResource.bucketName().applyValue({ args0 -> args0 })
/**
* The ID of the bundle to use for the bucket.
*/
public val bundleId: Output
get() = javaResource.bundleId().applyValue({ args0 -> args0 })
/**
* Specifies whether to enable or disable versioning of objects in the bucket.
*/
public val objectVersioning: Output?
get() = javaResource.objectVersioning().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An array of strings to specify the AWS account IDs that can access the bucket.
*/
public val readOnlyAccessAccounts: Output>?
get() = javaResource.readOnlyAccessAccounts().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The names of the Lightsail resources for which to set bucket access.
*/
public val resourcesReceivingAccess: Output>?
get() = javaResource.resourcesReceivingAccess().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The URL of the bucket.
*/
public val url: Output
get() = javaResource.url().applyValue({ args0 -> args0 })
}
public object BucketMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.lightsail.Bucket::class == javaResource::class
override fun map(javaResource: Resource): Bucket = Bucket(
javaResource as
com.pulumi.awsnative.lightsail.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()
}