com.pulumi.azure.network.VnpGatewayNatRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.network;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.network.VnpGatewayNatRuleArgs;
import com.pulumi.azure.network.inputs.VnpGatewayNatRuleState;
import com.pulumi.azure.network.outputs.VnpGatewayNatRuleExternalMapping;
import com.pulumi.azure.network.outputs.VnpGatewayNatRuleInternalMapping;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a VPN Gateway NAT Rule.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.network.VirtualWan;
* import com.pulumi.azure.network.VirtualWanArgs;
* import com.pulumi.azure.network.VirtualHub;
* import com.pulumi.azure.network.VirtualHubArgs;
* import com.pulumi.azure.network.VpnGateway;
* import com.pulumi.azure.network.VpnGatewayArgs;
* import com.pulumi.azure.network.VnpGatewayNatRule;
* import com.pulumi.azure.network.VnpGatewayNatRuleArgs;
* import com.pulumi.azure.network.inputs.VnpGatewayNatRuleExternalMappingArgs;
* import com.pulumi.azure.network.inputs.VnpGatewayNatRuleInternalMappingArgs;
* 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
*
* var exampleVirtualWan = new VirtualWan("exampleVirtualWan", VirtualWanArgs.builder()
* .name("example-vwan")
* .resourceGroupName(example.name())
* .location(example.location())
* .build());
*
* var exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()
* .name("example-vhub")
* .resourceGroupName(example.name())
* .location(example.location())
* .addressPrefix("10.0.1.0/24")
* .virtualWanId(exampleVirtualWan.id())
* .build());
*
* var exampleVpnGateway = new VpnGateway("exampleVpnGateway", VpnGatewayArgs.builder()
* .name("example-vpngateway")
* .location(example.location())
* .resourceGroupName(example.name())
* .virtualHubId(exampleVirtualHub.id())
* .build());
*
* var exampleVnpGatewayNatRule = new VnpGatewayNatRule("exampleVnpGatewayNatRule", VnpGatewayNatRuleArgs.builder()
* .name("example-vpngatewaynatrule")
* .vpnGatewayId(exampleVpnGateway.id())
* .externalMappings(VnpGatewayNatRuleExternalMappingArgs.builder()
* .addressSpace("192.168.21.0/26")
* .build())
* .internalMappings(VnpGatewayNatRuleInternalMappingArgs.builder()
* .addressSpace("10.4.0.0/26")
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* VPN Gateway NAT Rules can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:network/vnpGatewayNatRule:VnpGatewayNatRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Network/vpnGateways/vpnGateway1/natRules/natRule1
* ```
*
*/
@ResourceType(type="azure:network/vnpGatewayNatRule:VnpGatewayNatRule")
public class VnpGatewayNatRule extends com.pulumi.resources.CustomResource {
/**
* One of more `external_mapping` blocks as defined below.
*
*/
@Export(name="externalMappings", refs={List.class,VnpGatewayNatRuleExternalMapping.class}, tree="[0,1]")
private Output* @Nullable */ List> externalMappings;
/**
* @return One of more `external_mapping` blocks as defined below.
*
*/
public Output>> externalMappings() {
return Codegen.optional(this.externalMappings);
}
/**
* One of more `internal_mapping` blocks as defined below.
*
*/
@Export(name="internalMappings", refs={List.class,VnpGatewayNatRuleInternalMapping.class}, tree="[0,1]")
private Output* @Nullable */ List> internalMappings;
/**
* @return One of more `internal_mapping` blocks as defined below.
*
*/
public Output>> internalMappings() {
return Codegen.optional(this.internalMappings);
}
/**
* The ID of the IP Configuration this VPN Gateway NAT Rule applies to. Possible values are `Instance0` and `Instance1`.
*
*/
@Export(name="ipConfigurationId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> ipConfigurationId;
/**
* @return The ID of the IP Configuration this VPN Gateway NAT Rule applies to. Possible values are `Instance0` and `Instance1`.
*
*/
public Output> ipConfigurationId() {
return Codegen.optional(this.ipConfigurationId);
}
/**
* The source NAT direction of the VPN NAT. Possible values are `EgressSnat` and `IngressSnat`. Defaults to `EgressSnat`. Changing this forces a new resource to be created.
*
*/
@Export(name="mode", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> mode;
/**
* @return The source NAT direction of the VPN NAT. Possible values are `EgressSnat` and `IngressSnat`. Defaults to `EgressSnat`. Changing this forces a new resource to be created.
*
*/
public Output> mode() {
return Codegen.optional(this.mode);
}
/**
* The name which should be used for this VPN Gateway NAT Rule. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name which should be used for this VPN Gateway NAT Rule. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The type of the VPN Gateway NAT Rule. Possible values are `Dynamic` and `Static`. Defaults to `Static`. Changing this forces a new resource to be created.
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> type;
/**
* @return The type of the VPN Gateway NAT Rule. Possible values are `Dynamic` and `Static`. Defaults to `Static`. Changing this forces a new resource to be created.
*
*/
public Output> type() {
return Codegen.optional(this.type);
}
/**
* The ID of the VPN Gateway that this VPN Gateway NAT Rule belongs to. Changing this forces a new resource to be created.
*
*/
@Export(name="vpnGatewayId", refs={String.class}, tree="[0]")
private Output vpnGatewayId;
/**
* @return The ID of the VPN Gateway that this VPN Gateway NAT Rule belongs to. Changing this forces a new resource to be created.
*
*/
public Output vpnGatewayId() {
return this.vpnGatewayId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public VnpGatewayNatRule(java.lang.String name) {
this(name, VnpGatewayNatRuleArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public VnpGatewayNatRule(java.lang.String name, VnpGatewayNatRuleArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public VnpGatewayNatRule(java.lang.String name, VnpGatewayNatRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:network/vnpGatewayNatRule:VnpGatewayNatRule", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private VnpGatewayNatRule(java.lang.String name, Output id, @Nullable VnpGatewayNatRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:network/vnpGatewayNatRule:VnpGatewayNatRule", name, state, makeResourceOptions(options, id), false);
}
private static VnpGatewayNatRuleArgs makeArgs(VnpGatewayNatRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? VnpGatewayNatRuleArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static VnpGatewayNatRule get(java.lang.String name, Output id, @Nullable VnpGatewayNatRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new VnpGatewayNatRule(name, id, state, options);
}
}