UNPKG

@pulumi/aws

Version:

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

145 lines 6.32 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.EventDataStore = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a CloudTrail Event Data Store. * * More information about event data stores can be found in the [Event Data Store User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). * * > **Tip:** For an organization event data store you must create this resource in the management account. * * ## Example Usage * * ### Basic * * The most simple event data store configuration requires us to only set the `name` attribute. The event data store will automatically capture all management events. To capture management events from all the regions, `multiRegionEnabled` must be `true`. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudtrail.EventDataStore("example", {name: "example-event-data-store"}); * ``` * * ### Data Event Logging * * CloudTrail can log [Data Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) for certain services such as S3 bucket objects and Lambda function invocations. Additional information about data event configuration can be found in the following links: * * - [CloudTrail API AdvancedFieldSelector documentation](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html) * * ### Log all DynamoDB PutEvent actions for a specific DynamoDB table * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const table = aws.dynamodb.getTable({ * name: "not-important-dynamodb-table", * }); * const example = new aws.cloudtrail.EventDataStore("example", {advancedEventSelectors: [{ * name: "Log all DynamoDB PutEvent actions for a specific DynamoDB table", * fieldSelectors: [ * { * field: "eventCategory", * equals: ["Data"], * }, * { * field: "resources.type", * equals: ["AWS::DynamoDB::Table"], * }, * { * field: "eventName", * equals: ["PutItem"], * }, * { * field: "resources.ARN", * equals: [table.then(table => table.arn)], * }, * ], * }]}); * ``` * * ## Import * * ### Identity Schema * * #### Required * * - `arn` (String) Amazon Resource Name (ARN) of the CloudTrail event data store. * * Using `pulumi import`, import event data stores using their `arn`. For example: * * console * * % pulumi import aws_cloudtrail_event_data_store.example arn:aws:cloudtrail:us-east-1:123456789123:eventdatastore/22333815-4414-412c-b155-dd254033gfhf */ class EventDataStore extends pulumi.CustomResource { /** * Get an existing EventDataStore 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 EventDataStore(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of EventDataStore. 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'] === EventDataStore.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["advancedEventSelectors"] = state?.advancedEventSelectors; resourceInputs["arn"] = state?.arn; resourceInputs["billingMode"] = state?.billingMode; resourceInputs["kmsKeyId"] = state?.kmsKeyId; resourceInputs["multiRegionEnabled"] = state?.multiRegionEnabled; resourceInputs["name"] = state?.name; resourceInputs["organizationEnabled"] = state?.organizationEnabled; resourceInputs["region"] = state?.region; resourceInputs["retentionPeriod"] = state?.retentionPeriod; resourceInputs["suspend"] = state?.suspend; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["terminationProtectionEnabled"] = state?.terminationProtectionEnabled; } else { const args = argsOrState; resourceInputs["advancedEventSelectors"] = args?.advancedEventSelectors; resourceInputs["billingMode"] = args?.billingMode; resourceInputs["kmsKeyId"] = args?.kmsKeyId; resourceInputs["multiRegionEnabled"] = args?.multiRegionEnabled; resourceInputs["name"] = args?.name; resourceInputs["organizationEnabled"] = args?.organizationEnabled; resourceInputs["region"] = args?.region; resourceInputs["retentionPeriod"] = args?.retentionPeriod; resourceInputs["suspend"] = args?.suspend; resourceInputs["tags"] = args?.tags; resourceInputs["terminationProtectionEnabled"] = args?.terminationProtectionEnabled; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EventDataStore.__pulumiType, name, resourceInputs, opts); } } exports.EventDataStore = EventDataStore; /** @internal */ EventDataStore.__pulumiType = 'aws:cloudtrail/eventDataStore:EventDataStore'; //# sourceMappingURL=eventDataStore.js.map