@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
124 lines • 5.13 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.ManagedPrefixList = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a managed prefix list resource.
*
* > **NOTE on Managed Prefix Lists and Managed Prefix List Entries:** The provider
* currently provides both a standalone Managed Prefix List Entry resource (a single entry),
* and a Managed Prefix List resource with entries defined in-line. At this time you
* cannot use a Managed Prefix List with in-line rules in conjunction with any Managed
* Prefix List Entry resources. Doing so will cause a conflict of entries and will overwrite entries.
*
* > **NOTE on `maxEntries`:** When you reference a Prefix List in a resource,
* the maximum number of entries for the prefix lists counts as the same number of rules
* or entries for the resource. For example, if you create a prefix list with a maximum
* of 20 entries and you reference that prefix list in a security group rule, this counts
* as 20 rules for the security group.
*
* ## Example Usage
*
* Basic usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ec2.ManagedPrefixList("example", {
* name: "All VPC CIDR-s",
* addressFamily: "IPv4",
* maxEntries: 5,
* entries: [
* {
* cidr: exampleAwsVpc.cidrBlock,
* description: "Primary",
* },
* {
* cidr: exampleAwsVpcIpv4CidrBlockAssociation.cidrBlock,
* description: "Secondary",
* },
* ],
* tags: {
* Env: "live",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Prefix Lists using the `id`. For example:
*
* ```sh
* $ pulumi import aws:ec2/managedPrefixList:ManagedPrefixList default pl-0570a1d2d725c16be
* ```
*/
class ManagedPrefixList extends pulumi.CustomResource {
/**
* Get an existing ManagedPrefixList 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 ManagedPrefixList(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ManagedPrefixList. 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'] === ManagedPrefixList.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addressFamily"] = state?.addressFamily;
resourceInputs["arn"] = state?.arn;
resourceInputs["entries"] = state?.entries;
resourceInputs["maxEntries"] = state?.maxEntries;
resourceInputs["name"] = state?.name;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["version"] = state?.version;
}
else {
const args = argsOrState;
if (args?.addressFamily === undefined && !opts.urn) {
throw new Error("Missing required property 'addressFamily'");
}
if (args?.maxEntries === undefined && !opts.urn) {
throw new Error("Missing required property 'maxEntries'");
}
resourceInputs["addressFamily"] = args?.addressFamily;
resourceInputs["entries"] = args?.entries;
resourceInputs["maxEntries"] = args?.maxEntries;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ManagedPrefixList.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedPrefixList = ManagedPrefixList;
/** @internal */
ManagedPrefixList.__pulumiType = 'aws:ec2/managedPrefixList:ManagedPrefixList';
//# sourceMappingURL=managedPrefixList.js.map