@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
127 lines • 6.65 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.DefaultVpc = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage the [default AWS VPC](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html)
* in the current AWS Region.
*
* If you created your AWS account after 2013-12-04 you have a default VPC in each AWS Region.
*
* **This is an advanced resource** and has special caveats to be aware of when using it. Please read this document in its entirety before using this resource.
*
* The `aws.ec2.DefaultVpc` resource behaves differently from normal resources in that if a default VPC exists, this provider does not _create_ this resource, but instead "adopts" it into management.
* If no default VPC exists, the provider creates a new default VPC, which leads to the implicit creation of [other resources](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html#default-vpc-components).
* By default, `pulumi destroy` does not delete the default VPC but does remove the resource from the state.
* Set the `forceDestroy` argument to `true` to delete the default VPC.
*
* ## Example Usage
*
* Basic usage with tags:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const _default = new aws.ec2.DefaultVpc("default", {tags: {
* Name: "Default VPC",
* }});
* ```
*
* ## Import
*
* Using `pulumi import`, import Default VPCs using the VPC `id`. For example:
*
* ```sh
* $ pulumi import aws:ec2/defaultVpc:DefaultVpc default vpc-a01106c2
* ```
*/
class DefaultVpc extends pulumi.CustomResource {
/**
* Get an existing DefaultVpc 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 DefaultVpc(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DefaultVpc. 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'] === DefaultVpc.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["assignGeneratedIpv6CidrBlock"] = state?.assignGeneratedIpv6CidrBlock;
resourceInputs["cidrBlock"] = state?.cidrBlock;
resourceInputs["defaultNetworkAclId"] = state?.defaultNetworkAclId;
resourceInputs["defaultRouteTableId"] = state?.defaultRouteTableId;
resourceInputs["defaultSecurityGroupId"] = state?.defaultSecurityGroupId;
resourceInputs["dhcpOptionsId"] = state?.dhcpOptionsId;
resourceInputs["enableDnsHostnames"] = state?.enableDnsHostnames;
resourceInputs["enableDnsSupport"] = state?.enableDnsSupport;
resourceInputs["enableNetworkAddressUsageMetrics"] = state?.enableNetworkAddressUsageMetrics;
resourceInputs["existingDefaultVpc"] = state?.existingDefaultVpc;
resourceInputs["forceDestroy"] = state?.forceDestroy;
resourceInputs["instanceTenancy"] = state?.instanceTenancy;
resourceInputs["ipv6AssociationId"] = state?.ipv6AssociationId;
resourceInputs["ipv6CidrBlock"] = state?.ipv6CidrBlock;
resourceInputs["ipv6CidrBlockNetworkBorderGroup"] = state?.ipv6CidrBlockNetworkBorderGroup;
resourceInputs["ipv6IpamPoolId"] = state?.ipv6IpamPoolId;
resourceInputs["ipv6NetmaskLength"] = state?.ipv6NetmaskLength;
resourceInputs["mainRouteTableId"] = state?.mainRouteTableId;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
resourceInputs["assignGeneratedIpv6CidrBlock"] = args?.assignGeneratedIpv6CidrBlock;
resourceInputs["enableDnsHostnames"] = args?.enableDnsHostnames;
resourceInputs["enableDnsSupport"] = args?.enableDnsSupport;
resourceInputs["enableNetworkAddressUsageMetrics"] = args?.enableNetworkAddressUsageMetrics;
resourceInputs["forceDestroy"] = args?.forceDestroy;
resourceInputs["ipv6CidrBlock"] = args?.ipv6CidrBlock;
resourceInputs["ipv6CidrBlockNetworkBorderGroup"] = args?.ipv6CidrBlockNetworkBorderGroup;
resourceInputs["ipv6IpamPoolId"] = args?.ipv6IpamPoolId;
resourceInputs["ipv6NetmaskLength"] = args?.ipv6NetmaskLength;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["cidrBlock"] = undefined /*out*/;
resourceInputs["defaultNetworkAclId"] = undefined /*out*/;
resourceInputs["defaultRouteTableId"] = undefined /*out*/;
resourceInputs["defaultSecurityGroupId"] = undefined /*out*/;
resourceInputs["dhcpOptionsId"] = undefined /*out*/;
resourceInputs["existingDefaultVpc"] = undefined /*out*/;
resourceInputs["instanceTenancy"] = undefined /*out*/;
resourceInputs["ipv6AssociationId"] = undefined /*out*/;
resourceInputs["mainRouteTableId"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DefaultVpc.__pulumiType, name, resourceInputs, opts);
}
}
exports.DefaultVpc = DefaultVpc;
/** @internal */
DefaultVpc.__pulumiType = 'aws:ec2/defaultVpc:DefaultVpc';
//# sourceMappingURL=defaultVpc.js.map