com.pulumi.awsnative.vpclattice.kotlin.AuthPolicy.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.vpclattice.kotlin
import com.pulumi.awsnative.vpclattice.kotlin.enums.AuthPolicyState
import com.pulumi.awsnative.vpclattice.kotlin.enums.AuthPolicyState.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
/**
* Builder for [AuthPolicy].
*/
@PulumiTagMarker
public class AuthPolicyResourceBuilder internal constructor() {
public var name: String? = null
public var args: AuthPolicyArgs = AuthPolicyArgs()
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 AuthPolicyArgsBuilder.() -> Unit) {
val builder = AuthPolicyArgsBuilder()
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(): AuthPolicy {
val builtJavaResource = com.pulumi.awsnative.vpclattice.AuthPolicy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AuthPolicy(builtJavaResource)
}
}
/**
* Creates or updates the auth policy.
*/
public class AuthPolicy internal constructor(
override val javaResource: com.pulumi.awsnative.vpclattice.AuthPolicy,
) : KotlinCustomResource(javaResource, AuthPolicyMapper) {
/**
* The auth policy.
* Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::VpcLattice::AuthPolicy` for more information about the expected schema for this property.
*/
public val policy: Output
get() = javaResource.policy().applyValue({ args0 -> args0 })
/**
* The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created.
*/
public val resourceIdentifier: Output
get() = javaResource.resourceIdentifier().applyValue({ args0 -> args0 })
/**
* The state of the auth policy. The auth policy is only active when the auth type is set to `AWS _IAM` . If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the auth type is `NONE` , then any auth policy you provide will remain inactive.
*/
public val state: Output
get() = javaResource.state().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
}
public object AuthPolicyMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.vpclattice.AuthPolicy::class == javaResource::class
override fun map(javaResource: Resource): AuthPolicy = AuthPolicy(
javaResource as
com.pulumi.awsnative.vpclattice.AuthPolicy,
)
}
/**
* @see [AuthPolicy].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AuthPolicy].
*/
public suspend fun authPolicy(name: String, block: suspend AuthPolicyResourceBuilder.() -> Unit): AuthPolicy {
val builder = AuthPolicyResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AuthPolicy].
* @param name The _unique_ name of the resulting resource.
*/
public fun authPolicy(name: String): AuthPolicy {
val builder = AuthPolicyResourceBuilder()
builder.name(name)
return builder.build()
}