UNPKG

@pulumi/aws

Version:

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

145 lines 6.46 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.VpcConnection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS QuickSight VPC Connection. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const vpcConnectionRole = new aws.iam.Role("vpc_connection_role", { * assumeRolePolicy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Effect: "Allow", * Action: "sts:AssumeRole", * Principal: { * Service: "quicksight.amazonaws.com", * }, * }], * }), * inlinePolicies: [{ * name: "QuickSightVPCConnectionRolePolicy", * policy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Effect: "Allow", * Action: [ * "ec2:CreateNetworkInterface", * "ec2:ModifyNetworkInterfaceAttribute", * "ec2:DeleteNetworkInterface", * "ec2:DescribeSubnets", * "ec2:DescribeSecurityGroups", * ], * Resource: ["*"], * }], * }), * }], * }); * const example = new aws.quicksight.VpcConnection("example", { * vpcConnectionId: "example-connection-id", * name: "Example Connection", * roleArn: vpcConnectionRole.arn, * securityGroupIds: ["sg-00000000000000000"], * subnetIds: [ * "subnet-00000000000000000", * "subnet-00000000000000001", * ], * }); * ``` * * ## Import * * Using `pulumi import`, import QuickSight VPC connection using the AWS account ID and VPC connection ID separated by commas (`,`). For example: * * ```sh * $ pulumi import aws:quicksight/vpcConnection:VpcConnection example 123456789012,example * ``` */ class VpcConnection extends pulumi.CustomResource { /** * Get an existing VpcConnection 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 VpcConnection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of VpcConnection. 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'] === VpcConnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["availabilityStatus"] = state ? state.availabilityStatus : undefined; resourceInputs["awsAccountId"] = state ? state.awsAccountId : undefined; resourceInputs["dnsResolvers"] = state ? state.dnsResolvers : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["roleArn"] = state ? state.roleArn : undefined; resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined; resourceInputs["subnetIds"] = state ? state.subnetIds : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["timeouts"] = state ? state.timeouts : undefined; resourceInputs["vpcConnectionId"] = state ? state.vpcConnectionId : undefined; } else { const args = argsOrState; if ((!args || args.roleArn === undefined) && !opts.urn) { throw new Error("Missing required property 'roleArn'"); } if ((!args || args.securityGroupIds === undefined) && !opts.urn) { throw new Error("Missing required property 'securityGroupIds'"); } if ((!args || args.subnetIds === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetIds'"); } if ((!args || args.vpcConnectionId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcConnectionId'"); } resourceInputs["awsAccountId"] = args ? args.awsAccountId : undefined; resourceInputs["dnsResolvers"] = args ? args.dnsResolvers : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["roleArn"] = args ? args.roleArn : undefined; resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined; resourceInputs["subnetIds"] = args ? args.subnetIds : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["timeouts"] = args ? args.timeouts : undefined; resourceInputs["vpcConnectionId"] = args ? args.vpcConnectionId : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["availabilityStatus"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcConnection.__pulumiType, name, resourceInputs, opts); } } exports.VpcConnection = VpcConnection; /** @internal */ VpcConnection.__pulumiType = 'aws:quicksight/vpcConnection:VpcConnection'; //# sourceMappingURL=vpcConnection.js.map