UNPKG

@pulumi/aws

Version:

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

119 lines 4.79 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.SessionLoggerAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS WorkSpaces Web Session Logger Association. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const examplePortal = new aws.workspacesweb.Portal("example", {displayName: "example"}); * const exampleBucket = new aws.s3.Bucket("example", { * bucket: "example-session-logs", * forceDestroy: true, * }); * const example = aws.iam.getPolicyDocumentOutput({ * statements: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["workspaces-web.amazonaws.com"], * }], * actions: ["s3:PutObject"], * resources: [pulumi.interpolate`${exampleBucket.arn}/*`], * }], * }); * const exampleBucketPolicy = new aws.s3.BucketPolicy("example", { * bucket: exampleBucket.id, * policy: example.apply(example => example.json), * }); * const exampleSessionLogger = new aws.workspacesweb.SessionLogger("example", { * displayName: "example", * eventFilter: { * all: {}[0], * }, * logConfiguration: { * s3: { * bucket: exampleBucket.id, * folderStructure: "Flat", * logFileFormat: "Json", * }, * }, * }, { * dependsOn: [exampleBucketPolicy], * }); * const exampleSessionLoggerAssociation = new aws.workspacesweb.SessionLoggerAssociation("example", { * portalArn: examplePortal.portalArn, * sessionLoggerArn: exampleSessionLogger.sessionLoggerArn, * }); * ``` * * ## Import * * Using `pulumi import`, import WorkSpaces Web Session Logger Association using the `session_logger_arn,portal_arn`. For example: * * ```sh * $ pulumi import aws:workspacesweb/sessionLoggerAssociation:SessionLoggerAssociation example arn:aws:workspaces-web:us-west-2:123456789012:sessionLogger/session_logger-id-12345678,arn:aws:workspaces-web:us-west-2:123456789012:portal/portal-id-12345678 * ``` */ class SessionLoggerAssociation extends pulumi.CustomResource { /** * Get an existing SessionLoggerAssociation 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 SessionLoggerAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of SessionLoggerAssociation. 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'] === SessionLoggerAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["portalArn"] = state?.portalArn; resourceInputs["region"] = state?.region; resourceInputs["sessionLoggerArn"] = state?.sessionLoggerArn; } else { const args = argsOrState; if (args?.portalArn === undefined && !opts.urn) { throw new Error("Missing required property 'portalArn'"); } if (args?.sessionLoggerArn === undefined && !opts.urn) { throw new Error("Missing required property 'sessionLoggerArn'"); } resourceInputs["portalArn"] = args?.portalArn; resourceInputs["region"] = args?.region; resourceInputs["sessionLoggerArn"] = args?.sessionLoggerArn; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SessionLoggerAssociation.__pulumiType, name, resourceInputs, opts); } } exports.SessionLoggerAssociation = SessionLoggerAssociation; /** @internal */ SessionLoggerAssociation.__pulumiType = 'aws:workspacesweb/sessionLoggerAssociation:SessionLoggerAssociation'; //# sourceMappingURL=sessionLoggerAssociation.js.map