@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
103 lines • 4.35 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstancePublicPorts = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages public ports for a Lightsail instance. Use this resource to open ports for a specific Amazon Lightsail instance and specify the IP addresses allowed to connect to the instance through the ports and the protocol.
*
* > See [What is Amazon Lightsail?](https://lightsail.aws.amazon.com/ls/docs/getting-started/article/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"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail) for more details.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const available = aws.getAvailabilityZones({
* state: "available",
* filters: [{
* name: "opt-in-status",
* values: ["opt-in-not-required"],
* }],
* });
* const example = new aws.lightsail.Instance("example", {
* name: "example-instance",
* availabilityZone: available.then(available => available.names?.[0]),
* blueprintId: "amazon_linux_2",
* bundleId: "nano_3_0",
* });
* const exampleInstancePublicPorts = new aws.lightsail.InstancePublicPorts("example", {
* instanceName: example.name,
* portInfos: [
* {
* protocol: "tcp",
* fromPort: 80,
* toPort: 80,
* },
* {
* protocol: "tcp",
* fromPort: 443,
* toPort: 443,
* cidrs: ["192.168.1.0/24"],
* },
* ],
* });
* ```
*/
class InstancePublicPorts extends pulumi.CustomResource {
/**
* Get an existing InstancePublicPorts 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 Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new InstancePublicPorts(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of InstancePublicPorts. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === InstancePublicPorts.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["instanceName"] = state?.instanceName;
resourceInputs["portInfos"] = state?.portInfos;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.instanceName === undefined && !opts.urn) {
throw new Error("Missing required property 'instanceName'");
}
if (args?.portInfos === undefined && !opts.urn) {
throw new Error("Missing required property 'portInfos'");
}
resourceInputs["instanceName"] = args?.instanceName;
resourceInputs["portInfos"] = args?.portInfos;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstancePublicPorts.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstancePublicPorts = InstancePublicPorts;
/** @internal */
InstancePublicPorts.__pulumiType = 'aws:lightsail/instancePublicPorts:InstancePublicPorts';
//# sourceMappingURL=instancePublicPorts.js.map