SubnetNatGatewayAssociation

class SubnetNatGatewayAssociation : KotlinCustomResource

Associates a NAT Gateway with a Subnet within a Virtual Network.

Example Usage

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.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.NatGateway;
import com.pulumi.azure.network.NatGatewayArgs;
import com.pulumi.azure.network.SubnetNatGatewayAssociation;
import com.pulumi.azure.network.SubnetNatGatewayAssociationArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.addressSpaces("10.0.0.0/16")
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.2.0/24")
.build());
var exampleNatGateway = new NatGateway("exampleNatGateway", NatGatewayArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleSubnetNatGatewayAssociation = new SubnetNatGatewayAssociation("exampleSubnetNatGatewayAssociation", SubnetNatGatewayAssociationArgs.builder()
.subnetId(exampleSubnet.id())
.natGatewayId(exampleNatGateway.id())
.build());
}
}

Import

Subnet NAT Gateway Associations can be imported using the resource id of the Subnet, e.g.

$ pulumi import azure:network/subnetNatGatewayAssociation:SubnetNatGatewayAssociation association1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysubnet1

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val natGatewayId: Output<String>

The ID of the NAT Gateway which should be associated with the Subnet. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val subnetId: Output<String>

The ID of the Subnet. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>