Vpn Gateway Attachment Args
data class VpnGatewayAttachmentArgs(val vpcId: Output<String>? = null, val vpnGatewayId: Output<String>? = null) : ConvertibleToJava<VpnGatewayAttachmentArgs>
Provides a Virtual Private Gateway attachment resource, allowing for an existing hardware VPN gateway to be attached and/or detached from a VPC.
Note: The
aws.ec2.VpnGateway
resource can also automatically attach the Virtual Private Gateway it creates to an existing VPC by setting thevpc_id
attribute accordingly.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.ec2.VpnGateway;
import com.pulumi.aws.ec2.VpnGatewayArgs;
import com.pulumi.aws.ec2.VpnGatewayAttachment;
import com.pulumi.aws.ec2.VpnGatewayAttachmentArgs;
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 = new Vpc("network", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var vpn = new VpnGateway("vpn", VpnGatewayArgs.builder()
.tags(Map.of("Name", "example-vpn-gateway"))
.build());
var vpnAttachment = new VpnGatewayAttachment("vpnAttachment", VpnGatewayAttachmentArgs.builder()
.vpcId(network.id())
.vpnGatewayId(vpn.id())
.build());
}
}
Content copied to clipboard
Import
This resource does not support importing.