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

com.pulumi.alicloud.vpc.ForwardEntry 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.vpc;

import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.vpc.ForwardEntryArgs;
import com.pulumi.alicloud.vpc.inputs.ForwardEntryState;
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.Optional;
import javax.annotation.Nullable;

/**
 * Provides a forward resource.
 * 
 * ## 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.Network;
 * import com.pulumi.alicloud.vpc.NetworkArgs;
 * import com.pulumi.alicloud.vpc.Switch;
 * import com.pulumi.alicloud.vpc.SwitchArgs;
 * import com.pulumi.alicloud.vpc.NatGateway;
 * import com.pulumi.alicloud.vpc.NatGatewayArgs;
 * import com.pulumi.alicloud.ecs.EipAddress;
 * import com.pulumi.alicloud.ecs.EipAddressArgs;
 * import com.pulumi.alicloud.ecs.EipAssociation;
 * import com.pulumi.alicloud.ecs.EipAssociationArgs;
 * import com.pulumi.alicloud.vpc.ForwardEntry;
 * import com.pulumi.alicloud.vpc.ForwardEntryArgs;
 * 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("forward-entry-example-name");
 *         final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
 *             .availableResourceCreation("VSwitch")
 *             .build());
 * 
 *         var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
 *             .vpcName(name)
 *             .cidrBlock("172.16.0.0/12")
 *             .build());
 * 
 *         var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
 *             .vpcId(defaultNetwork.id())
 *             .cidrBlock("172.16.0.0/21")
 *             .zoneId(default_.zones()[0].id())
 *             .vswitchName(name)
 *             .build());
 * 
 *         var defaultNatGateway = new NatGateway("defaultNatGateway", NatGatewayArgs.builder()
 *             .vpcId(defaultNetwork.id())
 *             .internetChargeType("PayByLcu")
 *             .natGatewayName(name)
 *             .natType("Enhanced")
 *             .vswitchId(defaultSwitch.id())
 *             .build());
 * 
 *         var defaultEipAddress = new EipAddress("defaultEipAddress", EipAddressArgs.builder()
 *             .addressName(name)
 *             .build());
 * 
 *         var defaultEipAssociation = new EipAssociation("defaultEipAssociation", EipAssociationArgs.builder()
 *             .allocationId(defaultEipAddress.id())
 *             .instanceId(defaultNatGateway.id())
 *             .build());
 * 
 *         var defaultForwardEntry = new ForwardEntry("defaultForwardEntry", ForwardEntryArgs.builder()
 *             .forwardTableId(defaultNatGateway.forwardTableIds())
 *             .externalIp(defaultEipAddress.ipAddress())
 *             .externalPort("80")
 *             .ipProtocol("tcp")
 *             .internalIp("172.16.0.3")
 *             .internalPort("8080")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Forward Entry can be imported using the id, e.g. * * ```sh * $ pulumi import alicloud:vpc/forwardEntry:ForwardEntry foo ftb-1aece3:fwd-232ce2 * ``` * */ @ResourceType(type="alicloud:vpc/forwardEntry:ForwardEntry") public class ForwardEntry extends com.pulumi.resources.CustomResource { /** * The external ip address, the ip must along bandwidth package public ip which `alicloud.vpc.NatGateway` argument `bandwidth_packages`. * */ @Export(name="externalIp", refs={String.class}, tree="[0]") private Output externalIp; /** * @return The external ip address, the ip must along bandwidth package public ip which `alicloud.vpc.NatGateway` argument `bandwidth_packages`. * */ public Output externalIp() { return this.externalIp; } /** * The external port, valid value is 1~65535|any. * */ @Export(name="externalPort", refs={String.class}, tree="[0]") private Output externalPort; /** * @return The external port, valid value is 1~65535|any. * */ public Output externalPort() { return this.externalPort; } /** * The id of the forward entry on the server. * */ @Export(name="forwardEntryId", refs={String.class}, tree="[0]") private Output forwardEntryId; /** * @return The id of the forward entry on the server. * */ public Output forwardEntryId() { return this.forwardEntryId; } /** * The name of forward entry. * */ @Export(name="forwardEntryName", refs={String.class}, tree="[0]") private Output forwardEntryName; /** * @return The name of forward entry. * */ public Output forwardEntryName() { return this.forwardEntryName; } /** * The value can get from `alicloud.vpc.NatGateway` Attributes "forward_table_ids". * */ @Export(name="forwardTableId", refs={String.class}, tree="[0]") private Output forwardTableId; /** * @return The value can get from `alicloud.vpc.NatGateway` Attributes "forward_table_ids". * */ public Output forwardTableId() { return this.forwardTableId; } /** * The internal ip, must a private ip. * */ @Export(name="internalIp", refs={String.class}, tree="[0]") private Output internalIp; /** * @return The internal ip, must a private ip. * */ public Output internalIp() { return this.internalIp; } /** * The internal port, valid value is 1~65535|any. * */ @Export(name="internalPort", refs={String.class}, tree="[0]") private Output internalPort; /** * @return The internal port, valid value is 1~65535|any. * */ public Output internalPort() { return this.internalPort; } /** * The ip protocol, valid value is tcp|udp|any. * */ @Export(name="ipProtocol", refs={String.class}, tree="[0]") private Output ipProtocol; /** * @return The ip protocol, valid value is tcp|udp|any. * */ public Output ipProtocol() { return this.ipProtocol; } /** * Field `name` has been deprecated from provider version 1.119.1. New field `forward_entry_name` instead. * * @deprecated * Field 'name' has been deprecated from provider version 1.119.1. New field 'forward_entry_name' instead. * */ @Deprecated /* Field 'name' has been deprecated from provider version 1.119.1. New field 'forward_entry_name' instead. */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Field `name` has been deprecated from provider version 1.119.1. New field `forward_entry_name` instead. * */ public Output name() { return this.name; } /** * Specifies whether to remove limits on the port range. Default value is `false`. * * > **NOTE:** A SNAT entry and a DNAT entry may use the same public IP address. If you want to specify a port number greater than 1024 in this case, set `port_break` to true. * */ @Export(name="portBreak", refs={Boolean.class}, tree="[0]") private Output portBreak; /** * @return Specifies whether to remove limits on the port range. Default value is `false`. * * > **NOTE:** A SNAT entry and a DNAT entry may use the same public IP address. If you want to specify a port number greater than 1024 in this case, set `port_break` to true. * */ public Output> portBreak() { return Codegen.optional(this.portBreak); } /** * (Available in 1.119.1+) The status of forward entry. * */ @Export(name="status", refs={String.class}, tree="[0]") private Output status; /** * @return (Available in 1.119.1+) The status of forward entry. * */ public Output status() { return this.status; } /** * * @param name The _unique_ name of the resulting resource. */ public ForwardEntry(java.lang.String name) { this(name, ForwardEntryArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ForwardEntry(java.lang.String name, ForwardEntryArgs 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 ForwardEntry(java.lang.String name, ForwardEntryArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:vpc/forwardEntry:ForwardEntry", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ForwardEntry(java.lang.String name, Output id, @Nullable ForwardEntryState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:vpc/forwardEntry:ForwardEntry", name, state, makeResourceOptions(options, id), false); } private static ForwardEntryArgs makeArgs(ForwardEntryArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ForwardEntryArgs.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 ForwardEntry get(java.lang.String name, Output id, @Nullable ForwardEntryState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ForwardEntry(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy