UNPKG

@pulumi/aws

Version:

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

124 lines 4.88 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.StorageLensConfiguration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage an S3 Storage Lens configuration. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const example = new aws.s3control.StorageLensConfiguration("example", { * configId: "example-1", * storageLensConfiguration: { * enabled: true, * accountLevel: { * activityMetrics: { * enabled: true, * }, * bucketLevel: { * activityMetrics: { * enabled: true, * }, * }, * }, * dataExport: { * cloudWatchMetrics: { * enabled: true, * }, * s3BucketDestination: { * accountId: current.then(current => current.accountId), * arn: target.arn, * format: "CSV", * outputSchemaVersion: "V_1", * encryption: { * sseS3s: [{}], * }, * }, * }, * exclude: { * buckets: [ * b1.arn, * b2.arn, * ], * regions: ["us-east-2"], * }, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import S3 Storage Lens configurations using the `account_id` and `config_id`, separated by a colon (`:`). For example: * * ```sh * $ pulumi import aws:s3control/storageLensConfiguration:StorageLensConfiguration example 123456789012:example-1 * ``` */ class StorageLensConfiguration extends pulumi.CustomResource { /** * Get an existing StorageLensConfiguration 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 StorageLensConfiguration(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of StorageLensConfiguration. 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'] === StorageLensConfiguration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["arn"] = state?.arn; resourceInputs["configId"] = state?.configId; resourceInputs["region"] = state?.region; resourceInputs["storageLensConfiguration"] = state?.storageLensConfiguration; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.configId === undefined && !opts.urn) { throw new Error("Missing required property 'configId'"); } if (args?.storageLensConfiguration === undefined && !opts.urn) { throw new Error("Missing required property 'storageLensConfiguration'"); } resourceInputs["accountId"] = args?.accountId; resourceInputs["configId"] = args?.configId; resourceInputs["region"] = args?.region; resourceInputs["storageLensConfiguration"] = args?.storageLensConfiguration; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(StorageLensConfiguration.__pulumiType, name, resourceInputs, opts); } } exports.StorageLensConfiguration = StorageLensConfiguration; /** @internal */ StorageLensConfiguration.__pulumiType = 'aws:s3control/storageLensConfiguration:StorageLensConfiguration'; //# sourceMappingURL=storageLensConfiguration.js.map