Package com.pulumi.aws.cloudtrail
Class EventDataStore
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.cloudtrail.EventDataStore
-
public class EventDataStore extends com.pulumi.resources.CustomResourceProvides 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`.
### 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 tablepackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.cloudtrail.EventDataStore; import com.pulumi.aws.cloudtrail.EventDataStoreArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new EventDataStore("example", EventDataStoreArgs.builder() .name("example-event-data-store") .build()); } }
## Import ### Identity Schema #### Required - `arn` (String) ARN of the CloudTrail event data store. Using `pulumi import`, import event data stores using their `arn`. For example: ```sh $ pulumi import aws:cloudtrail/eventDataStore:EventDataStore example arn:aws:cloudtrail:us-east-1:123456789123:eventdatastore/22333815-4414-412c-b155-dd254033gfhf ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.dynamodb.DynamodbFunctions; import com.pulumi.aws.dynamodb.inputs.GetTableArgs; import com.pulumi.aws.cloudtrail.EventDataStore; import com.pulumi.aws.cloudtrail.EventDataStoreArgs; import com.pulumi.aws.cloudtrail.inputs.EventDataStoreAdvancedEventSelectorArgs; import com.pulumi.aws.cloudtrail.inputs.EventDataStoreAdvancedEventSelectorFieldSelectorArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var table = DynamodbFunctions.getTable(GetTableArgs.builder() .name("not-important-dynamodb-table") .build()); var example = new EventDataStore("example", EventDataStoreArgs.builder() .advancedEventSelectors(EventDataStoreAdvancedEventSelectorArgs.builder() .fieldSelectors( EventDataStoreAdvancedEventSelectorFieldSelectorArgs.builder() .field("eventCategory") .equals("Data") .build(), EventDataStoreAdvancedEventSelectorFieldSelectorArgs.builder() .field("resources.type") .equals("AWS::DynamoDB::Table") .build(), EventDataStoreAdvancedEventSelectorFieldSelectorArgs.builder() .field("eventName") .equals("PutItem") .build(), EventDataStoreAdvancedEventSelectorFieldSelectorArgs.builder() .field("resources.ARN") .equals(table.arn()) .build()) .name("Log all DynamoDB PutEvent actions for a specific DynamoDB table") .build()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description EventDataStore(java.lang.String name)EventDataStore(java.lang.String name, EventDataStoreArgs args)EventDataStore(java.lang.String name, EventDataStoreArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.List<EventDataStoreAdvancedEventSelector>>advancedEventSelectors()com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.util.Optional<java.lang.String>>billingMode()static EventDataStoreget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, EventDataStoreState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.lang.String>>kmsKeyId()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>multiRegionEnabled()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>organizationEnabled()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>retentionPeriod()com.pulumi.core.Output<java.util.Optional<java.lang.String>>suspend()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>terminationProtectionEnabled()
-
-
-
Constructor Detail
-
EventDataStore
public EventDataStore(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
EventDataStore
public EventDataStore(java.lang.String name, @Nullable EventDataStoreArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
EventDataStore
public EventDataStore(java.lang.String name, @Nullable EventDataStoreArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
advancedEventSelectors
public com.pulumi.core.Output<java.util.List<EventDataStoreAdvancedEventSelector>> advancedEventSelectors()
- Returns:
- The advanced event selectors to use to select the events for the data store. For more information about how to use advanced event selectors, see [Log events by using advanced event selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced) in the CloudTrail User Guide.
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the event data store.
-
billingMode
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> billingMode()
- Returns:
- The billing mode for the event data store. The valid values are `EXTENDABLE_RETENTION_PRICING` and `FIXED_RETENTION_PRICING`. Defaults to `EXTENDABLE_RETENTION_PRICING`.
-
kmsKeyId
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()
- Returns:
- Specifies the AWS KMS key ID to use to encrypt the events delivered by CloudTrail. The value can be an alias name prefixed by alias/, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
-
multiRegionEnabled
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> multiRegionEnabled()
- Returns:
- Specifies whether the event data store includes events from all regions, or only from the region in which the event data store is created. Default: `true`.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- The name of the event data store.
-
organizationEnabled
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> organizationEnabled()
- Returns:
- Specifies whether an event data store collects events logged for an organization in AWS Organizations. Default: `false`.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
retentionPeriod
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> retentionPeriod()
- Returns:
- The retention period of the event data store, in days. You can set a retention period of up to 2555 days, the equivalent of seven years. Default: `2555`.
-
suspend
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> suspend()
- Returns:
- Specifies whether to stop ingesting new events into the event data store. If set to `true`, ingestion is suspended while maintaining the ability to query existing events. If set to `false`, ingestion is active.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
terminationProtectionEnabled
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> terminationProtectionEnabled()
- Returns:
- Specifies whether termination protection is enabled for the event data store. If termination protection is enabled, you cannot delete the event data store until termination protection is disabled. Default: `true`.
-
get
public static EventDataStore get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable EventDataStoreState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-