All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.accesscontextmanager.kotlin.ServicePerimeterDryRunIngressPolicy.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.13.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.accesscontextmanager.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.accesscontextmanager.kotlin.outputs.ServicePerimeterDryRunIngressPolicyIngressFrom
import com.pulumi.gcp.accesscontextmanager.kotlin.outputs.ServicePerimeterDryRunIngressPolicyIngressTo
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.gcp.accesscontextmanager.kotlin.outputs.ServicePerimeterDryRunIngressPolicyIngressFrom.Companion.toKotlin as servicePerimeterDryRunIngressPolicyIngressFromToKotlin
import com.pulumi.gcp.accesscontextmanager.kotlin.outputs.ServicePerimeterDryRunIngressPolicyIngressTo.Companion.toKotlin as servicePerimeterDryRunIngressPolicyIngressToToKotlin

/**
 * Builder for [ServicePerimeterDryRunIngressPolicy].
 */
@PulumiTagMarker
public class ServicePerimeterDryRunIngressPolicyResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ServicePerimeterDryRunIngressPolicyArgs =
        ServicePerimeterDryRunIngressPolicyArgs()

    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 ServicePerimeterDryRunIngressPolicyArgsBuilder.() -> Unit) {
        val builder = ServicePerimeterDryRunIngressPolicyArgsBuilder()
        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(): ServicePerimeterDryRunIngressPolicy {
        val builtJavaResource =
            com.pulumi.gcp.accesscontextmanager.ServicePerimeterDryRunIngressPolicy(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return ServicePerimeterDryRunIngressPolicy(builtJavaResource)
    }
}

/**
 * Manage a single IngressPolicy in the spec (dry-run) configuration for a service perimeter.
 * IngressPolicies match requests based on ingressFrom and ingressTo stanzas. For an ingress policy to match,
 * both the ingressFrom and ingressTo stanzas must be matched. If an IngressPolicy matches a request,
 * the request is allowed through the perimeter boundary from outside the perimeter.
 * For example, access from the internet can be allowed either based on an AccessLevel or,
 * for traffic hosted on Google Cloud, the project of the source network.
 * For access from private networks, using the project of the hosting network is required.
 * Individual ingress policies can be limited by restricting which services and/
 * or actions they match using the ingressTo field.
 * > **Note:** By default, updates to this resource will remove the IngressPolicy from the
 * from the perimeter and add it back in a non-atomic manner. To ensure that the new IngressPolicy
 * is added before the old one is removed, add a `lifecycle` block with `create_before_destroy = true` to this resource.
 * To get more information about ServicePerimeterDryRunIngressPolicy, see:
 * * [API documentation](https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.servicePerimeters#ingresspolicy)
 * ## Example Usage
 */
public class ServicePerimeterDryRunIngressPolicy internal constructor(
    override val javaResource: com.pulumi.gcp.accesscontextmanager.ServicePerimeterDryRunIngressPolicy,
) : KotlinCustomResource(javaResource, ServicePerimeterDryRunIngressPolicyMapper) {
    /**
     * Defines the conditions on the source of a request causing this `IngressPolicy`
     * to apply.
     * Structure is documented below.
     */
    public val ingressFrom: Output?
        get() = javaResource.ingressFrom().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    servicePerimeterDryRunIngressPolicyIngressFromToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Defines the conditions on the `ApiOperation` and request destination that cause
     * this `IngressPolicy` to apply.
     * Structure is documented below.
     */
    public val ingressTo: Output?
        get() = javaResource.ingressTo().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    servicePerimeterDryRunIngressPolicyIngressToToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The name of the Service Perimeter to add this resource to.
     * - - -
     */
    public val perimeter: Output
        get() = javaResource.perimeter().applyValue({ args0 -> args0 })
}

public object ServicePerimeterDryRunIngressPolicyMapper :
    ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.accesscontextmanager.ServicePerimeterDryRunIngressPolicy::class == javaResource::class

    override fun map(javaResource: Resource): ServicePerimeterDryRunIngressPolicy =
        ServicePerimeterDryRunIngressPolicy(
            javaResource as
                com.pulumi.gcp.accesscontextmanager.ServicePerimeterDryRunIngressPolicy,
        )
}

/**
 * @see [ServicePerimeterDryRunIngressPolicy].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ServicePerimeterDryRunIngressPolicy].
 */
public suspend fun servicePerimeterDryRunIngressPolicy(
    name: String,
    block: suspend ServicePerimeterDryRunIngressPolicyResourceBuilder.() -> Unit,
): ServicePerimeterDryRunIngressPolicy {
    val builder = ServicePerimeterDryRunIngressPolicyResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ServicePerimeterDryRunIngressPolicy].
 * @param name The _unique_ name of the resulting resource.
 */
public fun servicePerimeterDryRunIngressPolicy(name: String): ServicePerimeterDryRunIngressPolicy {
    val builder = ServicePerimeterDryRunIngressPolicyResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy