@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)
103 lines • 5.82 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.Subnet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Specifies a subnet for the specified VPC.
* For an IPv4 only subnet, specify an IPv4 CIDR block. If the VPC has an IPv6 CIDR block, you can create an IPv6 only subnet or a dual stack subnet instead. For an IPv6 only subnet, specify an IPv6 CIDR block. For a dual stack subnet, specify both an IPv4 CIDR block and an IPv6 CIDR block.
* For more information, see [Subnets for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html) in the *Amazon VPC User Guide*.
*/
class Subnet extends pulumi.CustomResource {
/**
* Get an existing Subnet 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 Subnet(name, undefined, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Subnet. 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'] === Subnet.__pulumiType;
}
/**
* Create a Subnet 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?.vpcId === undefined && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["assignIpv6AddressOnCreation"] = args?.assignIpv6AddressOnCreation;
resourceInputs["availabilityZone"] = args?.availabilityZone;
resourceInputs["availabilityZoneId"] = args?.availabilityZoneId;
resourceInputs["cidrBlock"] = args?.cidrBlock;
resourceInputs["enableDns64"] = args?.enableDns64;
resourceInputs["enableLniAtDeviceIndex"] = args?.enableLniAtDeviceIndex;
resourceInputs["ipv4IpamPoolId"] = args?.ipv4IpamPoolId;
resourceInputs["ipv4NetmaskLength"] = args?.ipv4NetmaskLength;
resourceInputs["ipv6CidrBlock"] = args?.ipv6CidrBlock;
resourceInputs["ipv6IpamPoolId"] = args?.ipv6IpamPoolId;
resourceInputs["ipv6Native"] = args?.ipv6Native;
resourceInputs["ipv6NetmaskLength"] = args?.ipv6NetmaskLength;
resourceInputs["mapPublicIpOnLaunch"] = args?.mapPublicIpOnLaunch;
resourceInputs["outpostArn"] = args?.outpostArn;
resourceInputs["privateDnsNameOptionsOnLaunch"] = args?.privateDnsNameOptionsOnLaunch;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcId"] = args?.vpcId;
resourceInputs["blockPublicAccessStates"] = undefined /*out*/;
resourceInputs["ipv6CidrBlocks"] = undefined /*out*/;
resourceInputs["networkAclAssociationId"] = undefined /*out*/;
resourceInputs["subnetId"] = undefined /*out*/;
}
else {
resourceInputs["assignIpv6AddressOnCreation"] = undefined /*out*/;
resourceInputs["availabilityZone"] = undefined /*out*/;
resourceInputs["availabilityZoneId"] = undefined /*out*/;
resourceInputs["blockPublicAccessStates"] = undefined /*out*/;
resourceInputs["cidrBlock"] = undefined /*out*/;
resourceInputs["enableDns64"] = undefined /*out*/;
resourceInputs["enableLniAtDeviceIndex"] = undefined /*out*/;
resourceInputs["ipv4IpamPoolId"] = undefined /*out*/;
resourceInputs["ipv4NetmaskLength"] = undefined /*out*/;
resourceInputs["ipv6CidrBlock"] = undefined /*out*/;
resourceInputs["ipv6CidrBlocks"] = undefined /*out*/;
resourceInputs["ipv6IpamPoolId"] = undefined /*out*/;
resourceInputs["ipv6Native"] = undefined /*out*/;
resourceInputs["ipv6NetmaskLength"] = undefined /*out*/;
resourceInputs["mapPublicIpOnLaunch"] = undefined /*out*/;
resourceInputs["networkAclAssociationId"] = undefined /*out*/;
resourceInputs["outpostArn"] = undefined /*out*/;
resourceInputs["privateDnsNameOptionsOnLaunch"] = undefined /*out*/;
resourceInputs["subnetId"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["availabilityZone", "availabilityZoneId", "cidrBlock", "ipv4IpamPoolId", "ipv4NetmaskLength", "ipv6IpamPoolId", "ipv6Native", "ipv6NetmaskLength", "outpostArn", "vpcId"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(Subnet.__pulumiType, name, resourceInputs, opts);
}
}
exports.Subnet = Subnet;
/** @internal */
Subnet.__pulumiType = 'aws-native:ec2:Subnet';
//# sourceMappingURL=subnet.js.map