@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
99 lines • 4.49 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.ManagedPrefixListEntry = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use the `awsPrefixListEntry` resource to manage a managed prefix list entry.
*
* > **NOTE:** Pulumi currently provides two resources for managing Managed Prefix Lists and Managed Prefix List Entries. The standalone resource, Managed Prefix List Entry, is used to manage a single entry. The Managed Prefix List resource is used to manage multiple entries defined in-line. It is important to note that you cannot use a Managed Prefix List with in-line rules in conjunction with any Managed Prefix List Entry resources. This will result in a conflict of entries and will cause the entries to be overwritten.
*
* > **NOTE:** To improve execution times on larger updates, it is recommended to use the inline `entry` block as part of the Managed Prefix List resource when creating a prefix list with more than 100 entries. You can find more information about the resource here.
*
* ## 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,
* tags: {
* Env: "live",
* },
* });
* const entry1 = new aws.ec2.ManagedPrefixListEntry("entry_1", {
* cidr: exampleAwsVpc.cidrBlock,
* description: "Primary",
* prefixListId: example.id,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import prefix list entries using `prefix_list_id` and `cidr` separated by a comma (`,`). For example:
*
* ```sh
* $ pulumi import aws:ec2/managedPrefixListEntry:ManagedPrefixListEntry default pl-0570a1d2d725c16be,10.0.3.0/24
* ```
*/
class ManagedPrefixListEntry extends pulumi.CustomResource {
/**
* Get an existing ManagedPrefixListEntry 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 ManagedPrefixListEntry(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ManagedPrefixListEntry. 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'] === ManagedPrefixListEntry.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cidr"] = state?.cidr;
resourceInputs["description"] = state?.description;
resourceInputs["prefixListId"] = state?.prefixListId;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.cidr === undefined && !opts.urn) {
throw new Error("Missing required property 'cidr'");
}
if (args?.prefixListId === undefined && !opts.urn) {
throw new Error("Missing required property 'prefixListId'");
}
resourceInputs["cidr"] = args?.cidr;
resourceInputs["description"] = args?.description;
resourceInputs["prefixListId"] = args?.prefixListId;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ManagedPrefixListEntry.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedPrefixListEntry = ManagedPrefixListEntry;
/** @internal */
ManagedPrefixListEntry.__pulumiType = 'aws:ec2/managedPrefixListEntry:ManagedPrefixListEntry';
//# sourceMappingURL=managedPrefixListEntry.js.map