com.pulumi.gcp.vmwareengine.kotlin.NetworkPolicyArgs.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.vmwareengine.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.vmwareengine.NetworkPolicyArgs.builder
import com.pulumi.gcp.vmwareengine.kotlin.inputs.NetworkPolicyExternalIpArgs
import com.pulumi.gcp.vmwareengine.kotlin.inputs.NetworkPolicyExternalIpArgsBuilder
import com.pulumi.gcp.vmwareengine.kotlin.inputs.NetworkPolicyInternetAccessArgs
import com.pulumi.gcp.vmwareengine.kotlin.inputs.NetworkPolicyInternetAccessArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Represents a network policy resource. Network policies are regional resources.
* To get more information about NetworkPolicy, see:
* * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.networkPolicies)
* ## Example Usage
* ### Vmware Engine Network Policy Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", {
* name: "standard-nw",
* location: "global",
* type: "STANDARD",
* description: "VMwareEngine standard network sample",
* });
* const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", {
* location: "us-west1",
* name: "sample-network-policy",
* edgeServicesCidr: "192.168.30.0/26",
* vmwareEngineNetwork: network_policy_nw.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* network_policy_nw = gcp.vmwareengine.Network("network-policy-nw",
* name="standard-nw",
* location="global",
* type="STANDARD",
* description="VMwareEngine standard network sample")
* vmw_engine_network_policy = gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy",
* location="us-west1",
* name="sample-network-policy",
* edge_services_cidr="192.168.30.0/26",
* vmware_engine_network=network_policy_nw.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var network_policy_nw = new Gcp.VMwareEngine.Network("network-policy-nw", new()
* {
* Name = "standard-nw",
* Location = "global",
* Type = "STANDARD",
* Description = "VMwareEngine standard network sample",
* });
* var vmw_engine_network_policy = new Gcp.VMwareEngine.NetworkPolicy("vmw-engine-network-policy", new()
* {
* Location = "us-west1",
* Name = "sample-network-policy",
* EdgeServicesCidr = "192.168.30.0/26",
* VmwareEngineNetwork = network_policy_nw.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vmwareengine.NewNetwork(ctx, "network-policy-nw", &vmwareengine.NetworkArgs{
* Name: pulumi.String("standard-nw"),
* Location: pulumi.String("global"),
* Type: pulumi.String("STANDARD"),
* Description: pulumi.String("VMwareEngine standard network sample"),
* })
* if err != nil {
* return err
* }
* _, err = vmwareengine.NewNetworkPolicy(ctx, "vmw-engine-network-policy", &vmwareengine.NetworkPolicyArgs{
* Location: pulumi.String("us-west1"),
* Name: pulumi.String("sample-network-policy"),
* EdgeServicesCidr: pulumi.String("192.168.30.0/26"),
* VmwareEngineNetwork: network_policy_nw.ID(),
* })
* 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.vmwareengine.Network;
* import com.pulumi.gcp.vmwareengine.NetworkArgs;
* import com.pulumi.gcp.vmwareengine.NetworkPolicy;
* import com.pulumi.gcp.vmwareengine.NetworkPolicyArgs;
* 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 network_policy_nw = new Network("network-policy-nw", NetworkArgs.builder()
* .name("standard-nw")
* .location("global")
* .type("STANDARD")
* .description("VMwareEngine standard network sample")
* .build());
* var vmw_engine_network_policy = new NetworkPolicy("vmw-engine-network-policy", NetworkPolicyArgs.builder()
* .location("us-west1")
* .name("sample-network-policy")
* .edgeServicesCidr("192.168.30.0/26")
* .vmwareEngineNetwork(network_policy_nw.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* network-policy-nw:
* type: gcp:vmwareengine:Network
* properties:
* name: standard-nw
* location: global
* type: STANDARD
* description: VMwareEngine standard network sample
* vmw-engine-network-policy:
* type: gcp:vmwareengine:NetworkPolicy
* properties:
* location: us-west1
* name: sample-network-policy
* edgeServicesCidr: 192.168.30.0/26
* vmwareEngineNetwork: ${["network-policy-nw"].id}
* ```
*
* ### Vmware Engine Network Policy Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const network_policy_nw = new gcp.vmwareengine.Network("network-policy-nw", {
* name: "standard-full-nw",
* location: "global",
* type: "STANDARD",
* description: "VMwareEngine standard network sample",
* });
* const vmw_engine_network_policy = new gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy", {
* location: "us-west1",
* name: "sample-network-policy-full",
* edgeServicesCidr: "192.168.30.0/26",
* vmwareEngineNetwork: network_policy_nw.id,
* description: "Sample Network Policy",
* internetAccess: {
* enabled: true,
* },
* externalIp: {
* enabled: true,
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* network_policy_nw = gcp.vmwareengine.Network("network-policy-nw",
* name="standard-full-nw",
* location="global",
* type="STANDARD",
* description="VMwareEngine standard network sample")
* vmw_engine_network_policy = gcp.vmwareengine.NetworkPolicy("vmw-engine-network-policy",
* location="us-west1",
* name="sample-network-policy-full",
* edge_services_cidr="192.168.30.0/26",
* vmware_engine_network=network_policy_nw.id,
* description="Sample Network Policy",
* internet_access=gcp.vmwareengine.NetworkPolicyInternetAccessArgs(
* enabled=True,
* ),
* external_ip=gcp.vmwareengine.NetworkPolicyExternalIpArgs(
* enabled=True,
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var network_policy_nw = new Gcp.VMwareEngine.Network("network-policy-nw", new()
* {
* Name = "standard-full-nw",
* Location = "global",
* Type = "STANDARD",
* Description = "VMwareEngine standard network sample",
* });
* var vmw_engine_network_policy = new Gcp.VMwareEngine.NetworkPolicy("vmw-engine-network-policy", new()
* {
* Location = "us-west1",
* Name = "sample-network-policy-full",
* EdgeServicesCidr = "192.168.30.0/26",
* VmwareEngineNetwork = network_policy_nw.Id,
* Description = "Sample Network Policy",
* InternetAccess = new Gcp.VMwareEngine.Inputs.NetworkPolicyInternetAccessArgs
* {
* Enabled = true,
* },
* ExternalIp = new Gcp.VMwareEngine.Inputs.NetworkPolicyExternalIpArgs
* {
* Enabled = true,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vmwareengine.NewNetwork(ctx, "network-policy-nw", &vmwareengine.NetworkArgs{
* Name: pulumi.String("standard-full-nw"),
* Location: pulumi.String("global"),
* Type: pulumi.String("STANDARD"),
* Description: pulumi.String("VMwareEngine standard network sample"),
* })
* if err != nil {
* return err
* }
* _, err = vmwareengine.NewNetworkPolicy(ctx, "vmw-engine-network-policy", &vmwareengine.NetworkPolicyArgs{
* Location: pulumi.String("us-west1"),
* Name: pulumi.String("sample-network-policy-full"),
* EdgeServicesCidr: pulumi.String("192.168.30.0/26"),
* VmwareEngineNetwork: network_policy_nw.ID(),
* Description: pulumi.String("Sample Network Policy"),
* InternetAccess: &vmwareengine.NetworkPolicyInternetAccessArgs{
* Enabled: pulumi.Bool(true),
* },
* ExternalIp: &vmwareengine.NetworkPolicyExternalIpArgs{
* Enabled: pulumi.Bool(true),
* },
* })
* 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.vmwareengine.Network;
* import com.pulumi.gcp.vmwareengine.NetworkArgs;
* import com.pulumi.gcp.vmwareengine.NetworkPolicy;
* import com.pulumi.gcp.vmwareengine.NetworkPolicyArgs;
* import com.pulumi.gcp.vmwareengine.inputs.NetworkPolicyInternetAccessArgs;
* import com.pulumi.gcp.vmwareengine.inputs.NetworkPolicyExternalIpArgs;
* 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 network_policy_nw = new Network("network-policy-nw", NetworkArgs.builder()
* .name("standard-full-nw")
* .location("global")
* .type("STANDARD")
* .description("VMwareEngine standard network sample")
* .build());
* var vmw_engine_network_policy = new NetworkPolicy("vmw-engine-network-policy", NetworkPolicyArgs.builder()
* .location("us-west1")
* .name("sample-network-policy-full")
* .edgeServicesCidr("192.168.30.0/26")
* .vmwareEngineNetwork(network_policy_nw.id())
* .description("Sample Network Policy")
* .internetAccess(NetworkPolicyInternetAccessArgs.builder()
* .enabled(true)
* .build())
* .externalIp(NetworkPolicyExternalIpArgs.builder()
* .enabled(true)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* network-policy-nw:
* type: gcp:vmwareengine:Network
* properties:
* name: standard-full-nw
* location: global
* type: STANDARD
* description: VMwareEngine standard network sample
* vmw-engine-network-policy:
* type: gcp:vmwareengine:NetworkPolicy
* properties:
* location: us-west1
* name: sample-network-policy-full
* edgeServicesCidr: 192.168.30.0/26
* vmwareEngineNetwork: ${["network-policy-nw"].id}
* description: Sample Network Policy
* internetAccess:
* enabled: true
* externalIp:
* enabled: true
* ```
*
* ## Import
* NetworkPolicy can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}`
* * `{{project}}/{{location}}/{{name}}`
* * `{{location}}/{{name}}`
* When using the `pulumi import` command, NetworkPolicy can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default projects/{{project}}/locations/{{location}}/networkPolicies/{{name}}
* ```
* ```sh
* $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{project}}/{{location}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:vmwareengine/networkPolicy:NetworkPolicy default {{location}}/{{name}}
* ```
* @property description User-provided description for this network policy.
* @property edgeServicesCidr IP address range in CIDR notation used to create internet access and external IP access.
* An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any
* prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
* @property externalIp Network service that allows External IP addresses to be assigned to VMware workloads.
* This service can only be enabled when internetAccess is also enabled.
* Structure is documented below.
* @property internetAccess Network service that allows VMware workloads to access the internet.
* Structure is documented below.
* @property location The resource name of the location (region) to create the new network policy in.
* Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
* For example: projects/my-project/locations/us-central1
* @property name The ID of the Network Policy.
* - - -
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property vmwareEngineNetwork The relative resource name of the VMware Engine network. Specify the name in the following form:
* projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project}
* can either be a project number or a project ID.
*/
public data class NetworkPolicyArgs(
public val description: Output? = null,
public val edgeServicesCidr: Output? = null,
public val externalIp: Output? = null,
public val internetAccess: Output? = null,
public val location: Output? = null,
public val name: Output? = null,
public val project: Output? = null,
public val vmwareEngineNetwork: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.vmwareengine.NetworkPolicyArgs =
com.pulumi.gcp.vmwareengine.NetworkPolicyArgs.builder()
.description(description?.applyValue({ args0 -> args0 }))
.edgeServicesCidr(edgeServicesCidr?.applyValue({ args0 -> args0 }))
.externalIp(externalIp?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.internetAccess(internetAccess?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.location(location?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.vmwareEngineNetwork(vmwareEngineNetwork?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [NetworkPolicyArgs].
*/
@PulumiTagMarker
public class NetworkPolicyArgsBuilder internal constructor() {
private var description: Output? = null
private var edgeServicesCidr: Output? = null
private var externalIp: Output? = null
private var internetAccess: Output? = null
private var location: Output? = null
private var name: Output? = null
private var project: Output? = null
private var vmwareEngineNetwork: Output? = null
/**
* @param value User-provided description for this network policy.
*/
@JvmName("yxefsttcsanhrwff")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value IP address range in CIDR notation used to create internet access and external IP access.
* An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any
* prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
*/
@JvmName("smjykjctyvrogejx")
public suspend fun edgeServicesCidr(`value`: Output) {
this.edgeServicesCidr = value
}
/**
* @param value Network service that allows External IP addresses to be assigned to VMware workloads.
* This service can only be enabled when internetAccess is also enabled.
* Structure is documented below.
*/
@JvmName("wwegddxesrormbcg")
public suspend fun externalIp(`value`: Output) {
this.externalIp = value
}
/**
* @param value Network service that allows VMware workloads to access the internet.
* Structure is documented below.
*/
@JvmName("autmndhxwwujpoqi")
public suspend fun internetAccess(`value`: Output) {
this.internetAccess = value
}
/**
* @param value The resource name of the location (region) to create the new network policy in.
* Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
* For example: projects/my-project/locations/us-central1
*/
@JvmName("fpibkifmbuihgsmm")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value The ID of the Network Policy.
* - - -
*/
@JvmName("lufyxuxdhwsvvbra")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("mgdkkqcysfwilhks")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value The relative resource name of the VMware Engine network. Specify the name in the following form:
* projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project}
* can either be a project number or a project ID.
*/
@JvmName("twhlgrtnudmupgec")
public suspend fun vmwareEngineNetwork(`value`: Output) {
this.vmwareEngineNetwork = value
}
/**
* @param value User-provided description for this network policy.
*/
@JvmName("rxpkdirhibghhykm")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value IP address range in CIDR notation used to create internet access and external IP access.
* An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any
* prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
*/
@JvmName("oqkcsyxsvffbdsft")
public suspend fun edgeServicesCidr(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.edgeServicesCidr = mapped
}
/**
* @param value Network service that allows External IP addresses to be assigned to VMware workloads.
* This service can only be enabled when internetAccess is also enabled.
* Structure is documented below.
*/
@JvmName("lulerumjbvfrierm")
public suspend fun externalIp(`value`: NetworkPolicyExternalIpArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.externalIp = mapped
}
/**
* @param argument Network service that allows External IP addresses to be assigned to VMware workloads.
* This service can only be enabled when internetAccess is also enabled.
* Structure is documented below.
*/
@JvmName("gwptfqwogpbxlqlt")
public suspend fun externalIp(argument: suspend NetworkPolicyExternalIpArgsBuilder.() -> Unit) {
val toBeMapped = NetworkPolicyExternalIpArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.externalIp = mapped
}
/**
* @param value Network service that allows VMware workloads to access the internet.
* Structure is documented below.
*/
@JvmName("jugxtpqeqqmpxier")
public suspend fun internetAccess(`value`: NetworkPolicyInternetAccessArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.internetAccess = mapped
}
/**
* @param argument Network service that allows VMware workloads to access the internet.
* Structure is documented below.
*/
@JvmName("vadqiyetaqsrbqqc")
public suspend fun internetAccess(argument: suspend NetworkPolicyInternetAccessArgsBuilder.() -> Unit) {
val toBeMapped = NetworkPolicyInternetAccessArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.internetAccess = mapped
}
/**
* @param value The resource name of the location (region) to create the new network policy in.
* Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
* For example: projects/my-project/locations/us-central1
*/
@JvmName("yvjpktetenonwfcu")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value The ID of the Network Policy.
* - - -
*/
@JvmName("ilxagbjmdewocapr")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("jawbrheaeuhcyoqu")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value The relative resource name of the VMware Engine network. Specify the name in the following form:
* projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project}
* can either be a project number or a project ID.
*/
@JvmName("nsxbfxofkvfbqxhv")
public suspend fun vmwareEngineNetwork(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.vmwareEngineNetwork = mapped
}
internal fun build(): NetworkPolicyArgs = NetworkPolicyArgs(
description = description,
edgeServicesCidr = edgeServicesCidr,
externalIp = externalIp,
internetAccess = internetAccess,
location = location,
name = name,
project = project,
vmwareEngineNetwork = vmwareEngineNetwork,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy