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

com.pulumi.gcp.networksecurity.kotlin.FirewallEndpoint.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networksecurity.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
import kotlin.collections.List
import kotlin.collections.Map

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

    public var args: FirewallEndpointArgs = FirewallEndpointArgs()

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

/**
 * A Firewall endpoint is a Cloud Firewall resource that enables
 * layer 7 advanced protection capabilities, such as intrusion prevention,
 * in your network.
 * To get more information about FirewallEndpoint, see:
 * * [API documentation](https://cloud.google.com/firewall/docs/reference/network-security/rest/v1/organizations.locations.firewallEndpoints)
 * * How-to Guides
 *     * [Create and associate firewall endpoints](https://cloud.google.com/firewall/docs/configure-firewall-endpoints)
 *     * [Firewall endpoint overview](https://cloud.google.com/firewall/docs/about-firewall-endpoints)
 * > **Warning:** If you are using User ADCs (Application Default Credentials) with this resource,
 * you must specify a `billing_project_id` and set `user_project_override` to true
 * in the provider configuration. Otherwise the ACM API will return a 403 error.
 * Your account must have the `serviceusage.services.use` permission on the
 * `billing_project_id` you defined.
 * ## Example Usage
 * ### Network Security Firewall Endpoint Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.networksecurity.FirewallEndpoint("default", {
 *     name: "my-firewall-endpoint",
 *     parent: "organizations/123456789",
 *     location: "us-central1-a",
 *     billingProjectId: "my-project-name",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.networksecurity.FirewallEndpoint("default",
 *     name="my-firewall-endpoint",
 *     parent="organizations/123456789",
 *     location="us-central1-a",
 *     billing_project_id="my-project-name",
 *     labels={
 *         "foo": "bar",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.NetworkSecurity.FirewallEndpoint("default", new()
 *     {
 *         Name = "my-firewall-endpoint",
 *         Parent = "organizations/123456789",
 *         Location = "us-central1-a",
 *         BillingProjectId = "my-project-name",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := networksecurity.NewFirewallEndpoint(ctx, "default", &networksecurity.FirewallEndpointArgs{
 * 			Name:             pulumi.String("my-firewall-endpoint"),
 * 			Parent:           pulumi.String("organizations/123456789"),
 * 			Location:         pulumi.String("us-central1-a"),
 * 			BillingProjectId: pulumi.String("my-project-name"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.networksecurity.FirewallEndpoint;
 * import com.pulumi.gcp.networksecurity.FirewallEndpointArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var default_ = new FirewallEndpoint("default", FirewallEndpointArgs.builder()
 *             .name("my-firewall-endpoint")
 *             .parent("organizations/123456789")
 *             .location("us-central1-a")
 *             .billingProjectId("my-project-name")
 *             .labels(Map.of("foo", "bar"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networksecurity:FirewallEndpoint
 *     properties:
 *       name: my-firewall-endpoint
 *       parent: organizations/123456789
 *       location: us-central1-a
 *       billingProjectId: my-project-name
 *       labels:
 *         foo: bar
 * ```
 * 
 * ## Import
 * FirewallEndpoint can be imported using any of these accepted formats:
 * * `{{parent}}/locations/{{location}}/firewallEndpoints/{{name}}`
 * When using the `pulumi import` command, FirewallEndpoint can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networksecurity/firewallEndpoint:FirewallEndpoint default {{parent}}/locations/{{location}}/firewallEndpoints/{{name}}
 * ```
 */
public class FirewallEndpoint internal constructor(
    override val javaResource: com.pulumi.gcp.networksecurity.FirewallEndpoint,
) : KotlinCustomResource(javaResource, FirewallEndpointMapper) {
    /**
     * List of networks that are associated with this endpoint in the local zone.
     * This is a projection of the FirewallEndpointAssociations pointing at this
     * endpoint. A network will only appear in this list after traffic routing is
     * fully configured. Format: projects/{project}/global/networks/{name}.
     */
    public val associatedNetworks: Output>
        get() = javaResource.associatedNetworks().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Project to bill on endpoint uptime usage.
     */
    public val billingProjectId: Output
        get() = javaResource.billingProjectId().applyValue({ args0 -> args0 })

    /**
     * Time the firewall endpoint was created in UTC.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * A map of key/value label pairs to assign to the resource.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The location (zone) of the firewall endpoint.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The name of the firewall endpoint resource.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The name of the parent this firewall endpoint belongs to.
     * Format: organizations/{organization_id}.
     * - - -
     */
    public val parent: Output
        get() = javaResource.parent().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Whether reconciling is in progress, recommended per https://google.aip.dev/128.
     */
    public val reconciling: Output
        get() = javaResource.reconciling().applyValue({ args0 -> args0 })

    /**
     * Server-defined URL of this resource.
     */
    public val selfLink: Output
        get() = javaResource.selfLink().applyValue({ args0 -> args0 })

    /**
     * The current state of the endpoint.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Time the firewall endpoint was updated in UTC.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object FirewallEndpointMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.networksecurity.FirewallEndpoint::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy