com.pulumi.awsnative.ram.kotlin.Permission.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.ram.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin
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.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [Permission].
*/
@PulumiTagMarker
public class PermissionResourceBuilder internal constructor() {
public var name: String? = null
public var args: PermissionArgs = PermissionArgs()
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 PermissionArgsBuilder.() -> Unit) {
val builder = PermissionArgsBuilder()
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(): Permission {
val builtJavaResource = com.pulumi.awsnative.ram.Permission(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Permission(builtJavaResource)
}
}
/**
* Resource type definition for AWS::RAM::Permission
*/
public class Permission internal constructor(
override val javaResource: com.pulumi.awsnative.ram.Permission,
) : KotlinCustomResource(javaResource, PermissionMapper) {
/**
* The Amazon Resource Name (ARN) of the new permission.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* Set to true to use this as the default permission.
*/
public val isResourceTypeDefault: Output
get() = javaResource.isResourceTypeDefault().applyValue({ args0 -> args0 })
/**
* The name of the permission.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The type of managed permission. This can be one of the following values:
* - *AWS_MANAGED_PERMISSION* – AWS created and manages this managed permission. You can associate it with your resource shares, but you can't modify it.
* - *CUSTOMER_MANAGED_PERMISSION* – You, or another principal in your account created this managed permission. You can associate it with your resource shares and create new versions that have different permissions.
*/
public val permissionType: Output
get() = javaResource.permissionType().applyValue({ args0 -> args0 })
/**
* Policy template for the permission.
* Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::RAM::Permission` for more information about the expected schema for this property.
*/
public val policyTemplate: Output
get() = javaResource.policyTemplate().applyValue({ args0 -> args0 })
/**
* The resource type this permission can be used with.
*/
public val resourceType: Output
get() = javaResource.resourceType().applyValue({ args0 -> args0 })
/**
* Specifies a list of one or more tag key and value pairs to attach to the permission.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* Version of the permission.
*/
public val version: Output
get() = javaResource.version().applyValue({ args0 -> args0 })
}
public object PermissionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ram.Permission::class == javaResource::class
override fun map(javaResource: Resource): Permission = Permission(
javaResource as
com.pulumi.awsnative.ram.Permission,
)
}
/**
* @see [Permission].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Permission].
*/
public suspend fun permission(name: String, block: suspend PermissionResourceBuilder.() -> Unit): Permission {
val builder = PermissionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Permission].
* @param name The _unique_ name of the resulting resource.
*/
public fun permission(name: String): Permission {
val builder = PermissionResourceBuilder()
builder.name(name)
return builder.build()
}