@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
120 lines • 4.79 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.NetworkAcl = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an network ACL resource. You might set up network ACLs with rules similar
* to your security groups in order to add an additional layer of security to your VPC.
*
* > **NOTE on Network ACLs and Network ACL Rules:** This provider currently
* provides both a standalone Network ACL Rule resource and a Network ACL resource with rules
* defined in-line. At this time you cannot use a Network ACL with in-line rules
* in conjunction with any Network ACL Rule resources. Doing so will cause
* a conflict of rule settings and will overwrite rules.
*
* > **NOTE on Network ACLs and Network ACL Associations:** the provider provides both a standalone network ACL association
* resource and a network ACL resource with a `subnetIds` attribute. Do not use the same subnet ID in both a network ACL
* resource and a network ACL association resource. Doing so will cause a conflict of associations and will overwrite the association.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const main = new aws.ec2.NetworkAcl("main", {
* vpcId: mainAwsVpc.id,
* egress: [{
* protocol: "tcp",
* ruleNo: 200,
* action: "allow",
* cidrBlock: "10.3.0.0/18",
* fromPort: 443,
* toPort: 443,
* }],
* ingress: [{
* protocol: "tcp",
* ruleNo: 100,
* action: "allow",
* cidrBlock: "10.3.0.0/18",
* fromPort: 80,
* toPort: 80,
* }],
* tags: {
* Name: "main",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Network ACLs using the `id`. For example:
*
* ```sh
* $ pulumi import aws:ec2/networkAcl:NetworkAcl main acl-7aaabd18
* ```
*/
class NetworkAcl extends pulumi.CustomResource {
/**
* Get an existing NetworkAcl 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 NetworkAcl(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of NetworkAcl. 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'] === NetworkAcl.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["egress"] = state?.egress;
resourceInputs["ingress"] = state?.ingress;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["region"] = state?.region;
resourceInputs["subnetIds"] = state?.subnetIds;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcId"] = state?.vpcId;
}
else {
const args = argsOrState;
if (args?.vpcId === undefined && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["egress"] = args?.egress;
resourceInputs["ingress"] = args?.ingress;
resourceInputs["region"] = args?.region;
resourceInputs["subnetIds"] = args?.subnetIds;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcId"] = args?.vpcId;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkAcl.__pulumiType, name, resourceInputs, opts);
}
}
exports.NetworkAcl = NetworkAcl;
/** @internal */
NetworkAcl.__pulumiType = 'aws:ec2/networkAcl:NetworkAcl';
//# sourceMappingURL=networkAcl.js.map