com.pulumi.gcp.accesscontextmanager.kotlin.EgressPolicy.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.gcp.accesscontextmanager.kotlin
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
/**
* Builder for [EgressPolicy].
*/
@PulumiTagMarker
public class EgressPolicyResourceBuilder internal constructor() {
public var name: String? = null
public var args: EgressPolicyArgs = EgressPolicyArgs()
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 EgressPolicyArgsBuilder.() -> Unit) {
val builder = EgressPolicyArgsBuilder()
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(): EgressPolicy {
val builtJavaResource =
com.pulumi.gcp.accesscontextmanager.EgressPolicy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return EgressPolicy(builtJavaResource)
}
}
/**
* This resource has been deprecated, please refer to ServicePerimeterEgressPolicy.
* To get more information about EgressPolicy, see:
* * [API documentation](https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.servicePerimeters#egresspolicy)
* ## Import
* EgressPolicy can be imported using any of these accepted formats:
* * `{{egress_policy_name}}/{{resource}}`
* When using the `pulumi import` command, EgressPolicy can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:accesscontextmanager/egressPolicy:EgressPolicy default {{egress_policy_name}}/{{resource}}
* ```
*/
public class EgressPolicy internal constructor(
override val javaResource: com.pulumi.gcp.accesscontextmanager.EgressPolicy,
) : KotlinCustomResource(javaResource, EgressPolicyMapper) {
/**
* The name of the Service Perimeter to add this resource to.
* - - -
*/
public val egressPolicyName: Output
get() = javaResource.egressPolicyName().applyValue({ args0 -> args0 })
/**
* A GCP resource that is inside of the service perimeter.
*/
public val resource: Output
get() = javaResource.resource().applyValue({ args0 -> args0 })
}
public object EgressPolicyMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.accesscontextmanager.EgressPolicy::class == javaResource::class
override fun map(javaResource: Resource): EgressPolicy = EgressPolicy(
javaResource as
com.pulumi.gcp.accesscontextmanager.EgressPolicy,
)
}
/**
* @see [EgressPolicy].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [EgressPolicy].
*/
public suspend fun egressPolicy(
name: String,
block: suspend EgressPolicyResourceBuilder.() -> Unit,
): EgressPolicy {
val builder = EgressPolicyResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [EgressPolicy].
* @param name The _unique_ name of the resulting resource.
*/
public fun egressPolicy(name: String): EgressPolicy {
val builder = EgressPolicyResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy