UNPKG

@pulumi/aws

Version:

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

127 lines 5.47 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.NetworkSettings = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS WorkSpaces Web Network Settings resource. Once associated with a web portal, network settings define how streaming instances will connect with your specified VPC. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as std from "@pulumi/std"; * * const example = new aws.ec2.Vpc("example", {cidrBlock: "10.0.0.0/16"}); * const exampleSubnet: aws.ec2.Subnet[] = []; * for (const range = {value: 0}; range.value < 2; range.value++) { * exampleSubnet.push(new aws.ec2.Subnet(`example-${range.value}`, { * vpcId: example.id, * cidrBlock: example.cidrBlock.apply(cidrBlock => std.cidrsubnetOutput({ * input: cidrBlock, * newbits: 8, * netnum: range.value, * })).apply(invoke => invoke.result), * availabilityZone: available.names[range.value], * })); * } * const example1: aws.ec2.SecurityGroup[] = []; * for (const range = {value: 0}; range.value < 2; range.value++) { * example1.push(new aws.ec2.SecurityGroup(`example1-${range.value}`, { * vpcId: example.id, * name: `example-sg-${range.value}$`, * })); * } * const exampleNetworkSettings = new aws.workspacesweb.NetworkSettings("example", { * vpcId: example.id, * subnetIds: [ * exampleSubnet[0].id, * exampleSubnet[1].id, * ], * securityGroupIds: [ * exampleAwsSecurityGroup[0].id, * exampleAwsSecurityGroup[1].id, * ], * }); * ``` * * ## Import * * Using `pulumi import`, import WorkSpaces Web Network Settings using the `network_settings_arn`. For example: * * ```sh * $ pulumi import aws:workspacesweb/networkSettings:NetworkSettings example arn:aws:workspacesweb:us-west-2:123456789012:networksettings/abcdef12345 * ``` */ class NetworkSettings extends pulumi.CustomResource { /** * Get an existing NetworkSettings 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 NetworkSettings(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of NetworkSettings. 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'] === NetworkSettings.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["associatedPortalArns"] = state?.associatedPortalArns; resourceInputs["networkSettingsArn"] = state?.networkSettingsArn; resourceInputs["region"] = state?.region; resourceInputs["securityGroupIds"] = state?.securityGroupIds; resourceInputs["subnetIds"] = state?.subnetIds; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["vpcId"] = state?.vpcId; } else { const args = argsOrState; if (args?.securityGroupIds === undefined && !opts.urn) { throw new Error("Missing required property 'securityGroupIds'"); } if (args?.subnetIds === undefined && !opts.urn) { throw new Error("Missing required property 'subnetIds'"); } if (args?.vpcId === undefined && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["region"] = args?.region; resourceInputs["securityGroupIds"] = args?.securityGroupIds; resourceInputs["subnetIds"] = args?.subnetIds; resourceInputs["tags"] = args?.tags; resourceInputs["vpcId"] = args?.vpcId; resourceInputs["associatedPortalArns"] = undefined /*out*/; resourceInputs["networkSettingsArn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "aws:workspaces/webNetworkSettings:WebNetworkSettings" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(NetworkSettings.__pulumiType, name, resourceInputs, opts); } } exports.NetworkSettings = NetworkSettings; /** @internal */ NetworkSettings.__pulumiType = 'aws:workspacesweb/networkSettings:NetworkSettings'; //# sourceMappingURL=networkSettings.js.map