@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
82 lines • 5.42 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.NatGateway = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Specifies a network address translation (NAT) gateway in the specified subnet. You can create either a public NAT gateway or a private NAT gateway. The default is a public NAT gateway. If you create a public NAT gateway, you must specify an elastic IP address.
* With a NAT gateway, instances in a private subnet can connect to the internet, other AWS services, or an on-premises network using the IP address of the NAT gateway. For more information, see [NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in the *Amazon VPC User Guide*.
* If you add a default route (``AWS::EC2::Route`` resource) that points to a NAT gateway, specify the NAT gateway ID for the route's ``NatGatewayId`` property.
* When you associate an Elastic IP address or secondary Elastic IP address with a public NAT gateway, the network border group of the Elastic IP address must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. Otherwise, the NAT gateway fails to launch. You can see the network border group for the AZ by viewing the details of the subnet. Similarly, you can view the network border group for the Elastic IP address by viewing its details. For more information, see [Allocate an Elastic IP address](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#allocate-eip) in the *Amazon VPC User Guide*.
*/
class NatGateway extends pulumi.CustomResource {
/**
* Get an existing NatGateway 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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new NatGateway(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of NatGateway. 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'] === NatGateway.__pulumiType;
}
/**
* Create a NatGateway resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if ((!args || args.subnetId === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetId'");
}
resourceInputs["allocationId"] = args ? args.allocationId : undefined;
resourceInputs["connectivityType"] = args ? args.connectivityType : undefined;
resourceInputs["maxDrainDurationSeconds"] = args ? args.maxDrainDurationSeconds : undefined;
resourceInputs["privateIpAddress"] = args ? args.privateIpAddress : undefined;
resourceInputs["secondaryAllocationIds"] = args ? args.secondaryAllocationIds : undefined;
resourceInputs["secondaryPrivateIpAddressCount"] = args ? args.secondaryPrivateIpAddressCount : undefined;
resourceInputs["secondaryPrivateIpAddresses"] = args ? args.secondaryPrivateIpAddresses : undefined;
resourceInputs["subnetId"] = args ? args.subnetId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["natGatewayId"] = undefined /*out*/;
}
else {
resourceInputs["allocationId"] = undefined /*out*/;
resourceInputs["connectivityType"] = undefined /*out*/;
resourceInputs["maxDrainDurationSeconds"] = undefined /*out*/;
resourceInputs["natGatewayId"] = undefined /*out*/;
resourceInputs["privateIpAddress"] = undefined /*out*/;
resourceInputs["secondaryAllocationIds"] = undefined /*out*/;
resourceInputs["secondaryPrivateIpAddressCount"] = undefined /*out*/;
resourceInputs["secondaryPrivateIpAddresses"] = undefined /*out*/;
resourceInputs["subnetId"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["allocationId", "connectivityType", "privateIpAddress", "subnetId"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(NatGateway.__pulumiType, name, resourceInputs, opts);
}
}
exports.NatGateway = NatGateway;
/** @internal */
NatGateway.__pulumiType = 'aws-native:ec2:NatGateway';
//# sourceMappingURL=natGateway.js.map