com.pulumi.awsnative.iotsitewise.kotlin.AccessPolicy.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.iotsitewise.kotlin
import com.pulumi.awsnative.iotsitewise.kotlin.outputs.AccessPolicyIdentity
import com.pulumi.awsnative.iotsitewise.kotlin.outputs.AccessPolicyResource
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 com.pulumi.awsnative.iotsitewise.kotlin.outputs.AccessPolicyIdentity.Companion.toKotlin as accessPolicyIdentityToKotlin
import com.pulumi.awsnative.iotsitewise.kotlin.outputs.AccessPolicyResource.Companion.toKotlin as accessPolicyResourceToKotlin
/**
* Builder for [AccessPolicy].
*/
@PulumiTagMarker
public class AccessPolicyResourceBuilder internal constructor() {
public var name: String? = null
public var args: AccessPolicyArgs = AccessPolicyArgs()
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 AccessPolicyArgsBuilder.() -> Unit) {
val builder = AccessPolicyArgsBuilder()
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(): AccessPolicy {
val builtJavaResource = com.pulumi.awsnative.iotsitewise.AccessPolicy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AccessPolicy(builtJavaResource)
}
}
/**
* Resource schema for AWS::IoTSiteWise::AccessPolicy
*/
public class AccessPolicy internal constructor(
override val javaResource: com.pulumi.awsnative.iotsitewise.AccessPolicy,
) : KotlinCustomResource(javaResource, AccessPolicyMapper) {
/**
* The ARN of the access policy.
*/
public val accessPolicyArn: Output
get() = javaResource.accessPolicyArn().applyValue({ args0 -> args0 })
/**
* The ID of the access policy.
*/
public val accessPolicyId: Output
get() = javaResource.accessPolicyId().applyValue({ args0 -> args0 })
/**
* The identity for this access policy. Choose either a user or a group but not both.
*/
public val accessPolicyIdentity: Output
get() = javaResource.accessPolicyIdentity().applyValue({ args0 ->
args0.let({ args0 ->
accessPolicyIdentityToKotlin(args0)
})
})
/**
* The permission level for this access policy. Valid values are ADMINISTRATOR or VIEWER.
*/
public val accessPolicyPermission: Output
get() = javaResource.accessPolicyPermission().applyValue({ args0 -> args0 })
/**
* The AWS IoT SiteWise Monitor resource for this access policy. Choose either portal or project but not both.
*/
public val accessPolicyResource: Output
get() = javaResource.accessPolicyResource().applyValue({ args0 ->
args0.let({ args0 ->
accessPolicyResourceToKotlin(args0)
})
})
}
public object AccessPolicyMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iotsitewise.AccessPolicy::class == javaResource::class
override fun map(javaResource: Resource): AccessPolicy = AccessPolicy(
javaResource as
com.pulumi.awsnative.iotsitewise.AccessPolicy,
)
}
/**
* @see [AccessPolicy].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AccessPolicy].
*/
public suspend fun accessPolicy(
name: String,
block: suspend AccessPolicyResourceBuilder.() -> Unit,
): AccessPolicy {
val builder = AccessPolicyResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AccessPolicy].
* @param name The _unique_ name of the resulting resource.
*/
public fun accessPolicy(name: String): AccessPolicy {
val builder = AccessPolicyResourceBuilder()
builder.name(name)
return builder.build()
}