UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

86 lines 3.69 kB
"use strict"; // *** 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.NetworkAclAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an network ACL association resource which allows you to associate your network ACL with any subnet(s). * * > **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.NetworkAclAssociation("main", { * networkAclId: mainAwsNetworkAcl.id, * subnetId: mainAwsSubnet.id, * }); * ``` * * ## Import * * Using `pulumi import`, import Network ACL associations using the `id`. For example: * * ```sh * $ pulumi import aws:ec2/networkAclAssociation:NetworkAclAssociation main aclassoc-02baf37f20966b3e6 * ``` */ class NetworkAclAssociation extends pulumi.CustomResource { /** * Get an existing NetworkAclAssociation 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 NetworkAclAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of NetworkAclAssociation. 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'] === NetworkAclAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["networkAclId"] = state?.networkAclId; resourceInputs["region"] = state?.region; resourceInputs["subnetId"] = state?.subnetId; } else { const args = argsOrState; if (args?.networkAclId === undefined && !opts.urn) { throw new Error("Missing required property 'networkAclId'"); } if (args?.subnetId === undefined && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } resourceInputs["networkAclId"] = args?.networkAclId; resourceInputs["region"] = args?.region; resourceInputs["subnetId"] = args?.subnetId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NetworkAclAssociation.__pulumiType, name, resourceInputs, opts); } } exports.NetworkAclAssociation = NetworkAclAssociation; /** @internal */ NetworkAclAssociation.__pulumiType = 'aws:ec2/networkAclAssociation:NetworkAclAssociation'; //# sourceMappingURL=networkAclAssociation.js.map