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

com.pulumi.gcp.vmwareengine.kotlin.ExternalAccessRuleArgs.kt Maven / Gradle / Ivy

@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.ExternalAccessRuleArgs.builder
import com.pulumi.gcp.vmwareengine.kotlin.inputs.ExternalAccessRuleDestinationIpRangeArgs
import com.pulumi.gcp.vmwareengine.kotlin.inputs.ExternalAccessRuleDestinationIpRangeArgsBuilder
import com.pulumi.gcp.vmwareengine.kotlin.inputs.ExternalAccessRuleSourceIpRangeArgs
import com.pulumi.gcp.vmwareengine.kotlin.inputs.ExternalAccessRuleSourceIpRangeArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * External access firewall rules for filtering incoming traffic destined to `ExternalAddress` resources.
 * To get more information about ExternalAccessRule, see:
 * * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.networkPolicies.externalAccessRules)
 * ## Example Usage
 * ### Vmware Engine External Access Rule Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const external_access_rule_nw = new gcp.vmwareengine.Network("external-access-rule-nw", {
 *     name: "sample-nw",
 *     location: "global",
 *     type: "STANDARD",
 *     description: "PC network description.",
 * });
 * const external_access_rule_np = new gcp.vmwareengine.NetworkPolicy("external-access-rule-np", {
 *     location: "us-west1",
 *     name: "sample-np",
 *     edgeServicesCidr: "192.168.30.0/26",
 *     vmwareEngineNetwork: external_access_rule_nw.id,
 * });
 * const vmw_engine_external_access_rule = new gcp.vmwareengine.ExternalAccessRule("vmw-engine-external-access-rule", {
 *     name: "sample-external-access-rule",
 *     parent: external_access_rule_np.id,
 *     priority: 101,
 *     action: "DENY",
 *     ipProtocol: "TCP",
 *     sourceIpRanges: [{
 *         ipAddressRange: "0.0.0.0/0",
 *     }],
 *     sourcePorts: ["80"],
 *     destinationIpRanges: [{
 *         ipAddressRange: "0.0.0.0/0",
 *     }],
 *     destinationPorts: ["433"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * external_access_rule_nw = gcp.vmwareengine.Network("external-access-rule-nw",
 *     name="sample-nw",
 *     location="global",
 *     type="STANDARD",
 *     description="PC network description.")
 * external_access_rule_np = gcp.vmwareengine.NetworkPolicy("external-access-rule-np",
 *     location="us-west1",
 *     name="sample-np",
 *     edge_services_cidr="192.168.30.0/26",
 *     vmware_engine_network=external_access_rule_nw.id)
 * vmw_engine_external_access_rule = gcp.vmwareengine.ExternalAccessRule("vmw-engine-external-access-rule",
 *     name="sample-external-access-rule",
 *     parent=external_access_rule_np.id,
 *     priority=101,
 *     action="DENY",
 *     ip_protocol="TCP",
 *     source_ip_ranges=[{
 *         "ip_address_range": "0.0.0.0/0",
 *     }],
 *     source_ports=["80"],
 *     destination_ip_ranges=[{
 *         "ip_address_range": "0.0.0.0/0",
 *     }],
 *     destination_ports=["433"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var external_access_rule_nw = new Gcp.VMwareEngine.Network("external-access-rule-nw", new()
 *     {
 *         Name = "sample-nw",
 *         Location = "global",
 *         Type = "STANDARD",
 *         Description = "PC network description.",
 *     });
 *     var external_access_rule_np = new Gcp.VMwareEngine.NetworkPolicy("external-access-rule-np", new()
 *     {
 *         Location = "us-west1",
 *         Name = "sample-np",
 *         EdgeServicesCidr = "192.168.30.0/26",
 *         VmwareEngineNetwork = external_access_rule_nw.Id,
 *     });
 *     var vmw_engine_external_access_rule = new Gcp.VMwareEngine.ExternalAccessRule("vmw-engine-external-access-rule", new()
 *     {
 *         Name = "sample-external-access-rule",
 *         Parent = external_access_rule_np.Id,
 *         Priority = 101,
 *         Action = "DENY",
 *         IpProtocol = "TCP",
 *         SourceIpRanges = new[]
 *         {
 *             new Gcp.VMwareEngine.Inputs.ExternalAccessRuleSourceIpRangeArgs
 *             {
 *                 IpAddressRange = "0.0.0.0/0",
 *             },
 *         },
 *         SourcePorts = new[]
 *         {
 *             "80",
 *         },
 *         DestinationIpRanges = new[]
 *         {
 *             new Gcp.VMwareEngine.Inputs.ExternalAccessRuleDestinationIpRangeArgs
 *             {
 *                 IpAddressRange = "0.0.0.0/0",
 *             },
 *         },
 *         DestinationPorts = new[]
 *         {
 *             "433",
 *         },
 *     });
 * });
 * ```
 * ```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, "external-access-rule-nw", &vmwareengine.NetworkArgs{
 * 			Name:        pulumi.String("sample-nw"),
 * 			Location:    pulumi.String("global"),
 * 			Type:        pulumi.String("STANDARD"),
 * 			Description: pulumi.String("PC network description."),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewNetworkPolicy(ctx, "external-access-rule-np", &vmwareengine.NetworkPolicyArgs{
 * 			Location:            pulumi.String("us-west1"),
 * 			Name:                pulumi.String("sample-np"),
 * 			EdgeServicesCidr:    pulumi.String("192.168.30.0/26"),
 * 			VmwareEngineNetwork: external_access_rule_nw.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewExternalAccessRule(ctx, "vmw-engine-external-access-rule", &vmwareengine.ExternalAccessRuleArgs{
 * 			Name:       pulumi.String("sample-external-access-rule"),
 * 			Parent:     external_access_rule_np.ID(),
 * 			Priority:   pulumi.Int(101),
 * 			Action:     pulumi.String("DENY"),
 * 			IpProtocol: pulumi.String("TCP"),
 * 			SourceIpRanges: vmwareengine.ExternalAccessRuleSourceIpRangeArray{
 * 				&vmwareengine.ExternalAccessRuleSourceIpRangeArgs{
 * 					IpAddressRange: pulumi.String("0.0.0.0/0"),
 * 				},
 * 			},
 * 			SourcePorts: pulumi.StringArray{
 * 				pulumi.String("80"),
 * 			},
 * 			DestinationIpRanges: vmwareengine.ExternalAccessRuleDestinationIpRangeArray{
 * 				&vmwareengine.ExternalAccessRuleDestinationIpRangeArgs{
 * 					IpAddressRange: pulumi.String("0.0.0.0/0"),
 * 				},
 * 			},
 * 			DestinationPorts: pulumi.StringArray{
 * 				pulumi.String("433"),
 * 			},
 * 		})
 * 		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.ExternalAccessRule;
 * import com.pulumi.gcp.vmwareengine.ExternalAccessRuleArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.ExternalAccessRuleSourceIpRangeArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.ExternalAccessRuleDestinationIpRangeArgs;
 * 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 external_access_rule_nw = new Network("external-access-rule-nw", NetworkArgs.builder()
 *             .name("sample-nw")
 *             .location("global")
 *             .type("STANDARD")
 *             .description("PC network description.")
 *             .build());
 *         var external_access_rule_np = new NetworkPolicy("external-access-rule-np", NetworkPolicyArgs.builder()
 *             .location("us-west1")
 *             .name("sample-np")
 *             .edgeServicesCidr("192.168.30.0/26")
 *             .vmwareEngineNetwork(external_access_rule_nw.id())
 *             .build());
 *         var vmw_engine_external_access_rule = new ExternalAccessRule("vmw-engine-external-access-rule", ExternalAccessRuleArgs.builder()
 *             .name("sample-external-access-rule")
 *             .parent(external_access_rule_np.id())
 *             .priority(101)
 *             .action("DENY")
 *             .ipProtocol("TCP")
 *             .sourceIpRanges(ExternalAccessRuleSourceIpRangeArgs.builder()
 *                 .ipAddressRange("0.0.0.0/0")
 *                 .build())
 *             .sourcePorts("80")
 *             .destinationIpRanges(ExternalAccessRuleDestinationIpRangeArgs.builder()
 *                 .ipAddressRange("0.0.0.0/0")
 *                 .build())
 *             .destinationPorts("433")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   external-access-rule-nw:
 *     type: gcp:vmwareengine:Network
 *     properties:
 *       name: sample-nw
 *       location: global
 *       type: STANDARD
 *       description: PC network description.
 *   external-access-rule-np:
 *     type: gcp:vmwareengine:NetworkPolicy
 *     properties:
 *       location: us-west1
 *       name: sample-np
 *       edgeServicesCidr: 192.168.30.0/26
 *       vmwareEngineNetwork: ${["external-access-rule-nw"].id}
 *   vmw-engine-external-access-rule:
 *     type: gcp:vmwareengine:ExternalAccessRule
 *     properties:
 *       name: sample-external-access-rule
 *       parent: ${["external-access-rule-np"].id}
 *       priority: 101
 *       action: DENY
 *       ipProtocol: TCP
 *       sourceIpRanges:
 *         - ipAddressRange: 0.0.0.0/0
 *       sourcePorts:
 *         - '80'
 *       destinationIpRanges:
 *         - ipAddressRange: 0.0.0.0/0
 *       destinationPorts:
 *         - '433'
 * ```
 * 
 * ### Vmware Engine External Access Rule Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const external_access_rule_nw = new gcp.vmwareengine.Network("external-access-rule-nw", {
 *     name: "sample-nw",
 *     location: "global",
 *     type: "STANDARD",
 *     description: "PC network description.",
 * });
 * const external_access_rule_pc = new gcp.vmwareengine.PrivateCloud("external-access-rule-pc", {
 *     location: "us-west1-a",
 *     name: "sample-pc",
 *     description: "Sample test PC.",
 *     networkConfig: {
 *         managementCidr: "192.168.50.0/24",
 *         vmwareEngineNetwork: external_access_rule_nw.id,
 *     },
 *     managementCluster: {
 *         clusterId: "sample-mgmt-cluster",
 *         nodeTypeConfigs: [{
 *             nodeTypeId: "standard-72",
 *             nodeCount: 3,
 *         }],
 *     },
 * });
 * const external_access_rule_np = new gcp.vmwareengine.NetworkPolicy("external-access-rule-np", {
 *     location: "us-west1",
 *     name: "sample-np",
 *     edgeServicesCidr: "192.168.30.0/26",
 *     vmwareEngineNetwork: external_access_rule_nw.id,
 * });
 * const external_access_rule_ea = new gcp.vmwareengine.ExternalAddress("external-access-rule-ea", {
 *     name: "sample-ea",
 *     parent: external_access_rule_pc.id,
 *     internalIp: "192.168.0.65",
 * });
 * const vmw_engine_external_access_rule = new gcp.vmwareengine.ExternalAccessRule("vmw-engine-external-access-rule", {
 *     name: "sample-external-access-rule",
 *     parent: external_access_rule_np.id,
 *     description: "Sample Description",
 *     priority: 101,
 *     action: "ALLOW",
 *     ipProtocol: "tcp",
 *     sourceIpRanges: [{
 *         ipAddressRange: "0.0.0.0/0",
 *     }],
 *     sourcePorts: ["80"],
 *     destinationIpRanges: [{
 *         externalAddress: external_access_rule_ea.id,
 *     }],
 *     destinationPorts: ["433"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * external_access_rule_nw = gcp.vmwareengine.Network("external-access-rule-nw",
 *     name="sample-nw",
 *     location="global",
 *     type="STANDARD",
 *     description="PC network description.")
 * external_access_rule_pc = gcp.vmwareengine.PrivateCloud("external-access-rule-pc",
 *     location="us-west1-a",
 *     name="sample-pc",
 *     description="Sample test PC.",
 *     network_config={
 *         "management_cidr": "192.168.50.0/24",
 *         "vmware_engine_network": external_access_rule_nw.id,
 *     },
 *     management_cluster={
 *         "cluster_id": "sample-mgmt-cluster",
 *         "node_type_configs": [{
 *             "node_type_id": "standard-72",
 *             "node_count": 3,
 *         }],
 *     })
 * external_access_rule_np = gcp.vmwareengine.NetworkPolicy("external-access-rule-np",
 *     location="us-west1",
 *     name="sample-np",
 *     edge_services_cidr="192.168.30.0/26",
 *     vmware_engine_network=external_access_rule_nw.id)
 * external_access_rule_ea = gcp.vmwareengine.ExternalAddress("external-access-rule-ea",
 *     name="sample-ea",
 *     parent=external_access_rule_pc.id,
 *     internal_ip="192.168.0.65")
 * vmw_engine_external_access_rule = gcp.vmwareengine.ExternalAccessRule("vmw-engine-external-access-rule",
 *     name="sample-external-access-rule",
 *     parent=external_access_rule_np.id,
 *     description="Sample Description",
 *     priority=101,
 *     action="ALLOW",
 *     ip_protocol="tcp",
 *     source_ip_ranges=[{
 *         "ip_address_range": "0.0.0.0/0",
 *     }],
 *     source_ports=["80"],
 *     destination_ip_ranges=[{
 *         "external_address": external_access_rule_ea.id,
 *     }],
 *     destination_ports=["433"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var external_access_rule_nw = new Gcp.VMwareEngine.Network("external-access-rule-nw", new()
 *     {
 *         Name = "sample-nw",
 *         Location = "global",
 *         Type = "STANDARD",
 *         Description = "PC network description.",
 *     });
 *     var external_access_rule_pc = new Gcp.VMwareEngine.PrivateCloud("external-access-rule-pc", new()
 *     {
 *         Location = "us-west1-a",
 *         Name = "sample-pc",
 *         Description = "Sample test PC.",
 *         NetworkConfig = new Gcp.VMwareEngine.Inputs.PrivateCloudNetworkConfigArgs
 *         {
 *             ManagementCidr = "192.168.50.0/24",
 *             VmwareEngineNetwork = external_access_rule_nw.Id,
 *         },
 *         ManagementCluster = new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterArgs
 *         {
 *             ClusterId = "sample-mgmt-cluster",
 *             NodeTypeConfigs = new[]
 *             {
 *                 new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterNodeTypeConfigArgs
 *                 {
 *                     NodeTypeId = "standard-72",
 *                     NodeCount = 3,
 *                 },
 *             },
 *         },
 *     });
 *     var external_access_rule_np = new Gcp.VMwareEngine.NetworkPolicy("external-access-rule-np", new()
 *     {
 *         Location = "us-west1",
 *         Name = "sample-np",
 *         EdgeServicesCidr = "192.168.30.0/26",
 *         VmwareEngineNetwork = external_access_rule_nw.Id,
 *     });
 *     var external_access_rule_ea = new Gcp.VMwareEngine.ExternalAddress("external-access-rule-ea", new()
 *     {
 *         Name = "sample-ea",
 *         Parent = external_access_rule_pc.Id,
 *         InternalIp = "192.168.0.65",
 *     });
 *     var vmw_engine_external_access_rule = new Gcp.VMwareEngine.ExternalAccessRule("vmw-engine-external-access-rule", new()
 *     {
 *         Name = "sample-external-access-rule",
 *         Parent = external_access_rule_np.Id,
 *         Description = "Sample Description",
 *         Priority = 101,
 *         Action = "ALLOW",
 *         IpProtocol = "tcp",
 *         SourceIpRanges = new[]
 *         {
 *             new Gcp.VMwareEngine.Inputs.ExternalAccessRuleSourceIpRangeArgs
 *             {
 *                 IpAddressRange = "0.0.0.0/0",
 *             },
 *         },
 *         SourcePorts = new[]
 *         {
 *             "80",
 *         },
 *         DestinationIpRanges = new[]
 *         {
 *             new Gcp.VMwareEngine.Inputs.ExternalAccessRuleDestinationIpRangeArgs
 *             {
 *                 ExternalAddress = external_access_rule_ea.Id,
 *             },
 *         },
 *         DestinationPorts = new[]
 *         {
 *             "433",
 *         },
 *     });
 * });
 * ```
 * ```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, "external-access-rule-nw", &vmwareengine.NetworkArgs{
 * 			Name:        pulumi.String("sample-nw"),
 * 			Location:    pulumi.String("global"),
 * 			Type:        pulumi.String("STANDARD"),
 * 			Description: pulumi.String("PC network description."),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewPrivateCloud(ctx, "external-access-rule-pc", &vmwareengine.PrivateCloudArgs{
 * 			Location:    pulumi.String("us-west1-a"),
 * 			Name:        pulumi.String("sample-pc"),
 * 			Description: pulumi.String("Sample test PC."),
 * 			NetworkConfig: &vmwareengine.PrivateCloudNetworkConfigArgs{
 * 				ManagementCidr:      pulumi.String("192.168.50.0/24"),
 * 				VmwareEngineNetwork: external_access_rule_nw.ID(),
 * 			},
 * 			ManagementCluster: &vmwareengine.PrivateCloudManagementClusterArgs{
 * 				ClusterId: pulumi.String("sample-mgmt-cluster"),
 * 				NodeTypeConfigs: vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArray{
 * 					&vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArgs{
 * 						NodeTypeId: pulumi.String("standard-72"),
 * 						NodeCount:  pulumi.Int(3),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewNetworkPolicy(ctx, "external-access-rule-np", &vmwareengine.NetworkPolicyArgs{
 * 			Location:            pulumi.String("us-west1"),
 * 			Name:                pulumi.String("sample-np"),
 * 			EdgeServicesCidr:    pulumi.String("192.168.30.0/26"),
 * 			VmwareEngineNetwork: external_access_rule_nw.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewExternalAddress(ctx, "external-access-rule-ea", &vmwareengine.ExternalAddressArgs{
 * 			Name:       pulumi.String("sample-ea"),
 * 			Parent:     external_access_rule_pc.ID(),
 * 			InternalIp: pulumi.String("192.168.0.65"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewExternalAccessRule(ctx, "vmw-engine-external-access-rule", &vmwareengine.ExternalAccessRuleArgs{
 * 			Name:        pulumi.String("sample-external-access-rule"),
 * 			Parent:      external_access_rule_np.ID(),
 * 			Description: pulumi.String("Sample Description"),
 * 			Priority:    pulumi.Int(101),
 * 			Action:      pulumi.String("ALLOW"),
 * 			IpProtocol:  pulumi.String("tcp"),
 * 			SourceIpRanges: vmwareengine.ExternalAccessRuleSourceIpRangeArray{
 * 				&vmwareengine.ExternalAccessRuleSourceIpRangeArgs{
 * 					IpAddressRange: pulumi.String("0.0.0.0/0"),
 * 				},
 * 			},
 * 			SourcePorts: pulumi.StringArray{
 * 				pulumi.String("80"),
 * 			},
 * 			DestinationIpRanges: vmwareengine.ExternalAccessRuleDestinationIpRangeArray{
 * 				&vmwareengine.ExternalAccessRuleDestinationIpRangeArgs{
 * 					ExternalAddress: external_access_rule_ea.ID(),
 * 				},
 * 			},
 * 			DestinationPorts: pulumi.StringArray{
 * 				pulumi.String("433"),
 * 			},
 * 		})
 * 		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.PrivateCloud;
 * import com.pulumi.gcp.vmwareengine.PrivateCloudArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudNetworkConfigArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudManagementClusterArgs;
 * import com.pulumi.gcp.vmwareengine.NetworkPolicy;
 * import com.pulumi.gcp.vmwareengine.NetworkPolicyArgs;
 * import com.pulumi.gcp.vmwareengine.ExternalAddress;
 * import com.pulumi.gcp.vmwareengine.ExternalAddressArgs;
 * import com.pulumi.gcp.vmwareengine.ExternalAccessRule;
 * import com.pulumi.gcp.vmwareengine.ExternalAccessRuleArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.ExternalAccessRuleSourceIpRangeArgs;
 * import com.pulumi.gcp.vmwareengine.inputs.ExternalAccessRuleDestinationIpRangeArgs;
 * 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 external_access_rule_nw = new Network("external-access-rule-nw", NetworkArgs.builder()
 *             .name("sample-nw")
 *             .location("global")
 *             .type("STANDARD")
 *             .description("PC network description.")
 *             .build());
 *         var external_access_rule_pc = new PrivateCloud("external-access-rule-pc", PrivateCloudArgs.builder()
 *             .location("us-west1-a")
 *             .name("sample-pc")
 *             .description("Sample test PC.")
 *             .networkConfig(PrivateCloudNetworkConfigArgs.builder()
 *                 .managementCidr("192.168.50.0/24")
 *                 .vmwareEngineNetwork(external_access_rule_nw.id())
 *                 .build())
 *             .managementCluster(PrivateCloudManagementClusterArgs.builder()
 *                 .clusterId("sample-mgmt-cluster")
 *                 .nodeTypeConfigs(PrivateCloudManagementClusterNodeTypeConfigArgs.builder()
 *                     .nodeTypeId("standard-72")
 *                     .nodeCount(3)
 *                     .build())
 *                 .build())
 *             .build());
 *         var external_access_rule_np = new NetworkPolicy("external-access-rule-np", NetworkPolicyArgs.builder()
 *             .location("us-west1")
 *             .name("sample-np")
 *             .edgeServicesCidr("192.168.30.0/26")
 *             .vmwareEngineNetwork(external_access_rule_nw.id())
 *             .build());
 *         var external_access_rule_ea = new ExternalAddress("external-access-rule-ea", ExternalAddressArgs.builder()
 *             .name("sample-ea")
 *             .parent(external_access_rule_pc.id())
 *             .internalIp("192.168.0.65")
 *             .build());
 *         var vmw_engine_external_access_rule = new ExternalAccessRule("vmw-engine-external-access-rule", ExternalAccessRuleArgs.builder()
 *             .name("sample-external-access-rule")
 *             .parent(external_access_rule_np.id())
 *             .description("Sample Description")
 *             .priority(101)
 *             .action("ALLOW")
 *             .ipProtocol("tcp")
 *             .sourceIpRanges(ExternalAccessRuleSourceIpRangeArgs.builder()
 *                 .ipAddressRange("0.0.0.0/0")
 *                 .build())
 *             .sourcePorts("80")
 *             .destinationIpRanges(ExternalAccessRuleDestinationIpRangeArgs.builder()
 *                 .externalAddress(external_access_rule_ea.id())
 *                 .build())
 *             .destinationPorts("433")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   external-access-rule-nw:
 *     type: gcp:vmwareengine:Network
 *     properties:
 *       name: sample-nw
 *       location: global
 *       type: STANDARD
 *       description: PC network description.
 *   external-access-rule-pc:
 *     type: gcp:vmwareengine:PrivateCloud
 *     properties:
 *       location: us-west1-a
 *       name: sample-pc
 *       description: Sample test PC.
 *       networkConfig:
 *         managementCidr: 192.168.50.0/24
 *         vmwareEngineNetwork: ${["external-access-rule-nw"].id}
 *       managementCluster:
 *         clusterId: sample-mgmt-cluster
 *         nodeTypeConfigs:
 *           - nodeTypeId: standard-72
 *             nodeCount: 3
 *   external-access-rule-np:
 *     type: gcp:vmwareengine:NetworkPolicy
 *     properties:
 *       location: us-west1
 *       name: sample-np
 *       edgeServicesCidr: 192.168.30.0/26
 *       vmwareEngineNetwork: ${["external-access-rule-nw"].id}
 *   external-access-rule-ea:
 *     type: gcp:vmwareengine:ExternalAddress
 *     properties:
 *       name: sample-ea
 *       parent: ${["external-access-rule-pc"].id}
 *       internalIp: 192.168.0.65
 *   vmw-engine-external-access-rule:
 *     type: gcp:vmwareengine:ExternalAccessRule
 *     properties:
 *       name: sample-external-access-rule
 *       parent: ${["external-access-rule-np"].id}
 *       description: Sample Description
 *       priority: 101
 *       action: ALLOW
 *       ipProtocol: tcp
 *       sourceIpRanges:
 *         - ipAddressRange: 0.0.0.0/0
 *       sourcePorts:
 *         - '80'
 *       destinationIpRanges:
 *         - externalAddress: ${["external-access-rule-ea"].id}
 *       destinationPorts:
 *         - '433'
 * ```
 * 
 * ## Import
 * ExternalAccessRule can be imported using any of these accepted formats:
 * * `{{parent}}/externalAccessRules/{{name}}`
 * When using the `pulumi import` command, ExternalAccessRule can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:vmwareengine/externalAccessRule:ExternalAccessRule default {{parent}}/externalAccessRules/{{name}}
 * ```
 * @property action The action that the external access rule performs.
 * Possible values are: `ALLOW`, `DENY`.
 * @property description User-provided description for the external access rule.
 * @property destinationIpRanges If destination ranges are specified, the external access rule applies only to
 * traffic that has a destination IP address in these ranges.
 * Structure is documented below.
 * @property destinationPorts A list of destination ports to which the external access rule applies.
 * @property ipProtocol The IP protocol to which the external access rule applies.
 * @property name The ID of the external access rule.
 * @property parent The resource name of the network policy.
 * 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-west1-a/networkPolicies/my-policy
 * @property priority External access rule priority, which determines the external access rule to use when multiple rules apply.
 * @property sourceIpRanges If source ranges are specified, the external access rule applies only to
 * traffic that has a source IP address in these ranges.
 * Structure is documented below.
 * @property sourcePorts A list of source ports to which the external access rule applies.
 */
public data class ExternalAccessRuleArgs(
    public val action: Output? = null,
    public val description: Output? = null,
    public val destinationIpRanges: Output>? = null,
    public val destinationPorts: Output>? = null,
    public val ipProtocol: Output? = null,
    public val name: Output? = null,
    public val parent: Output? = null,
    public val priority: Output? = null,
    public val sourceIpRanges: Output>? = null,
    public val sourcePorts: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.vmwareengine.ExternalAccessRuleArgs =
        com.pulumi.gcp.vmwareengine.ExternalAccessRuleArgs.builder()
            .action(action?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .destinationIpRanges(
                destinationIpRanges?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .destinationPorts(destinationPorts?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .ipProtocol(ipProtocol?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parent(parent?.applyValue({ args0 -> args0 }))
            .priority(priority?.applyValue({ args0 -> args0 }))
            .sourceIpRanges(
                sourceIpRanges?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .sourcePorts(sourcePorts?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

/**
 * Builder for [ExternalAccessRuleArgs].
 */
@PulumiTagMarker
public class ExternalAccessRuleArgsBuilder internal constructor() {
    private var action: Output? = null

    private var description: Output? = null

    private var destinationIpRanges: Output>? = null

    private var destinationPorts: Output>? = null

    private var ipProtocol: Output? = null

    private var name: Output? = null

    private var parent: Output? = null

    private var priority: Output? = null

    private var sourceIpRanges: Output>? = null

    private var sourcePorts: Output>? = null

    /**
     * @param value The action that the external access rule performs.
     * Possible values are: `ALLOW`, `DENY`.
     */
    @JvmName("ywkavtrhrirdtmxu")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value User-provided description for the external access rule.
     */
    @JvmName("lcumpjijgynwasku")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value If destination ranges are specified, the external access rule applies only to
     * traffic that has a destination IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("daosgifmujwwoour")
    public suspend fun destinationIpRanges(`value`: Output>) {
        this.destinationIpRanges = value
    }

    @JvmName("vesgyixhjiksgqor")
    public suspend fun destinationIpRanges(vararg values: Output) {
        this.destinationIpRanges = Output.all(values.asList())
    }

    /**
     * @param values If destination ranges are specified, the external access rule applies only to
     * traffic that has a destination IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("vnkodgsqwjlobqyx")
    public suspend fun destinationIpRanges(values: List>) {
        this.destinationIpRanges = Output.all(values)
    }

    /**
     * @param value A list of destination ports to which the external access rule applies.
     */
    @JvmName("lanjwqtrgvrleavi")
    public suspend fun destinationPorts(`value`: Output>) {
        this.destinationPorts = value
    }

    @JvmName("gvmwxsgysaskprky")
    public suspend fun destinationPorts(vararg values: Output) {
        this.destinationPorts = Output.all(values.asList())
    }

    /**
     * @param values A list of destination ports to which the external access rule applies.
     */
    @JvmName("ddlkikcdntjeapfn")
    public suspend fun destinationPorts(values: List>) {
        this.destinationPorts = Output.all(values)
    }

    /**
     * @param value The IP protocol to which the external access rule applies.
     */
    @JvmName("mjvrlajkviuianap")
    public suspend fun ipProtocol(`value`: Output) {
        this.ipProtocol = value
    }

    /**
     * @param value The ID of the external access rule.
     */
    @JvmName("gggogrpenakoepjb")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The resource name of the network policy.
     * 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-west1-a/networkPolicies/my-policy
     */
    @JvmName("gfaubtnpxsovtsgn")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value External access rule priority, which determines the external access rule to use when multiple rules apply.
     */
    @JvmName("bnthsfmkfvsidltx")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value If source ranges are specified, the external access rule applies only to
     * traffic that has a source IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("pbjyhhcohexshfjp")
    public suspend fun sourceIpRanges(`value`: Output>) {
        this.sourceIpRanges = value
    }

    @JvmName("rqfgqhojpsrjlhbn")
    public suspend fun sourceIpRanges(vararg values: Output) {
        this.sourceIpRanges = Output.all(values.asList())
    }

    /**
     * @param values If source ranges are specified, the external access rule applies only to
     * traffic that has a source IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("nbrhbbdaklcqegjl")
    public suspend fun sourceIpRanges(values: List>) {
        this.sourceIpRanges = Output.all(values)
    }

    /**
     * @param value A list of source ports to which the external access rule applies.
     */
    @JvmName("qxqdjmvxbojnidgk")
    public suspend fun sourcePorts(`value`: Output>) {
        this.sourcePorts = value
    }

    @JvmName("moamjdhkmnjahvyt")
    public suspend fun sourcePorts(vararg values: Output) {
        this.sourcePorts = Output.all(values.asList())
    }

    /**
     * @param values A list of source ports to which the external access rule applies.
     */
    @JvmName("piqjagjinqlycvci")
    public suspend fun sourcePorts(values: List>) {
        this.sourcePorts = Output.all(values)
    }

    /**
     * @param value The action that the external access rule performs.
     * Possible values are: `ALLOW`, `DENY`.
     */
    @JvmName("tfitkpjawsslomih")
    public suspend fun action(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param value User-provided description for the external access rule.
     */
    @JvmName("fifhibidahnbkcuc")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value If destination ranges are specified, the external access rule applies only to
     * traffic that has a destination IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("vrgchlhiywvjqubc")
    public suspend fun destinationIpRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationIpRanges = mapped
    }

    /**
     * @param argument If destination ranges are specified, the external access rule applies only to
     * traffic that has a destination IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("irolmekmendcchhb")
    public suspend fun destinationIpRanges(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ExternalAccessRuleDestinationIpRangeArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.destinationIpRanges = mapped
    }

    /**
     * @param argument If destination ranges are specified, the external access rule applies only to
     * traffic that has a destination IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("qsccpinupghksepf")
    public suspend fun destinationIpRanges(vararg argument: suspend ExternalAccessRuleDestinationIpRangeArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ExternalAccessRuleDestinationIpRangeArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.destinationIpRanges = mapped
    }

    /**
     * @param argument If destination ranges are specified, the external access rule applies only to
     * traffic that has a destination IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("btnbsnernmqlmbdh")
    public suspend fun destinationIpRanges(argument: suspend ExternalAccessRuleDestinationIpRangeArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ExternalAccessRuleDestinationIpRangeArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.destinationIpRanges = mapped
    }

    /**
     * @param values If destination ranges are specified, the external access rule applies only to
     * traffic that has a destination IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("gtrfkuksdmocvgss")
    public suspend fun destinationIpRanges(vararg values: ExternalAccessRuleDestinationIpRangeArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationIpRanges = mapped
    }

    /**
     * @param value A list of destination ports to which the external access rule applies.
     */
    @JvmName("updtlmevsuwktddh")
    public suspend fun destinationPorts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationPorts = mapped
    }

    /**
     * @param values A list of destination ports to which the external access rule applies.
     */
    @JvmName("puhsygnreuhtbpya")
    public suspend fun destinationPorts(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationPorts = mapped
    }

    /**
     * @param value The IP protocol to which the external access rule applies.
     */
    @JvmName("hvrmmkfqqfqeewqr")
    public suspend fun ipProtocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipProtocol = mapped
    }

    /**
     * @param value The ID of the external access rule.
     */
    @JvmName("dnovneyntsdvrqvv")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The resource name of the network policy.
     * 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-west1-a/networkPolicies/my-policy
     */
    @JvmName("clnkbotyohnanvye")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    /**
     * @param value External access rule priority, which determines the external access rule to use when multiple rules apply.
     */
    @JvmName("bpemtyhrkqpwuvpk")
    public suspend fun priority(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value If source ranges are specified, the external access rule applies only to
     * traffic that has a source IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("finpbaqyatxrcwty")
    public suspend fun sourceIpRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceIpRanges = mapped
    }

    /**
     * @param argument If source ranges are specified, the external access rule applies only to
     * traffic that has a source IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("sqhttlivkbfuwibp")
    public suspend fun sourceIpRanges(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ExternalAccessRuleSourceIpRangeArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceIpRanges = mapped
    }

    /**
     * @param argument If source ranges are specified, the external access rule applies only to
     * traffic that has a source IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("nshjhhopvjibkkmk")
    public suspend fun sourceIpRanges(vararg argument: suspend ExternalAccessRuleSourceIpRangeArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ExternalAccessRuleSourceIpRangeArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceIpRanges = mapped
    }

    /**
     * @param argument If source ranges are specified, the external access rule applies only to
     * traffic that has a source IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("rfvwubkgnyumxxku")
    public suspend fun sourceIpRanges(argument: suspend ExternalAccessRuleSourceIpRangeArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ExternalAccessRuleSourceIpRangeArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.sourceIpRanges = mapped
    }

    /**
     * @param values If source ranges are specified, the external access rule applies only to
     * traffic that has a source IP address in these ranges.
     * Structure is documented below.
     */
    @JvmName("werubcrbyvemlhbs")
    public suspend fun sourceIpRanges(vararg values: ExternalAccessRuleSourceIpRangeArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceIpRanges = mapped
    }

    /**
     * @param value A list of source ports to which the external access rule applies.
     */
    @JvmName("oysqtdammdrfndcn")
    public suspend fun sourcePorts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePorts = mapped
    }

    /**
     * @param values A list of source ports to which the external access rule applies.
     */
    @JvmName("wisqdagombdmlwag")
    public suspend fun sourcePorts(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourcePorts = mapped
    }

    internal fun build(): ExternalAccessRuleArgs = ExternalAccessRuleArgs(
        action = action,
        description = description,
        destinationIpRanges = destinationIpRanges,
        destinationPorts = destinationPorts,
        ipProtocol = ipProtocol,
        name = name,
        parent = parent,
        priority = priority,
        sourceIpRanges = sourceIpRanges,
        sourcePorts = sourcePorts,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy