@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
99 lines • 4.73 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.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, Object.assign(Object.assign({}, 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 ? state.accessGroupId : undefined;
resourceInputs["authorizeAllGroups"] = state ? state.authorizeAllGroups : undefined;
resourceInputs["clientVpnEndpointId"] = state ? state.clientVpnEndpointId : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["targetNetworkCidr"] = state ? state.targetNetworkCidr : undefined;
}
else {
const args = argsOrState;
if ((!args || args.clientVpnEndpointId === undefined) && !opts.urn) {
throw new Error("Missing required property 'clientVpnEndpointId'");
}
if ((!args || args.targetNetworkCidr === undefined) && !opts.urn) {
throw new Error("Missing required property 'targetNetworkCidr'");
}
resourceInputs["accessGroupId"] = args ? args.accessGroupId : undefined;
resourceInputs["authorizeAllGroups"] = args ? args.authorizeAllGroups : undefined;
resourceInputs["clientVpnEndpointId"] = args ? args.clientVpnEndpointId : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["targetNetworkCidr"] = args ? args.targetNetworkCidr : undefined;
}
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