UNPKG

@pulumi/aws

Version:

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

99 lines 4.45 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.AuthorizationRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides authorization rules for AWS Client VPN endpoints. For more information on usage, please see the * [AWS Client VPN Administrator's Guide](https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/what-is.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2clientvpn.AuthorizationRule("example", { * clientVpnEndpointId: exampleAwsEc2ClientVpnEndpoint.id, * targetNetworkCidr: exampleAwsSubnet.cidrBlock, * authorizeAllGroups: true, * }); * ``` * * ## Import * * Using the endpoint ID, target network CIDR, and group name: * * __Using `pulumi import` to import__ AWS Client VPN authorization rules using the endpoint ID and target network CIDR. If there is a specific group name, include that also. All values are separated by a `,`. For example: * * Using the endpoint ID and target network CIDR: * * ```sh * $ pulumi import aws:ec2clientvpn/authorizationRule:AuthorizationRule example cvpn-endpoint-0ac3a1abbccddd666,10.1.0.0/24 * ``` * Using the endpoint ID, target network CIDR, and group name: * * ```sh * $ pulumi import aws:ec2clientvpn/authorizationRule:AuthorizationRule example cvpn-endpoint-0ac3a1abbccddd666,10.1.0.0/24,team-a * ``` */ class AuthorizationRule extends pulumi.CustomResource { /** * Get an existing AuthorizationRule 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 AuthorizationRule(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AuthorizationRule. 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'] === AuthorizationRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessGroupId"] = state?.accessGroupId; resourceInputs["authorizeAllGroups"] = state?.authorizeAllGroups; resourceInputs["clientVpnEndpointId"] = state?.clientVpnEndpointId; resourceInputs["description"] = state?.description; resourceInputs["region"] = state?.region; resourceInputs["targetNetworkCidr"] = state?.targetNetworkCidr; } else { const args = argsOrState; if (args?.clientVpnEndpointId === undefined && !opts.urn) { throw new Error("Missing required property 'clientVpnEndpointId'"); } if (args?.targetNetworkCidr === undefined && !opts.urn) { throw new Error("Missing required property 'targetNetworkCidr'"); } resourceInputs["accessGroupId"] = args?.accessGroupId; resourceInputs["authorizeAllGroups"] = args?.authorizeAllGroups; resourceInputs["clientVpnEndpointId"] = args?.clientVpnEndpointId; resourceInputs["description"] = args?.description; resourceInputs["region"] = args?.region; resourceInputs["targetNetworkCidr"] = args?.targetNetworkCidr; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AuthorizationRule.__pulumiType, name, resourceInputs, opts); } } exports.AuthorizationRule = AuthorizationRule; /** @internal */ AuthorizationRule.__pulumiType = 'aws:ec2clientvpn/authorizationRule:AuthorizationRule'; //# sourceMappingURL=authorizationRule.js.map