InstancePublicPortsArgs

data class InstancePublicPortsArgs(val instanceName: Output<String>? = null, val portInfos: Output<List<InstancePublicPortsPortInfoArgs>>? = null) : ConvertibleToJava<InstancePublicPortsArgs>

Opens ports for a specific Amazon Lightsail instance, and specifies the IP addresses allowed to connect to the instance through the ports, and the protocol.

See What is Amazon Lightsail? for more information. Note: Lightsail is currently only supported in a limited number of AWS Regions, please see "Regions and Availability Zones in Amazon Lightsail" for more details.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.Instance;
import com.pulumi.aws.lightsail.InstanceArgs;
import com.pulumi.aws.lightsail.InstancePublicPorts;
import com.pulumi.aws.lightsail.InstancePublicPortsArgs;
import com.pulumi.aws.lightsail.inputs.InstancePublicPortsPortInfoArgs;
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 testInstance = new Instance("testInstance", InstanceArgs.builder()
.availabilityZone(data.aws_availability_zones().available().names()[0])
.blueprintId("amazon_linux_2")
.bundleId("nano_1_0")
.build());
var testInstancePublicPorts = new InstancePublicPorts("testInstancePublicPorts", InstancePublicPortsArgs.builder()
.instanceName(testInstance.name())
.portInfos(InstancePublicPortsPortInfoArgs.builder()
.protocol("tcp")
.fromPort(80)
.toPort(80)
.build())
.build());
}
}

Constructors

Link copied to clipboard
constructor(instanceName: Output<String>? = null, portInfos: Output<List<InstancePublicPortsPortInfoArgs>>? = null)

Properties

Link copied to clipboard
val instanceName: Output<String>? = null

Name of the Lightsail Instance.

Link copied to clipboard

Configuration block with port information. AWS closes all currently open ports that are not included in the port_info. Detailed below.

Functions

Link copied to clipboard
open override fun toJava(): InstancePublicPortsArgs