@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
127 lines • 5.03 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.NetworkSettingsAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS WorkSpaces Web Network Settings Association.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* const available = aws.getAvailabilityZones({
* state: "available",
* filters: [{
* name: "opt-in-status",
* values: ["opt-in-not-required"],
* }],
* });
* const example = new aws.ec2.Vpc("example", {
* cidrBlock: "10.0.0.0/16",
* tags: {
* Name: "example",
* },
* });
* 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.then(available => available.names[range.value]),
* tags: {
* Name: "example",
* },
* }));
* }
* const exampleSecurityGroup: aws.ec2.SecurityGroup[] = [];
* for (const range = {value: 0}; range.value < 2; range.value++) {
* exampleSecurityGroup.push(new aws.ec2.SecurityGroup(`example-${range.value}`, {
* vpcId: example.id,
* name: `example-${range.value}`,
* tags: {
* Name: "example",
* },
* }));
* }
* const examplePortal = new aws.workspacesweb.Portal("example", {displayName: "example"});
* const exampleNetworkSettings = new aws.workspacesweb.NetworkSettings("example", {
* vpcId: example.id,
* subnetIds: [
* exampleSubnet[0].id,
* exampleSubnet[1].id,
* ],
* securityGroupIds: [
* exampleSecurityGroup[0].id,
* exampleSecurityGroup[1].id,
* ],
* });
* const exampleNetworkSettingsAssociation = new aws.workspacesweb.NetworkSettingsAssociation("example", {
* networkSettingsArn: exampleNetworkSettings.networkSettingsArn,
* portalArn: examplePortal.portalArn,
* });
* ```
*/
class NetworkSettingsAssociation extends pulumi.CustomResource {
/**
* Get an existing NetworkSettingsAssociation 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 NetworkSettingsAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of NetworkSettingsAssociation. 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'] === NetworkSettingsAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["networkSettingsArn"] = state?.networkSettingsArn;
resourceInputs["portalArn"] = state?.portalArn;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.networkSettingsArn === undefined && !opts.urn) {
throw new Error("Missing required property 'networkSettingsArn'");
}
if (args?.portalArn === undefined && !opts.urn) {
throw new Error("Missing required property 'portalArn'");
}
resourceInputs["networkSettingsArn"] = args?.networkSettingsArn;
resourceInputs["portalArn"] = args?.portalArn;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkSettingsAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.NetworkSettingsAssociation = NetworkSettingsAssociation;
/** @internal */
NetworkSettingsAssociation.__pulumiType = 'aws:workspacesweb/networkSettingsAssociation:NetworkSettingsAssociation';
//# sourceMappingURL=networkSettingsAssociation.js.map
;