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

com.pulumi.alicloud.vpn.IpsecServer Maven / Gradle / Ivy

There is a newer version: 3.63.0-alpha.1727424957
Show newest version
// *** 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.alicloud.vpn;

import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.vpn.IpsecServerArgs;
import com.pulumi.alicloud.vpn.inputs.IpsecServerState;
import com.pulumi.alicloud.vpn.outputs.IpsecServerIkeConfig;
import com.pulumi.alicloud.vpn.outputs.IpsecServerIpsecConfig;
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.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Provides a VPN Ipsec Server resource.
 * 
 * For information about VPN Ipsec Server and how to use it, see [What is Ipsec Server](https://www.alibabacloud.com/help/en/doc-detail/205454.html).
 * 
 * > **NOTE:** Available since v1.161.0+.
 * 
 * ## Example Usage
 * 
 * Basic Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.alicloud.AlicloudFunctions;
 * import com.pulumi.alicloud.inputs.GetZonesArgs;
 * import com.pulumi.alicloud.vpc.VpcFunctions;
 * import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
 * import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
 * import com.pulumi.alicloud.vpn.Gateway;
 * import com.pulumi.alicloud.vpn.GatewayArgs;
 * import com.pulumi.alicloud.vpn.IpsecServer;
 * import com.pulumi.alicloud.vpn.IpsecServerArgs;
 * 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) {
 *         final var config = ctx.config();
 *         final var name = config.get("name").orElse("terraform-example");
 *         final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
 *             .availableResourceCreation("VSwitch")
 *             .build());
 * 
 *         final var defaultGetNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
 *             .nameRegex("^default-NODELETING$")
 *             .cidrBlock("172.16.0.0/16")
 *             .build());
 * 
 *         final var default0 = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
 *             .vpcId(defaultGetNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
 *             .zoneId(default_.ids()[0])
 *             .build());
 * 
 *         final var default1 = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
 *             .vpcId(defaultGetNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
 *             .zoneId(default_.ids()[1])
 *             .build());
 * 
 *         var defaultGateway = new Gateway("defaultGateway", GatewayArgs.builder()
 *             .vpnGatewayName(name)
 *             .vpcId(defaultGetNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
 *             .bandwidth("10")
 *             .enableSsl(true)
 *             .description(name)
 *             .paymentType("Subscription")
 *             .vswitchId(default0.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
 *             .disasterRecoveryVswitchId(default1.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
 *             .build());
 * 
 *         var foo = new IpsecServer("foo", IpsecServerArgs.builder()
 *             .clientIpPool("10.0.0.0/24")
 *             .ipsecServerName(name)
 *             .localSubnet("192.168.0.0/24")
 *             .vpnGatewayId(defaultGateway.id())
 *             .pskEnabled(true)
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * VPN Ipsec Server can be imported using the id, e.g. * * ```sh * $ pulumi import alicloud:vpn/ipsecServer:IpsecServer example <id> * ``` * */ @ResourceType(type="alicloud:vpn/ipsecServer:IpsecServer") public class IpsecServer extends com.pulumi.resources.CustomResource { /** * The client CIDR block. It refers to the CIDR block that is allocated to the virtual interface of the client. * */ @Export(name="clientIpPool", refs={String.class}, tree="[0]") private Output clientIpPool; /** * @return The client CIDR block. It refers to the CIDR block that is allocated to the virtual interface of the client. * */ public Output clientIpPool() { return this.clientIpPool; } /** * The dry run. * */ @Export(name="dryRun", refs={Boolean.class}, tree="[0]") private Output dryRun; /** * @return The dry run. * */ public Output> dryRun() { return Codegen.optional(this.dryRun); } /** * Specifies whether you want the configuration to immediately take effect. * */ @Export(name="effectImmediately", refs={Boolean.class}, tree="[0]") private Output effectImmediately; /** * @return Specifies whether you want the configuration to immediately take effect. * */ public Output> effectImmediately() { return Codegen.optional(this.effectImmediately); } /** * The configuration of Phase 1 negotiations. See `ike_config` below. * */ @Export(name="ikeConfigs", refs={List.class,IpsecServerIkeConfig.class}, tree="[0,1]") private Output> ikeConfigs; /** * @return The configuration of Phase 1 negotiations. See `ike_config` below. * */ public Output> ikeConfigs() { return this.ikeConfigs; } /** * The configuration of Phase 2 negotiations. See `ipsec_config` below. * */ @Export(name="ipsecConfigs", refs={List.class,IpsecServerIpsecConfig.class}, tree="[0,1]") private Output> ipsecConfigs; /** * @return The configuration of Phase 2 negotiations. See `ipsec_config` below. * */ public Output> ipsecConfigs() { return this.ipsecConfigs; } /** * The name of the IPsec server. The name must be `2` to `128` characters in length, and can contain digits, hyphens (-), and underscores (_). It must start with a letter. * */ @Export(name="ipsecServerName", refs={String.class}, tree="[0]") private Output ipsecServerName; /** * @return The name of the IPsec server. The name must be `2` to `128` characters in length, and can contain digits, hyphens (-), and underscores (_). It must start with a letter. * */ public Output> ipsecServerName() { return Codegen.optional(this.ipsecServerName); } /** * The local CIDR block. It refers to the CIDR block of the virtual private cloud (VPC) that is used to connect with the client. Separate multiple CIDR blocks with commas (,). Example: `192.168.1.0/24,192.168.2.0/24`. * */ @Export(name="localSubnet", refs={String.class}, tree="[0]") private Output localSubnet; /** * @return The local CIDR block. It refers to the CIDR block of the virtual private cloud (VPC) that is used to connect with the client. Separate multiple CIDR blocks with commas (,). Example: `192.168.1.0/24,192.168.2.0/24`. * */ public Output localSubnet() { return this.localSubnet; } /** * The pre-shared key. The pre-shared key is used to authenticate the VPN gateway and the client. By default, the system generates a random string that is 16 bits in length. You can also specify the pre-shared key. It can contain at most 100 characters. * */ @Export(name="psk", refs={String.class}, tree="[0]") private Output psk; /** * @return The pre-shared key. The pre-shared key is used to authenticate the VPN gateway and the client. By default, the system generates a random string that is 16 bits in length. You can also specify the pre-shared key. It can contain at most 100 characters. * */ public Output psk() { return this.psk; } /** * Whether to enable the pre-shared key authentication method. The value is only `true`, which indicates that the pre-shared key authentication method is enabled. * */ @Export(name="pskEnabled", refs={Boolean.class}, tree="[0]") private Output pskEnabled; /** * @return Whether to enable the pre-shared key authentication method. The value is only `true`, which indicates that the pre-shared key authentication method is enabled. * */ public Output> pskEnabled() { return Codegen.optional(this.pskEnabled); } /** * The ID of the VPN gateway. * */ @Export(name="vpnGatewayId", refs={String.class}, tree="[0]") private Output vpnGatewayId; /** * @return The ID of the VPN gateway. * */ public Output vpnGatewayId() { return this.vpnGatewayId; } /** * * @param name The _unique_ name of the resulting resource. */ public IpsecServer(java.lang.String name) { this(name, IpsecServerArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public IpsecServer(java.lang.String name, IpsecServerArgs 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 IpsecServer(java.lang.String name, IpsecServerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:vpn/ipsecServer:IpsecServer", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private IpsecServer(java.lang.String name, Output id, @Nullable IpsecServerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:vpn/ipsecServer:IpsecServer", name, state, makeResourceOptions(options, id), false); } private static IpsecServerArgs makeArgs(IpsecServerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? IpsecServerArgs.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 IpsecServer get(java.lang.String name, Output id, @Nullable IpsecServerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new IpsecServer(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy