Documentation ¶
Index ¶
- func CfnChannel_CFN_RESOURCE_TYPE_NAME() *string
- func CfnChannel_IsCfnElement(x interface{}) *bool
- func CfnChannel_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnChannel_IsConstruct(x interface{}) *bool
- func CfnEventDataStore_CFN_RESOURCE_TYPE_NAME() *string
- func CfnEventDataStore_IsCfnElement(x interface{}) *bool
- func CfnEventDataStore_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnEventDataStore_IsConstruct(x interface{}) *bool
- func CfnResourcePolicy_CFN_RESOURCE_TYPE_NAME() *string
- func CfnResourcePolicy_IsCfnElement(x interface{}) *bool
- func CfnResourcePolicy_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnResourcePolicy_IsConstruct(x interface{}) *bool
- func CfnTrail_CFN_RESOURCE_TYPE_NAME() *string
- func CfnTrail_IsCfnElement(x interface{}) *bool
- func CfnTrail_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnTrail_IsConstruct(x interface{}) *bool
- func NewCfnChannel_Override(c CfnChannel, scope constructs.Construct, id *string, props *CfnChannelProps)
- func NewCfnEventDataStore_Override(c CfnEventDataStore, scope constructs.Construct, id *string, ...)
- func NewCfnResourcePolicy_Override(c CfnResourcePolicy, scope constructs.Construct, id *string, ...)
- func NewCfnTrail_Override(c CfnTrail, scope constructs.Construct, id *string, props *CfnTrailProps)
- func NewInsightType_Override(i InsightType, value *string)
- func NewTrail_Override(t Trail, scope constructs.Construct, id *string, props *TrailProps)
- func Trail_IsConstruct(x interface{}) *bool
- func Trail_IsOwnedResource(construct constructs.IConstruct) *bool
- func Trail_IsResource(construct constructs.IConstruct) *bool
- func Trail_OnEvent(scope constructs.Construct, id *string, options *awsevents.OnEventOptions) awsevents.Rule
- type AddEventSelectorOptions
- type CfnChannel
- type CfnChannelProps
- type CfnChannel_DestinationProperty
- type CfnEventDataStore
- type CfnEventDataStoreProps
- type CfnEventDataStore_AdvancedEventSelectorProperty
- type CfnEventDataStore_AdvancedFieldSelectorProperty
- type CfnResourcePolicy
- type CfnResourcePolicyProps
- type CfnTrail
- type CfnTrailProps
- type CfnTrail_AdvancedEventSelectorProperty
- type CfnTrail_AdvancedFieldSelectorProperty
- type CfnTrail_DataResourceProperty
- type CfnTrail_EventSelectorProperty
- type CfnTrail_InsightSelectorProperty
- type DataResourceType
- type InsightType
- type ManagementEventSources
- type ReadWriteType
- type S3EventSelector
- type Trail
- type TrailProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CfnChannel_CFN_RESOURCE_TYPE_NAME ¶ added in v2.64.0
func CfnChannel_CFN_RESOURCE_TYPE_NAME() *string
func CfnChannel_IsCfnElement ¶ added in v2.64.0
func CfnChannel_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnChannel_IsCfnResource ¶ added in v2.64.0
func CfnChannel_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnChannel_IsConstruct ¶ added in v2.64.0
func CfnChannel_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnEventDataStore_CFN_RESOURCE_TYPE_NAME ¶ added in v2.31.0
func CfnEventDataStore_CFN_RESOURCE_TYPE_NAME() *string
func CfnEventDataStore_IsCfnElement ¶ added in v2.31.0
func CfnEventDataStore_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnEventDataStore_IsCfnResource ¶ added in v2.31.0
func CfnEventDataStore_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnEventDataStore_IsConstruct ¶ added in v2.31.0
func CfnEventDataStore_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnResourcePolicy_CFN_RESOURCE_TYPE_NAME ¶ added in v2.64.0
func CfnResourcePolicy_CFN_RESOURCE_TYPE_NAME() *string
func CfnResourcePolicy_IsCfnElement ¶ added in v2.64.0
func CfnResourcePolicy_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnResourcePolicy_IsCfnResource ¶ added in v2.64.0
func CfnResourcePolicy_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnResourcePolicy_IsConstruct ¶ added in v2.64.0
func CfnResourcePolicy_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func CfnTrail_CFN_RESOURCE_TYPE_NAME ¶
func CfnTrail_CFN_RESOURCE_TYPE_NAME() *string
func CfnTrail_IsCfnElement ¶
func CfnTrail_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnTrail_IsCfnResource ¶
func CfnTrail_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnTrail_IsConstruct ¶
func CfnTrail_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func NewCfnChannel_Override ¶ added in v2.64.0
func NewCfnChannel_Override(c CfnChannel, scope constructs.Construct, id *string, props *CfnChannelProps)
func NewCfnEventDataStore_Override ¶ added in v2.31.0
func NewCfnEventDataStore_Override(c CfnEventDataStore, scope constructs.Construct, id *string, props *CfnEventDataStoreProps)
func NewCfnResourcePolicy_Override ¶ added in v2.64.0
func NewCfnResourcePolicy_Override(c CfnResourcePolicy, scope constructs.Construct, id *string, props *CfnResourcePolicyProps)
func NewCfnTrail_Override ¶
func NewCfnTrail_Override(c CfnTrail, scope constructs.Construct, id *string, props *CfnTrailProps)
func NewInsightType_Override ¶ added in v2.54.0
func NewInsightType_Override(i InsightType, value *string)
func NewTrail_Override ¶
func NewTrail_Override(t Trail, scope constructs.Construct, id *string, props *TrailProps)
func Trail_IsConstruct ¶
func Trail_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Trail_IsOwnedResource ¶ added in v2.32.0
func Trail_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Trail_IsResource ¶
func Trail_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func Trail_OnEvent ¶
func Trail_OnEvent(scope constructs.Construct, id *string, options *awsevents.OnEventOptions) awsevents.Rule
Create an event rule for when an event is recorded by any Trail in the account.
Note that the event doesn't necessarily have to come from this Trail, it can be captured from any one.
Be sure to filter the event further down using an event pattern.
Types ¶
type AddEventSelectorOptions ¶
type AddEventSelectorOptions struct { // An optional list of service event sources from which you do not want management events to be logged on your trail. // Default: []. // ExcludeManagementEventSources *[]ManagementEventSources `field:"optional" json:"excludeManagementEventSources" yaml:"excludeManagementEventSources"` // Specifies whether the event selector includes management events for the trail. // Default: true. // IncludeManagementEvents *bool `field:"optional" json:"includeManagementEvents" yaml:"includeManagementEvents"` // Specifies whether to log read-only events, write-only events, or all events. // Default: ReadWriteType.All // ReadWriteType ReadWriteType `field:"optional" json:"readWriteType" yaml:"readWriteType"` }
Options for adding an event selector.
Example:
import "github.com/aws/aws-cdk-go/awscdk" var sourceBucket bucket sourceOutput := codepipeline.NewArtifact() key := "some/key.zip" trail := cloudtrail.NewTrail(this, jsii.String("CloudTrail")) trail.AddS3EventSelector([]s3EventSelector{ &s3EventSelector{ Bucket: sourceBucket, ObjectPrefix: key, }, }, &AddEventSelectorOptions{ ReadWriteType: cloudtrail.ReadWriteType_WRITE_ONLY, }) sourceAction := codepipeline_actions.NewS3SourceAction(&S3SourceActionProps{ ActionName: jsii.String("S3Source"), BucketKey: key, Bucket: sourceBucket, Output: sourceOutput, Trigger: codepipeline_actions.S3Trigger_EVENTS, })
type CfnChannel ¶ added in v2.64.0
type CfnChannel interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // `Ref` returns the ARN of the CloudTrail channel, such as `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` . AttrChannelArn() *string // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // One or more event data stores to which events arriving through a channel will be logged. Destinations() interface{} SetDestinations(val interface{}) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The name of the channel. Name() *string SetName(val *string) // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The name of the partner or external event source. Source() *string SetSource(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // A list of tags. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Contains information about a returned CloudTrail channel.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnChannel := awscdk.Aws_cloudtrail.NewCfnChannel(this, jsii.String("MyCfnChannel"), &CfnChannelProps{ Destinations: []interface{}{ &DestinationProperty{ Location: jsii.String("location"), Type: jsii.String("type"), }, }, Name: jsii.String("name"), Source: jsii.String("source"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html
func NewCfnChannel ¶ added in v2.64.0
func NewCfnChannel(scope constructs.Construct, id *string, props *CfnChannelProps) CfnChannel
type CfnChannelProps ¶ added in v2.64.0
type CfnChannelProps struct { // One or more event data stores to which events arriving through a channel will be logged. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-destinations // Destinations interface{} `field:"optional" json:"destinations" yaml:"destinations"` // The name of the channel. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-name // Name *string `field:"optional" json:"name" yaml:"name"` // The name of the partner or external event source. // // You cannot change this name after you create the channel. A maximum of one channel is allowed per source. // // A source can be either `Custom` for all valid non- AWS events, or the name of a partner event source. For information about the source names for available partners, see [Additional information about integration partners](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information) in the CloudTrail User Guide. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-source // Source *string `field:"optional" json:"source" yaml:"source"` // A list of tags. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html#cfn-cloudtrail-channel-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnChannel`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnChannelProps := &CfnChannelProps{ Destinations: []interface{}{ &DestinationProperty{ Location: jsii.String("location"), Type: jsii.String("type"), }, }, Name: jsii.String("name"), Source: jsii.String("source"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-channel.html
type CfnChannel_DestinationProperty ¶ added in v2.64.0
type CfnChannel_DestinationProperty struct { // For channels used for a CloudTrail Lake integration, the location is the ARN of an event data store that receives events from a channel. // // For service-linked channels, the location is the name of the AWS service. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-channel-destination.html#cfn-cloudtrail-channel-destination-location // Location *string `field:"required" json:"location" yaml:"location"` // The type of destination for events arriving from a channel. // // For channels used for a CloudTrail Lake integration, the value is `EventDataStore` . For service-linked channels, the value is `AWS_SERVICE` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-channel-destination.html#cfn-cloudtrail-channel-destination-type // Type *string `field:"required" json:"type" yaml:"type"` }
Contains information about the destination receiving events.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" destinationProperty := &DestinationProperty{ Location: jsii.String("location"), Type: jsii.String("type"), }
type CfnEventDataStore ¶ added in v2.31.0
type CfnEventDataStore interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // The advanced event selectors to use to select the events for the data store. AdvancedEventSelectors() interface{} SetAdvancedEventSelectors(val interface{}) // `Ref` returns the time stamp of the creation of the event data store, such as `1248496624` . AttrCreatedTimestamp() *string // `Ref` returns the ARN of the CloudTrail event data store, such as `arn:aws:cloudtrail:us-east-1:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` . AttrEventDataStoreArn() *string // `Ref` returns the status of the event data store, such as `ENABLED` . AttrStatus() *string // `Ref` returns the time stamp that updates were made to an event data store, such as `1598296624` . AttrUpdatedTimestamp() *string // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // Specifies whether the event data store should start ingesting live events. IngestionEnabled() interface{} SetIngestionEnabled(val interface{}) // Specifies the AWS KMS key ID to use to encrypt the events delivered by CloudTrail. KmsKeyId() *string SetKmsKeyId(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // Specifies whether the event data store includes events from all Regions, or only from the Region in which the event data store is created. MultiRegionEnabled() interface{} SetMultiRegionEnabled(val interface{}) // The name of the event data store. Name() *string SetName(val *string) // The tree node. Node() constructs.Node // Specifies whether an event data store collects events logged for an organization in AWS Organizations . OrganizationEnabled() interface{} SetOrganizationEnabled(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The retention period of the event data store, in days. RetentionPeriod() *float64 SetRetentionPeriod(val *float64) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // A list of tags. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Specifies whether termination protection is enabled for the event data store. TerminationProtectionEnabled() interface{} SetTerminationProtectionEnabled(val interface{}) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Creates a new event data store.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnEventDataStore := awscdk.Aws_cloudtrail.NewCfnEventDataStore(this, jsii.String("MyCfnEventDataStore"), &CfnEventDataStoreProps{ AdvancedEventSelectors: []interface{}{ &AdvancedEventSelectorProperty{ FieldSelectors: []interface{}{ &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }, }, // the properties below are optional Name: jsii.String("name"), }, }, IngestionEnabled: jsii.Boolean(false), KmsKeyId: jsii.String("kmsKeyId"), MultiRegionEnabled: jsii.Boolean(false), Name: jsii.String("name"), OrganizationEnabled: jsii.Boolean(false), RetentionPeriod: jsii.Number(123), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TerminationProtectionEnabled: jsii.Boolean(false), })
func NewCfnEventDataStore ¶ added in v2.31.0
func NewCfnEventDataStore(scope constructs.Construct, id *string, props *CfnEventDataStoreProps) CfnEventDataStore
type CfnEventDataStoreProps ¶ added in v2.31.0
type CfnEventDataStoreProps struct { // The advanced event selectors to use to select the events for the data store. // // You can configure up to five advanced event selectors for each event data store. // // For more information about how to use advanced event selectors to log CloudTrail events, 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. // // For more information about how to use advanced event selectors to include AWS Config configuration items in your event data store, see [Create an event data store for AWS Config configuration items](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-lake-cli.html#lake-cli-create-eds-config) in the CloudTrail User Guide. // // For more information about how to use advanced event selectors to include non- AWS events in your event data store, see [Create an integration to log events from outside AWS](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-lake-cli.html#lake-cli-create-integration) in the CloudTrail User Guide. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-advancedeventselectors // AdvancedEventSelectors interface{} `field:"optional" json:"advancedEventSelectors" yaml:"advancedEventSelectors"` // Specifies whether the event data store should start ingesting live events. // // The default is true. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-ingestionenabled // IngestionEnabled interface{} `field:"optional" json:"ingestionEnabled" yaml:"ingestionEnabled"` // 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. // // > Disabling or deleting the KMS key, or removing CloudTrail permissions on the key, prevents CloudTrail from logging events to the event data store, and prevents users from querying the data in the event data store that was encrypted with the key. After you associate an event data store with a KMS key, the KMS key cannot be removed or changed. Before you disable or delete a KMS key that you are using with an event data store, delete or back up your event data store. // // CloudTrail also supports AWS KMS multi-Region keys. For more information about multi-Region keys, see [Using multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *AWS Key Management Service Developer Guide* . // // Examples: // // - `alias/MyAliasName` // - `arn:aws:kms:us-east-2:123456789012:alias/MyAliasName` // - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` // - `12345678-1234-1234-1234-123456789012`. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-kmskeyid // KmsKeyId *string `field:"optional" json:"kmsKeyId" yaml:"kmsKeyId"` // Specifies whether the event data store includes events from all Regions, or only from the Region in which the event data store is created. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-multiregionenabled // MultiRegionEnabled interface{} `field:"optional" json:"multiRegionEnabled" yaml:"multiRegionEnabled"` // The name of the event data store. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-name // Name *string `field:"optional" json:"name" yaml:"name"` // Specifies whether an event data store collects events logged for an organization in AWS Organizations . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-organizationenabled // OrganizationEnabled interface{} `field:"optional" json:"organizationEnabled" yaml:"organizationEnabled"` // The retention period of the event data store, in days. // // You can set a retention period of up to 2557 days, the equivalent of seven years. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-retentionperiod // RetentionPeriod *float64 `field:"optional" json:"retentionPeriod" yaml:"retentionPeriod"` // A list of tags. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // 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. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-eventdatastore.html#cfn-cloudtrail-eventdatastore-terminationprotectionenabled // TerminationProtectionEnabled interface{} `field:"optional" json:"terminationProtectionEnabled" yaml:"terminationProtectionEnabled"` }
Properties for defining a `CfnEventDataStore`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnEventDataStoreProps := &CfnEventDataStoreProps{ AdvancedEventSelectors: []interface{}{ &AdvancedEventSelectorProperty{ FieldSelectors: []interface{}{ &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }, }, // the properties below are optional Name: jsii.String("name"), }, }, IngestionEnabled: jsii.Boolean(false), KmsKeyId: jsii.String("kmsKeyId"), MultiRegionEnabled: jsii.Boolean(false), Name: jsii.String("name"), OrganizationEnabled: jsii.Boolean(false), RetentionPeriod: jsii.Number(123), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TerminationProtectionEnabled: jsii.Boolean(false), }
type CfnEventDataStore_AdvancedEventSelectorProperty ¶ added in v2.31.0
type CfnEventDataStore_AdvancedEventSelectorProperty struct { // Contains all selector statements in an advanced event selector. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedeventselector.html#cfn-cloudtrail-eventdatastore-advancedeventselector-fieldselectors // FieldSelectors interface{} `field:"required" json:"fieldSelectors" yaml:"fieldSelectors"` // An optional, descriptive name for an advanced event selector, such as "Log data events for only two S3 buckets". // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedeventselector.html#cfn-cloudtrail-eventdatastore-advancedeventselector-name // Name *string `field:"optional" json:"name" yaml:"name"` }
Advanced event selectors let you create fine-grained selectors for the following AWS CloudTrail event record fields.
They help you control costs by logging only those events that are important to you. For more information about advanced event selectors, see [Logging data events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) in the *AWS CloudTrail User Guide* .
- `readOnly` - `eventSource` - `eventName` - `eventCategory` - `resources.type` - `resources.ARN`
You cannot apply both event selectors and advanced event selectors to a trail.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" advancedEventSelectorProperty := &AdvancedEventSelectorProperty{ FieldSelectors: []interface{}{ &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }, }, // the properties below are optional Name: jsii.String("name"), }
type CfnEventDataStore_AdvancedFieldSelectorProperty ¶ added in v2.31.0
type CfnEventDataStore_AdvancedFieldSelectorProperty struct { // A field in a CloudTrail event record on which to filter events to be logged. // // For event data stores for AWS Config configuration items, Audit Manager evidence, or non- AWS events, the field is used only for selecting events as filtering is not supported. // // For CloudTrail event records, supported fields include `readOnly` , `eventCategory` , `eventSource` (for management events), `eventName` , `resources.type` , and `resources.ARN` . // // For event data stores for AWS Config configuration items, Audit Manager evidence, or non- AWS events, the only supported field is `eventCategory` . // // - *`readOnly`* - Optional. Can be set to `Equals` a value of `true` or `false` . If you do not add this field, CloudTrail logs both `read` and `write` events. A value of `true` logs only `read` events. A value of `false` logs only `write` events. // - *`eventSource`* - For filtering management events only. This can be set to `NotEquals` `kms.amazonaws.com` or `NotEquals` `rdsdata.amazonaws.com` . // - *`eventName`* - Can use any operator. You can use it to filter in or filter out any data event logged to CloudTrail, such as `PutBucket` or `GetSnapshotBlock` . You can have multiple values for this field, separated by commas. // - *`eventCategory`* - This is required and must be set to `Equals` . // // - For CloudTrail event records, the value must be `Management` or `Data` . // - For AWS Config configuration items, the value must be `ConfigurationItem` . // - For Audit Manager evidence, the value must be `Evidence` . // - For non- AWS events, the value must be `ActivityAuditLog` . // - *`resources.type`* - This field is required for CloudTrail data events. `resources.type` can only use the `Equals` operator, and the value can be one of the following: // // - `AWS::DynamoDB::Table` // - `AWS::Lambda::Function` // - `AWS::S3::Object` // - `AWS::CloudTrail::Channel` // - `AWS::CodeWhisperer::Profile` // - `AWS::Cognito::IdentityPool` // - `AWS::DynamoDB::Stream` // - `AWS::EC2::Snapshot` // - `AWS::EMRWAL::Workspace` // - `AWS::FinSpace::Environment` // - `AWS::Glue::Table` // - `AWS::GuardDuty::Detector` // - `AWS::KendraRanking::ExecutionPlan` // - `AWS::ManagedBlockchain::Network` // - `AWS::ManagedBlockchain::Node` // - `AWS::MedicalImaging::Datastore` // - `AWS::PCAConnectorAD::Connector` // - `AWS::SageMaker::ExperimentTrialComponent` // - `AWS::SageMaker::FeatureGroup` // - `AWS::S3::AccessPoint` // - `AWS::S3ObjectLambda::AccessPoint` // - `AWS::S3Outposts::Object` // - `AWS::SSMMessages::ControlChannel` // - `AWS::VerifiedPermissions::PolicyStore` // // You can have only one `resources.type` field per selector. To log data events on more than one resource type, add another selector. // - *`resources.ARN`* - You can use any operator with `resources.ARN` , but if you use `Equals` or `NotEquals` , the value must exactly match the ARN of a valid resource of the type you've specified in the template as the value of resources.type. For example, if resources.type equals `AWS::S3::Object` , the ARN must be in one of the following formats. To log all data events for all objects in a specific S3 bucket, use the `StartsWith` operator, and include only the bucket ARN as the matching value. // // The trailing slash is intentional; do not exclude it. Replace the text between less than and greater than symbols (<>) with resource-specific information. // // - `arn:<partition>:s3:::<bucket_name>/` // - `arn:<partition>:s3:::<bucket_name>/<object_path>/` // // When resources.type equals `AWS::DynamoDB::Table` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:dynamodb:<region>:<account_ID>:table/<table_name>` // // When resources.type equals `AWS::Lambda::Function` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:lambda:<region>:<account_ID>:function:<function_name>` // // When resources.type equals `AWS::CloudTrail::Channel` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:cloudtrail:<region>:<account_ID>:channel/<channel_UUID>` // // When resources.type equals `AWS::CodeWhisperer::Profile` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:codewhisperer:<region>:<account_ID>:profile/<profile_ID>` // // When resources.type equals `AWS::Cognito::IdentityPool` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:cognito-identity:<region>:<account_ID>:identitypool/<identity_pool_ID>` // // When `resources.type` equals `AWS::DynamoDB::Stream` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:dynamodb:<region>:<account_ID>:table/<table_name>/stream/<date_time>` // // When `resources.type` equals `AWS::EC2::Snapshot` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:ec2:<region>::snapshot/<snapshot_ID>` // // When `resources.type` equals `AWS::EMRWAL::Workspace` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:emrwal:<region>::workspace/<workspace_name>` // // When `resources.type` equals `AWS::FinSpace::Environment` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:finspace:<region>:<account_ID>:environment/<environment_ID>` // // When `resources.type` equals `AWS::Glue::Table` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:glue:<region>:<account_ID>:table/<database_name>/<table_name>` // // When `resources.type` equals `AWS::GuardDuty::Detector` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:guardduty:<region>:<account_ID>:detector/<detector_ID>` // // When `resources.type` equals `AWS::KendraRanking::ExecutionPlan` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:kendra-ranking:<region>:<account_ID>:rescore-execution-plan/<rescore_execution_plan_ID>` // // When `resources.type` equals `AWS::ManagedBlockchain::Network` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:managedblockchain:::networks/<network_name>` // // When `resources.type` equals `AWS::ManagedBlockchain::Node` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:managedblockchain:<region>:<account_ID>:nodes/<node_ID>` // // When `resources.type` equals `AWS::MedicalImaging::Datastore` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:medical-imaging:<region>:<account_ID>:datastore/<data_store_ID>` // // When `resources.type` equals `AWS::PCAConnectorAD::Connector` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:pca-connector-ad:<region>:<account_ID>:connector/<connector_ID>` // // When `resources.type` equals `AWS::SageMaker::ExperimentTrialComponent` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:sagemaker:<region>:<account_ID>:experiment-trial-component/<experiment_trial_component_name>` // // When `resources.type` equals `AWS::SageMaker::FeatureGroup` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:sagemaker:<region>:<account_ID>:feature-group/<feature_group_name>` // // When `resources.type` equals `AWS::S3::AccessPoint` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in one of the following formats. To log events on all objects in an S3 access point, we recommend that you use only the access point ARN, don’t include the object path, and use the `StartsWith` or `NotStartsWith` operators. // // - `arn:<partition>:s3:<region>:<account_ID>:accesspoint/<access_point_name>` // - `arn:<partition>:s3:<region>:<account_ID>:accesspoint/<access_point_name>/object/<object_path>` // // When `resources.type` equals `AWS::S3ObjectLambda::AccessPoint` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:s3-object-lambda:<region>:<account_ID>:accesspoint/<access_point_name>` // // When `resources.type` equals `AWS::S3Outposts::Object` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:s3-outposts:<region>:<account_ID>:<object_path>` // // When `resources.type` equals `AWS::SSMMessages::ControlChannel` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:ssmmessages:<region>:<account_ID>:control-channel/<channel_ID>` // // When resources.type equals `AWS::VerifiedPermissions::PolicyStore` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:verifiedpermissions:<region>:<account_ID>:policy-store/<policy_store_UUID>`. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedfieldselector.html#cfn-cloudtrail-eventdatastore-advancedfieldselector-field // Field *string `field:"required" json:"field" yaml:"field"` // An operator that includes events that match the last few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedfieldselector.html#cfn-cloudtrail-eventdatastore-advancedfieldselector-endswith // EndsWith *[]*string `field:"optional" json:"endsWith" yaml:"endsWith"` // An operator that includes events that match the exact value of the event record field specified as the value of `Field` . // // This is the only valid operator that you can use with the `readOnly` , `eventCategory` , and `resources.type` fields. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedfieldselector.html#cfn-cloudtrail-eventdatastore-advancedfieldselector-equals // EqualTo *[]*string `field:"optional" json:"equalTo" yaml:"equalTo"` // An operator that excludes events that match the last few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedfieldselector.html#cfn-cloudtrail-eventdatastore-advancedfieldselector-notendswith // NotEndsWith *[]*string `field:"optional" json:"notEndsWith" yaml:"notEndsWith"` // An operator that excludes events that match the exact value of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedfieldselector.html#cfn-cloudtrail-eventdatastore-advancedfieldselector-notequals // NotEquals *[]*string `field:"optional" json:"notEquals" yaml:"notEquals"` // An operator that excludes events that match the first few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedfieldselector.html#cfn-cloudtrail-eventdatastore-advancedfieldselector-notstartswith // NotStartsWith *[]*string `field:"optional" json:"notStartsWith" yaml:"notStartsWith"` // An operator that includes events that match the first few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-eventdatastore-advancedfieldselector.html#cfn-cloudtrail-eventdatastore-advancedfieldselector-startswith // StartsWith *[]*string `field:"optional" json:"startsWith" yaml:"startsWith"` }
A single selector statement in an advanced event selector.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" advancedFieldSelectorProperty := &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }
type CfnResourcePolicy ¶ added in v2.64.0
type CfnResourcePolicy interface { awscdk.CfnResource awscdk.IInspectable // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the resource-based policy. ResourceArn() *string SetResourceArn(val *string) // A JSON-formatted string for an AWS resource-based policy. ResourcePolicy() interface{} SetResourcePolicy(val interface{}) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Attaches a resource-based permission policy to a CloudTrail channel that is used for an integration with an event source outside of AWS .
For more information about resource-based policies, see [CloudTrail resource-based policy examples](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html) in the *CloudTrail User Guide* .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var resourcePolicy interface{} cfnResourcePolicy := awscdk.Aws_cloudtrail.NewCfnResourcePolicy(this, jsii.String("MyCfnResourcePolicy"), &CfnResourcePolicyProps{ ResourceArn: jsii.String("resourceArn"), ResourcePolicy: resourcePolicy, })
func NewCfnResourcePolicy ¶ added in v2.64.0
func NewCfnResourcePolicy(scope constructs.Construct, id *string, props *CfnResourcePolicyProps) CfnResourcePolicy
type CfnResourcePolicyProps ¶ added in v2.64.0
type CfnResourcePolicyProps struct { // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the resource-based policy. // // The following is the format of a resource ARN: `arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-resourcepolicy.html#cfn-cloudtrail-resourcepolicy-resourcearn // ResourceArn *string `field:"required" json:"resourceArn" yaml:"resourceArn"` // A JSON-formatted string for an AWS resource-based policy. // // The following are requirements for the resource policy: // // - Contains only one action: cloudtrail-data:PutAuditEvents // - Contains at least one statement. The policy can have a maximum of 20 statements. // - Each statement contains at least one principal. A statement can have a maximum of 50 principals. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-resourcepolicy.html#cfn-cloudtrail-resourcepolicy-resourcepolicy // ResourcePolicy interface{} `field:"required" json:"resourcePolicy" yaml:"resourcePolicy"` }
Properties for defining a `CfnResourcePolicy`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var resourcePolicy interface{} cfnResourcePolicyProps := &CfnResourcePolicyProps{ ResourceArn: jsii.String("resourceArn"), ResourcePolicy: resourcePolicy, }
type CfnTrail ¶
type CfnTrail interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // Specifies the settings for advanced event selectors. AdvancedEventSelectors() interface{} SetAdvancedEventSelectors(val interface{}) // `Ref` returns the ARN of the CloudTrail trail, such as `arn:aws:cloudtrail:us-east-2:123456789012:trail/myCloudTrail` . AttrArn() *string // `Ref` returns the ARN of the Amazon SNS topic that's associated with the CloudTrail trail, such as `arn:aws:sns:us-east-2:123456789012:mySNSTopic` . AttrSnsTopicArn() *string // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. CloudWatchLogsLogGroupArn() *string SetCloudWatchLogsLogGroupArn(val *string) // Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. CloudWatchLogsRoleArn() *string SetCloudWatchLogsRoleArn(val *string) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // Specifies whether log file validation is enabled. // // The default is false. EnableLogFileValidation() interface{} SetEnableLogFileValidation(val interface{}) // Use event selectors to further specify the management and data event settings for your trail. EventSelectors() interface{} SetEventSelectors(val interface{}) // Specifies whether the trail is publishing events from global services such as IAM to the log files. IncludeGlobalServiceEvents() interface{} SetIncludeGlobalServiceEvents(val interface{}) // A JSON string that contains the insight types you want to log on a trail. InsightSelectors() interface{} SetInsightSelectors(val interface{}) // Whether the CloudTrail trail is currently logging AWS API calls. IsLogging() interface{} SetIsLogging(val interface{}) // Specifies whether the trail applies only to the current Region or to all Regions. IsMultiRegionTrail() interface{} SetIsMultiRegionTrail(val interface{}) // Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account . IsOrganizationTrail() interface{} SetIsOrganizationTrail(val interface{}) // Specifies the AWS KMS key ID to use to encrypt the logs delivered by CloudTrail. KmsKeyId() *string SetKmsKeyId(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // Specifies the name of the Amazon S3 bucket designated for publishing log files. S3BucketName() *string SetS3BucketName(val *string) // Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. S3KeyPrefix() *string SetS3KeyPrefix(val *string) // Specifies the name of the Amazon SNS topic defined for notification of log file delivery. SnsTopicName() *string SetSnsTopicName(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // A custom set of tags (key-value pairs) for this trail. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Specifies the name of the trail. // // The name must meet the following requirements:. TrailName() *string SetTrailName(val *string) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnTrail := awscdk.Aws_cloudtrail.NewCfnTrail(this, jsii.String("MyCfnTrail"), &CfnTrailProps{ IsLogging: jsii.Boolean(false), S3BucketName: jsii.String("s3BucketName"), // the properties below are optional AdvancedEventSelectors: []interface{}{ &AdvancedEventSelectorProperty{ FieldSelectors: []interface{}{ &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }, }, // the properties below are optional Name: jsii.String("name"), }, }, CloudWatchLogsLogGroupArn: jsii.String("cloudWatchLogsLogGroupArn"), CloudWatchLogsRoleArn: jsii.String("cloudWatchLogsRoleArn"), EnableLogFileValidation: jsii.Boolean(false), EventSelectors: []interface{}{ &EventSelectorProperty{ DataResources: []interface{}{ &DataResourceProperty{ Type: jsii.String("type"), // the properties below are optional Values: []*string{ jsii.String("values"), }, }, }, ExcludeManagementEventSources: []*string{ jsii.String("excludeManagementEventSources"), }, IncludeManagementEvents: jsii.Boolean(false), ReadWriteType: jsii.String("readWriteType"), }, }, IncludeGlobalServiceEvents: jsii.Boolean(false), InsightSelectors: []interface{}{ &InsightSelectorProperty{ InsightType: jsii.String("insightType"), }, }, IsMultiRegionTrail: jsii.Boolean(false), IsOrganizationTrail: jsii.Boolean(false), KmsKeyId: jsii.String("kmsKeyId"), S3KeyPrefix: jsii.String("s3KeyPrefix"), SnsTopicName: jsii.String("snsTopicName"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TrailName: jsii.String("trailName"), })
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html
func NewCfnTrail ¶
func NewCfnTrail(scope constructs.Construct, id *string, props *CfnTrailProps) CfnTrail
type CfnTrailProps ¶
type CfnTrailProps struct { // Whether the CloudTrail trail is currently logging AWS API calls. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-islogging // IsLogging interface{} `field:"required" json:"isLogging" yaml:"isLogging"` // Specifies the name of the Amazon S3 bucket designated for publishing log files. // // See [Amazon S3 Bucket Naming Requirements](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-s3bucketname // S3BucketName *string `field:"required" json:"s3BucketName" yaml:"s3BucketName"` // Specifies the settings for advanced event selectors. // // You can add advanced event selectors, and conditions for your advanced event selectors, up to a maximum of 500 values for all conditions and selectors on a trail. You can use either `AdvancedEventSelectors` or `EventSelectors` , but not both. If you apply `AdvancedEventSelectors` to a trail, any existing `EventSelectors` are overwritten. For more information about advanced event selectors, see [Logging data events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) in the *AWS CloudTrail User Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-advancedeventselectors // AdvancedEventSelectors interface{} `field:"optional" json:"advancedEventSelectors" yaml:"advancedEventSelectors"` // Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. // // You must use a log group that exists in your account. // // Not required unless you specify `CloudWatchLogsRoleArn` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-cloudwatchlogsloggrouparn // CloudWatchLogsLogGroupArn *string `field:"optional" json:"cloudWatchLogsLogGroupArn" yaml:"cloudWatchLogsLogGroupArn"` // Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. // // You must use a role that exists in your account. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-cloudwatchlogsrolearn // CloudWatchLogsRoleArn *string `field:"optional" json:"cloudWatchLogsRoleArn" yaml:"cloudWatchLogsRoleArn"` // Specifies whether log file validation is enabled. The default is false. // // > When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-enablelogfilevalidation // EnableLogFileValidation interface{} `field:"optional" json:"enableLogFileValidation" yaml:"enableLogFileValidation"` // Use event selectors to further specify the management and data event settings for your trail. // // By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event. // // You can configure up to five event selectors for a trail. // // For more information about how to configure event selectors, see [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#aws-resource-cloudtrail-trail--examples) and [Configuring event selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-additional-cli-commands.html#configuring-event-selector-examples) in the *AWS CloudTrail User Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-eventselectors // EventSelectors interface{} `field:"optional" json:"eventSelectors" yaml:"eventSelectors"` // Specifies whether the trail is publishing events from global services such as IAM to the log files. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-includeglobalserviceevents // IncludeGlobalServiceEvents interface{} `field:"optional" json:"includeGlobalServiceEvents" yaml:"includeGlobalServiceEvents"` // A JSON string that contains the insight types you want to log on a trail. // // `ApiCallRateInsight` and `ApiErrorRateInsight` are valid Insight types. // // The `ApiCallRateInsight` Insights type analyzes write-only management API calls that are aggregated per minute against a baseline API call volume. // // The `ApiErrorRateInsight` Insights type analyzes management API calls that result in error codes. The error is shown if the API call is unsuccessful. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-insightselectors // InsightSelectors interface{} `field:"optional" json:"insightSelectors" yaml:"insightSelectors"` // Specifies whether the trail applies only to the current Region or to all Regions. // // The default is false. If the trail exists only in the current Region and this value is set to true, shadow trails (replications of the trail) will be created in the other Regions. If the trail exists in all Regions and this value is set to false, the trail will remain in the Region where it was created, and its shadow trails in other Regions will be deleted. As a best practice, consider using trails that log events in all Regions. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-ismultiregiontrail // IsMultiRegionTrail interface{} `field:"optional" json:"isMultiRegionTrail" yaml:"isMultiRegionTrail"` // Specifies whether the trail is applied to all accounts in an organization in AWS Organizations , or only for the current AWS account . // // The default is false, and cannot be true unless the call is made on behalf of an AWS account that is the management account or delegated administrator account for an organization in AWS Organizations . If the trail is not an organization trail and this is set to `true` , the trail will be created in all AWS accounts that belong to the organization. If the trail is an organization trail and this is set to `false` , the trail will remain in the current AWS account but be deleted from all member accounts in the organization. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-isorganizationtrail // IsOrganizationTrail interface{} `field:"optional" json:"isOrganizationTrail" yaml:"isOrganizationTrail"` // Specifies the AWS KMS key ID to use to encrypt the logs 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. // // CloudTrail also supports AWS KMS multi-Region keys. For more information about multi-Region keys, see [Using multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *AWS Key Management Service Developer Guide* . // // Examples: // // - alias/MyAliasName // - arn:aws:kms:us-east-2:123456789012:alias/MyAliasName // - arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 // - 12345678-1234-1234-1234-123456789012. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-kmskeyid // KmsKeyId *string `field:"optional" json:"kmsKeyId" yaml:"kmsKeyId"` // Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. // // For more information, see [Finding Your CloudTrail Log Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html) . The maximum length is 200 characters. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-s3keyprefix // S3KeyPrefix *string `field:"optional" json:"s3KeyPrefix" yaml:"s3KeyPrefix"` // Specifies the name of the Amazon SNS topic defined for notification of log file delivery. // // The maximum length is 256 characters. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-snstopicname // SnsTopicName *string `field:"optional" json:"snsTopicName" yaml:"snsTopicName"` // A custom set of tags (key-value pairs) for this trail. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // Specifies the name of the trail. The name must meet the following requirements:. // // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-) // - Start with a letter or number, and end with a letter or number // - Be between 3 and 128 characters // - Have no adjacent periods, underscores or dashes. Names like `my-_namespace` and `my--namespace` are not valid. // - Not be in IP address format (for example, 192.168.5.4) // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html#cfn-cloudtrail-trail-trailname // TrailName *string `field:"optional" json:"trailName" yaml:"trailName"` }
Properties for defining a `CfnTrail`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnTrailProps := &CfnTrailProps{ IsLogging: jsii.Boolean(false), S3BucketName: jsii.String("s3BucketName"), // the properties below are optional AdvancedEventSelectors: []interface{}{ &AdvancedEventSelectorProperty{ FieldSelectors: []interface{}{ &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }, }, // the properties below are optional Name: jsii.String("name"), }, }, CloudWatchLogsLogGroupArn: jsii.String("cloudWatchLogsLogGroupArn"), CloudWatchLogsRoleArn: jsii.String("cloudWatchLogsRoleArn"), EnableLogFileValidation: jsii.Boolean(false), EventSelectors: []interface{}{ &EventSelectorProperty{ DataResources: []interface{}{ &DataResourceProperty{ Type: jsii.String("type"), // the properties below are optional Values: []*string{ jsii.String("values"), }, }, }, ExcludeManagementEventSources: []*string{ jsii.String("excludeManagementEventSources"), }, IncludeManagementEvents: jsii.Boolean(false), ReadWriteType: jsii.String("readWriteType"), }, }, IncludeGlobalServiceEvents: jsii.Boolean(false), InsightSelectors: []interface{}{ &InsightSelectorProperty{ InsightType: jsii.String("insightType"), }, }, IsMultiRegionTrail: jsii.Boolean(false), IsOrganizationTrail: jsii.Boolean(false), KmsKeyId: jsii.String("kmsKeyId"), S3KeyPrefix: jsii.String("s3KeyPrefix"), SnsTopicName: jsii.String("snsTopicName"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, TrailName: jsii.String("trailName"), }
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudtrail-trail.html
type CfnTrail_AdvancedEventSelectorProperty ¶ added in v2.83.0
type CfnTrail_AdvancedEventSelectorProperty struct { // Contains all selector statements in an advanced event selector. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedeventselector.html#cfn-cloudtrail-trail-advancedeventselector-fieldselectors // FieldSelectors interface{} `field:"required" json:"fieldSelectors" yaml:"fieldSelectors"` // An optional, descriptive name for an advanced event selector, such as "Log data events for only two S3 buckets". // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedeventselector.html#cfn-cloudtrail-trail-advancedeventselector-name // Name *string `field:"optional" json:"name" yaml:"name"` }
Advanced event selectors let you create fine-grained selectors for the following AWS CloudTrail event record fields.
They help you control costs by logging only those events that are important to you. For more information about advanced event selectors, see [Logging data events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) in the *AWS CloudTrail User Guide* .
- `readOnly` - `eventSource` - `eventName` - `eventCategory` - `resources.type` - `resources.ARN`
You cannot apply both event selectors and advanced event selectors to a trail.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" advancedEventSelectorProperty := &AdvancedEventSelectorProperty{ FieldSelectors: []interface{}{ &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }, }, // the properties below are optional Name: jsii.String("name"), }
type CfnTrail_AdvancedFieldSelectorProperty ¶ added in v2.83.0
type CfnTrail_AdvancedFieldSelectorProperty struct { // A field in a CloudTrail event record on which to filter events to be logged. // // For event data stores for AWS Config configuration items, Audit Manager evidence, or non- AWS events, the field is used only for selecting events as filtering is not supported. // // For CloudTrail event records, supported fields include `readOnly` , `eventCategory` , `eventSource` (for management events), `eventName` , `resources.type` , and `resources.ARN` . // // For event data stores for AWS Config configuration items, Audit Manager evidence, or non- AWS events, the only supported field is `eventCategory` . // // - *`readOnly`* - Optional. Can be set to `Equals` a value of `true` or `false` . If you do not add this field, CloudTrail logs both `read` and `write` events. A value of `true` logs only `read` events. A value of `false` logs only `write` events. // - *`eventSource`* - For filtering management events only. This can be set to `NotEquals` `kms.amazonaws.com` or `NotEquals` `rdsdata.amazonaws.com` . // - *`eventName`* - Can use any operator. You can use it to filter in or filter out any data event logged to CloudTrail, such as `PutBucket` or `GetSnapshotBlock` . You can have multiple values for this field, separated by commas. // - *`eventCategory`* - This is required and must be set to `Equals` . // // - For CloudTrail event records, the value must be `Management` or `Data` . // - For AWS Config configuration items, the value must be `ConfigurationItem` . // - For Audit Manager evidence, the value must be `Evidence` . // - For non- AWS events, the value must be `ActivityAuditLog` . // - *`resources.type`* - This field is required for CloudTrail data events. `resources.type` can only use the `Equals` operator, and the value can be one of the following: // // - `AWS::DynamoDB::Table` // - `AWS::Lambda::Function` // - `AWS::S3::Object` // - `AWS::CloudTrail::Channel` // - `AWS::CodeWhisperer::Profile` // - `AWS::Cognito::IdentityPool` // - `AWS::DynamoDB::Stream` // - `AWS::EC2::Snapshot` // - `AWS::EMRWAL::Workspace` // - `AWS::FinSpace::Environment` // - `AWS::Glue::Table` // - `AWS::GuardDuty::Detector` // - `AWS::KendraRanking::ExecutionPlan` // - `AWS::ManagedBlockchain::Network` // - `AWS::ManagedBlockchain::Node` // - `AWS::MedicalImaging::Datastore` // - `AWS::PCAConnectorAD::Connector` // - `AWS::SageMaker::ExperimentTrialComponent` // - `AWS::SageMaker::FeatureGroup` // - `AWS::S3::AccessPoint` // - `AWS::S3ObjectLambda::AccessPoint` // - `AWS::S3Outposts::Object` // - `AWS::SSMMessages::ControlChannel` // - `AWS::VerifiedPermissions::PolicyStore` // // You can have only one `resources.type` field per selector. To log data events on more than one resource type, add another selector. // - *`resources.ARN`* - You can use any operator with `resources.ARN` , but if you use `Equals` or `NotEquals` , the value must exactly match the ARN of a valid resource of the type you've specified in the template as the value of resources.type. For example, if resources.type equals `AWS::S3::Object` , the ARN must be in one of the following formats. To log all data events for all objects in a specific S3 bucket, use the `StartsWith` operator, and include only the bucket ARN as the matching value. // // The trailing slash is intentional; do not exclude it. Replace the text between less than and greater than symbols (<>) with resource-specific information. // // - `arn:<partition>:s3:::<bucket_name>/` // - `arn:<partition>:s3:::<bucket_name>/<object_path>/` // // When resources.type equals `AWS::DynamoDB::Table` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:dynamodb:<region>:<account_ID>:table/<table_name>` // // When resources.type equals `AWS::Lambda::Function` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:lambda:<region>:<account_ID>:function:<function_name>` // // When resources.type equals `AWS::CloudTrail::Channel` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:cloudtrail:<region>:<account_ID>:channel/<channel_UUID>` // // When resources.type equals `AWS::CodeWhisperer::Profile` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:codewhisperer:<region>:<account_ID>:profile/<profile_ID>` // // When resources.type equals `AWS::Cognito::IdentityPool` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:cognito-identity:<region>:<account_ID>:identitypool/<identity_pool_ID>` // // When `resources.type` equals `AWS::DynamoDB::Stream` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:dynamodb:<region>:<account_ID>:table/<table_name>/stream/<date_time>` // // When `resources.type` equals `AWS::EC2::Snapshot` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:ec2:<region>::snapshot/<snapshot_ID>` // // When `resources.type` equals `AWS::EMRWAL::Workspace` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:emrwal:<region>::workspace/<workspace_name>` // // When `resources.type` equals `AWS::FinSpace::Environment` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:finspace:<region>:<account_ID>:environment/<environment_ID>` // // When `resources.type` equals `AWS::Glue::Table` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:glue:<region>:<account_ID>:table/<database_name>/<table_name>` // // When `resources.type` equals `AWS::GuardDuty::Detector` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:guardduty:<region>:<account_ID>:detector/<detector_ID>` // // When `resources.type` equals `AWS::KendraRanking::ExecutionPlan` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:kendra-ranking:<region>:<account_ID>:rescore-execution-plan/<rescore_execution_plan_ID>` // // When `resources.type` equals `AWS::ManagedBlockchain::Network` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:managedblockchain:::networks/<network_name>` // // When `resources.type` equals `AWS::ManagedBlockchain::Node` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:managedblockchain:<region>:<account_ID>:nodes/<node_ID>` // // When `resources.type` equals `AWS::MedicalImaging::Datastore` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:medical-imaging:<region>:<account_ID>:datastore/<data_store_ID>` // // When `resources.type` equals `AWS::PCAConnectorAD::Connector` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:pca-connector-ad:<region>:<account_ID>:connector/<connector_ID>` // // When `resources.type` equals `AWS::SageMaker::ExperimentTrialComponent` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:sagemaker:<region>:<account_ID>:experiment-trial-component/<experiment_trial_component_name>` // // When `resources.type` equals `AWS::SageMaker::FeatureGroup` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:sagemaker:<region>:<account_ID>:feature-group/<feature_group_name>` // // When `resources.type` equals `AWS::S3::AccessPoint` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in one of the following formats. To log events on all objects in an S3 access point, we recommend that you use only the access point ARN, don’t include the object path, and use the `StartsWith` or `NotStartsWith` operators. // // - `arn:<partition>:s3:<region>:<account_ID>:accesspoint/<access_point_name>` // - `arn:<partition>:s3:<region>:<account_ID>:accesspoint/<access_point_name>/object/<object_path>` // // When `resources.type` equals `AWS::S3ObjectLambda::AccessPoint` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:s3-object-lambda:<region>:<account_ID>:accesspoint/<access_point_name>` // // When `resources.type` equals `AWS::S3Outposts::Object` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:s3-outposts:<region>:<account_ID>:<object_path>` // // When `resources.type` equals `AWS::SSMMessages::ControlChannel` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:ssmmessages:<region>:<account_ID>:control-channel/<channel_ID>` // // When resources.type equals `AWS::VerifiedPermissions::PolicyStore` , and the operator is set to `Equals` or `NotEquals` , the ARN must be in the following format: // // - `arn:<partition>:verifiedpermissions:<region>:<account_ID>:policy-store/<policy_store_UUID>`. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedfieldselector.html#cfn-cloudtrail-trail-advancedfieldselector-field // Field *string `field:"required" json:"field" yaml:"field"` // An operator that includes events that match the last few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedfieldselector.html#cfn-cloudtrail-trail-advancedfieldselector-endswith // EndsWith *[]*string `field:"optional" json:"endsWith" yaml:"endsWith"` // An operator that includes events that match the exact value of the event record field specified as the value of `Field` . // // This is the only valid operator that you can use with the `readOnly` , `eventCategory` , and `resources.type` fields. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedfieldselector.html#cfn-cloudtrail-trail-advancedfieldselector-equals // EqualTo *[]*string `field:"optional" json:"equalTo" yaml:"equalTo"` // An operator that excludes events that match the last few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedfieldselector.html#cfn-cloudtrail-trail-advancedfieldselector-notendswith // NotEndsWith *[]*string `field:"optional" json:"notEndsWith" yaml:"notEndsWith"` // An operator that excludes events that match the exact value of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedfieldselector.html#cfn-cloudtrail-trail-advancedfieldselector-notequals // NotEquals *[]*string `field:"optional" json:"notEquals" yaml:"notEquals"` // An operator that excludes events that match the first few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedfieldselector.html#cfn-cloudtrail-trail-advancedfieldselector-notstartswith // NotStartsWith *[]*string `field:"optional" json:"notStartsWith" yaml:"notStartsWith"` // An operator that includes events that match the first few characters of the event record field specified as the value of `Field` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-advancedfieldselector.html#cfn-cloudtrail-trail-advancedfieldselector-startswith // StartsWith *[]*string `field:"optional" json:"startsWith" yaml:"startsWith"` }
A single selector statement in an advanced event selector.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" advancedFieldSelectorProperty := &AdvancedFieldSelectorProperty{ Field: jsii.String("field"), // the properties below are optional EndsWith: []*string{ jsii.String("endsWith"), }, EqualTo: []*string{ jsii.String("equalTo"), }, NotEndsWith: []*string{ jsii.String("notEndsWith"), }, NotEquals: []*string{ jsii.String("notEquals"), }, NotStartsWith: []*string{ jsii.String("notStartsWith"), }, StartsWith: []*string{ jsii.String("startsWith"), }, }
type CfnTrail_DataResourceProperty ¶
type CfnTrail_DataResourceProperty struct { // The resource type in which you want to log data events. // // You can specify the following *basic* event selector resource types: // // - `AWS::DynamoDB::Table` // - `AWS::Lambda::Function` // - `AWS::S3::Object` // // The following resource types are also available through *advanced* event selectors. Basic event selector resource types are valid in advanced event selectors, but advanced event selector resource types are not valid in basic event selectors. For more information, see [AdvancedFieldSelector](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html) . // // - `AWS::CloudTrail::Channel` // - `AWS::CodeWhisperer::Profile` // - `AWS::Cognito::IdentityPool` // - `AWS::DynamoDB::Stream` // - `AWS::EC2::Snapshot` // - `AWS::EMRWAL::Workspace` // - `AWS::FinSpace::Environment` // - `AWS::Glue::Table` // - `AWS::GuardDuty::Detector` // - `AWS::KendraRanking::ExecutionPlan` // - `AWS::ManagedBlockchain::Network` // - `AWS::ManagedBlockchain::Node` // - `AWS::MedicalImaging::Datastore` // - `AWS::PCAConnectorAD::Connector` // - `AWS::SageMaker::ExperimentTrialComponent` // - `AWS::SageMaker::FeatureGroup` // - `AWS::S3::AccessPoint` // - `AWS::S3ObjectLambda::AccessPoint` // - `AWS::S3Outposts::Object` // - `AWS::SSMMessages::ControlChannel` // - `AWS::VerifiedPermissions::PolicyStore`. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-dataresource.html#cfn-cloudtrail-trail-dataresource-type // Type *string `field:"required" json:"type" yaml:"type"` // An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects. // // - To log data events for all objects in all S3 buckets in your AWS account , specify the prefix as `arn:aws:s3` . // // > This also enables logging of data event activity performed by any user or role in your AWS account , even if that activity is performed on a bucket that belongs to another AWS account . // - To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as `arn:aws:s3:::bucket-1/` . The trail logs data events for all objects in this S3 bucket. // - To log data events for specific objects, specify the S3 bucket and object prefix such as `arn:aws:s3:::bucket-1/example-images` . The trail logs data events for objects in this S3 bucket that match the prefix. // - To log data events for all Lambda functions in your AWS account , specify the prefix as `arn:aws:lambda` . // // > This also enables logging of `Invoke` activity performed by any user or role in your AWS account , even if that activity is performed on a function that belongs to another AWS account . // - To log data events for a specific Lambda function, specify the function ARN. // // > Lambda function ARNs are exact. For example, if you specify a function ARN *arn:aws:lambda:us-west-2:111111111111:function:helloworld* , data events will only be logged for *arn:aws:lambda:us-west-2:111111111111:function:helloworld* . They will not be logged for *arn:aws:lambda:us-west-2:111111111111:function:helloworld2* . // - To log data events for all DynamoDB tables in your AWS account , specify the prefix as `arn:aws:dynamodb` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-dataresource.html#cfn-cloudtrail-trail-dataresource-values // Values *[]*string `field:"optional" json:"values" yaml:"values"` }
The Amazon S3 buckets, AWS Lambda functions, or Amazon DynamoDB tables that you specify in your event selectors for your trail to log data events.
Data events provide information about the resource operations performed on or within a resource itself. These are also known as data plane operations. You can specify up to 250 data resources for a trail.
> The total number of allowed data resources is 250. This number can be distributed between 1 and 5 event selectors, but the total cannot exceed 250 across all selectors for the trail. > > If you are using advanced event selectors, the maximum total number of values for all conditions, across all advanced event selectors for the trail, is 500.
The following example demonstrates how logging works when you configure logging of all data events for an S3 bucket named `bucket-1` . In this example, the CloudTrail user specified an empty prefix, and the option to log both `Read` and `Write` data events.
- A user uploads an image file to `bucket-1` . - The `PutObject` API operation is an Amazon S3 object-level API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified an S3 bucket with an empty prefix, events that occur on any object in that bucket are logged. The trail processes and logs the event. - A user uploads an object to an Amazon S3 bucket named `arn:aws:s3:::bucket-2` . - The `PutObject` API operation occurred for an object in an S3 bucket that the CloudTrail user didn't specify for the trail. The trail doesn’t log the event.
The following example demonstrates how logging works when you configure logging of AWS Lambda data events for a Lambda function named *MyLambdaFunction* , but not for all Lambda functions.
- A user runs a script that includes a call to the *MyLambdaFunction* function and the *MyOtherLambdaFunction* function. - The `Invoke` API operation on *MyLambdaFunction* is an Lambda API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified logging data events for *MyLambdaFunction* , any invocations of that function are logged. The trail processes and logs the event. - The `Invoke` API operation on *MyOtherLambdaFunction* is an Lambda API. Because the CloudTrail user did not specify logging data events for all Lambda functions, the `Invoke` operation for *MyOtherLambdaFunction* does not match the function specified for the trail. The trail doesn’t log the event.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" dataResourceProperty := &DataResourceProperty{ Type: jsii.String("type"), // the properties below are optional Values: []*string{ jsii.String("values"), }, }
type CfnTrail_EventSelectorProperty ¶
type CfnTrail_EventSelectorProperty struct { // CloudTrail supports data event logging for Amazon S3 objects, AWS Lambda functions, and Amazon DynamoDB tables with basic event selectors. // // You can specify up to 250 resources for an individual event selector, but the total number of data resources cannot exceed 250 across all event selectors in a trail. This limit does not apply if you configure resource logging for all data events. // // For more information, see [Data Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) and [Limits in AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) in the *AWS CloudTrail User Guide* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-eventselector.html#cfn-cloudtrail-trail-eventselector-dataresources // DataResources interface{} `field:"optional" json:"dataResources" yaml:"dataResources"` // An optional list of service event sources from which you do not want management events to be logged on your trail. // // In this release, the list can be empty (disables the filter), or it can filter out AWS Key Management Service or Amazon RDS Data API events by containing `kms.amazonaws.com` or `rdsdata.amazonaws.com` . By default, `ExcludeManagementEventSources` is empty, and AWS KMS and Amazon RDS Data API events are logged to your trail. You can exclude management event sources only in Regions that support the event source. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-eventselector.html#cfn-cloudtrail-trail-eventselector-excludemanagementeventsources // ExcludeManagementEventSources *[]*string `field:"optional" json:"excludeManagementEventSources" yaml:"excludeManagementEventSources"` // Specify if you want your event selector to include management events for your trail. // // For more information, see [Management Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html) in the *AWS CloudTrail User Guide* . // // By default, the value is `true` . // // The first copy of management events is free. You are charged for additional copies of management events that you are logging on any subsequent trail in the same Region. For more information about CloudTrail pricing, see [AWS CloudTrail Pricing](https://docs.aws.amazon.com/cloudtrail/pricing/) . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-eventselector.html#cfn-cloudtrail-trail-eventselector-includemanagementevents // IncludeManagementEvents interface{} `field:"optional" json:"includeManagementEvents" yaml:"includeManagementEvents"` // Specify if you want your trail to log read-only events, write-only events, or all. // // For example, the EC2 `GetConsoleOutput` is a read-only API operation and `RunInstances` is a write-only API operation. // // By default, the value is `All` . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-eventselector.html#cfn-cloudtrail-trail-eventselector-readwritetype // ReadWriteType *string `field:"optional" json:"readWriteType" yaml:"readWriteType"` }
Use event selectors to further specify the management and data event settings for your trail.
By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.
You can configure up to five event selectors for a trail.
You cannot apply both event selectors and advanced event selectors to a trail.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" eventSelectorProperty := &EventSelectorProperty{ DataResources: []interface{}{ &DataResourceProperty{ Type: jsii.String("type"), // the properties below are optional Values: []*string{ jsii.String("values"), }, }, }, ExcludeManagementEventSources: []*string{ jsii.String("excludeManagementEventSources"), }, IncludeManagementEvents: jsii.Boolean(false), ReadWriteType: jsii.String("readWriteType"), }
type CfnTrail_InsightSelectorProperty ¶
type CfnTrail_InsightSelectorProperty struct { // The type of Insights events to log on a trail. `ApiCallRateInsight` and `ApiErrorRateInsight` are valid Insight types. // // The `ApiCallRateInsight` Insights type analyzes write-only management API calls that are aggregated per minute against a baseline API call volume. // // The `ApiErrorRateInsight` Insights type analyzes management API calls that result in error codes. The error is shown if the API call is unsuccessful. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudtrail-trail-insightselector.html#cfn-cloudtrail-trail-insightselector-insighttype // InsightType *string `field:"optional" json:"insightType" yaml:"insightType"` }
A JSON string that contains a list of Insights types that are logged on a trail.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" insightSelectorProperty := &InsightSelectorProperty{ InsightType: jsii.String("insightType"), }
type DataResourceType ¶
type DataResourceType string
Resource type for a data event.
const ( // Data resource type for Lambda function. DataResourceType_LAMBDA_FUNCTION DataResourceType = "LAMBDA_FUNCTION" // Data resource type for S3 objects. DataResourceType_S3_OBJECT DataResourceType = "S3_OBJECT" )
type InsightType ¶ added in v2.54.0
type InsightType interface {
Value() *string
}
Util element for InsightSelector.
Example:
cloudtrail.NewTrail(this, jsii.String("Insights"), &TrailProps{ InsightTypes: []insightType{ cloudtrail.*insightType_API_CALL_RATE(), cloudtrail.*insightType_API_ERROR_RATE(), }, })
func InsightType_API_CALL_RATE ¶ added in v2.54.0
func InsightType_API_CALL_RATE() InsightType
func InsightType_API_ERROR_RATE ¶ added in v2.54.0
func InsightType_API_ERROR_RATE() InsightType
func NewInsightType ¶ added in v2.54.0
func NewInsightType(value *string) InsightType
type ManagementEventSources ¶
type ManagementEventSources string
Types of management event sources that can be excluded.
const ( // AWS Key Management Service (AWS KMS) events. ManagementEventSources_KMS ManagementEventSources = "KMS" // Data API events. ManagementEventSources_RDS_DATA_API ManagementEventSources = "RDS_DATA_API" )
type ReadWriteType ¶
type ReadWriteType string
Types of events that CloudTrail can log.
Example:
trail := cloudtrail.NewTrail(this, jsii.String("CloudTrail"), &TrailProps{ // ... ManagementEvents: cloudtrail.ReadWriteType_READ_ONLY, })
const ( // Read-only events include API operations that read your resources, but don't make changes. // // For example, read-only events include the Amazon EC2 DescribeSecurityGroups // and DescribeSubnets API operations. ReadWriteType_READ_ONLY ReadWriteType = "READ_ONLY" // Write-only events include API operations that modify (or might modify) your resources. // // For example, the Amazon EC2 RunInstances and TerminateInstances API // operations modify your instances. ReadWriteType_WRITE_ONLY ReadWriteType = "WRITE_ONLY" // All events. ReadWriteType_ALL ReadWriteType = "ALL" // No events. ReadWriteType_NONE ReadWriteType = "NONE" )
type S3EventSelector ¶
type S3EventSelector struct { // S3 bucket. Bucket awss3.IBucket `field:"required" json:"bucket" yaml:"bucket"` // Data events for objects whose key matches this prefix will be logged. // Default: - all objects. // ObjectPrefix *string `field:"optional" json:"objectPrefix" yaml:"objectPrefix"` }
Selecting an S3 bucket and an optional prefix to be logged for data events.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var bucket bucket s3EventSelector := &S3EventSelector{ Bucket: bucket, // the properties below are optional ObjectPrefix: jsii.String("objectPrefix"), }
type Trail ¶
type Trail interface { awscdk.Resource // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The CloudWatch log group to which CloudTrail events are sent. // // `undefined` if `sendToCloudWatchLogs` property is false. LogGroup() awslogs.ILogGroup // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // ARN of the CloudTrail trail i.e. arn:aws:cloudtrail:us-east-2:123456789012:trail/myCloudTrail. TrailArn() *string // ARN of the Amazon SNS topic that's associated with the CloudTrail trail, i.e. arn:aws:sns:us-east-2:123456789012:mySNSTopic. TrailSnsTopicArn() *string // When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails. // // Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group. // // This method adds an Event Selector for filtering events that match either S3 or Lambda function operations. // // Data events: These events provide insight into the resource operations performed on or within a resource. // These are also known as data plane operations. AddEventSelector(dataResourceType DataResourceType, dataResourceValues *[]*string, options *AddEventSelectorOptions) // When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails. // // Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group. // // This method adds a Lambda Data Event Selector for filtering events that match Lambda function operations. // // Data events: These events provide insight into the resource operations performed on or within a resource. // These are also known as data plane operations. AddLambdaEventSelector(handlers *[]awslambda.IFunction, options *AddEventSelectorOptions) // When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails. // // Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group. // // This method adds an S3 Data Event Selector for filtering events that match S3 operations. // // Data events: These events provide insight into the resource operations performed on or within a resource. // These are also known as data plane operations. AddS3EventSelector(s3Selector *[]*S3EventSelector, options *AddEventSelectorOptions) // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Log all Lambda data events for all lambda functions the account. // See: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html // // Default: false. // LogAllLambdaDataEvents(options *AddEventSelectorOptions) // Log all S3 data events for all objects for all buckets in the account. // See: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html // // Default: false. // LogAllS3DataEvents(options *AddEventSelectorOptions) // Returns a string representation of this construct. ToString() *string }
Cloud trail allows you to log events that happen in your AWS account For example:.
import { CloudTrail } from 'aws-cdk-lib/aws-cloudtrail'
const cloudTrail = new CloudTrail(this, 'MyTrail');.
Example:
import cloudtrail "github.com/aws/aws-cdk-go/awscdk" myKeyAlias := kms.Alias_FromAliasName(this, jsii.String("myKey"), jsii.String("alias/aws/s3")) trail := cloudtrail.NewTrail(this, jsii.String("myCloudTrail"), &TrailProps{ SendToCloudWatchLogs: jsii.Boolean(true), KmsKey: myKeyAlias, })
func NewTrail ¶
func NewTrail(scope constructs.Construct, id *string, props *TrailProps) Trail
type TrailProps ¶
type TrailProps struct { // The Amazon S3 bucket. // Default: - if not supplied a bucket will be created with all the correct permisions. // Bucket awss3.IBucket `field:"optional" json:"bucket" yaml:"bucket"` // Log Group to which CloudTrail to push logs to. // // Ignored if sendToCloudWatchLogs is set to false. // Default: - a new log group is created and used. // CloudWatchLogGroup awslogs.ILogGroup `field:"optional" json:"cloudWatchLogGroup" yaml:"cloudWatchLogGroup"` // How long to retain logs in CloudWatchLogs. // // Ignored if sendToCloudWatchLogs is false or if cloudWatchLogGroup is set. // Default: logs.RetentionDays.ONE_YEAR // CloudWatchLogsRetention awslogs.RetentionDays `field:"optional" json:"cloudWatchLogsRetention" yaml:"cloudWatchLogsRetention"` // To determine whether a log file was modified, deleted, or unchanged after CloudTrail delivered it, you can use CloudTrail log file integrity validation. // // This feature is built using industry standard algorithms: SHA-256 for hashing and SHA-256 with RSA for digital signing. // This makes it computationally infeasible to modify, delete or forge CloudTrail log files without detection. // You can use the AWS CLI to validate the files in the location where CloudTrail delivered them. // Default: true. // EnableFileValidation *bool `field:"optional" json:"enableFileValidation" yaml:"enableFileValidation"` // The AWS Key Management Service (AWS KMS) key ID that you want to use to encrypt CloudTrail logs. // Default: - No encryption. // EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"` // For most services, events are recorded in the region where the action occurred. // // For global services such as AWS Identity and Access Management (IAM), AWS STS, Amazon CloudFront, and Route 53, // events are delivered to any trail that includes global services, and are logged as occurring in US East (N. Virginia) Region. // Default: true. // IncludeGlobalServiceEvents *bool `field:"optional" json:"includeGlobalServiceEvents" yaml:"includeGlobalServiceEvents"` // A JSON string that contains the insight types you want to log on a trail. // Default: - No Value. // InsightTypes *[]InsightType `field:"optional" json:"insightTypes" yaml:"insightTypes"` // Whether or not this trail delivers log files from multiple regions to a single S3 bucket for a single account. // Default: true. // IsMultiRegionTrail *bool `field:"optional" json:"isMultiRegionTrail" yaml:"isMultiRegionTrail"` // Specifies whether the trail is applied to all accounts in an organization in AWS Organizations, or only for the current AWS account. // // If this is set to true then the current account _must_ be the management account. If it is not, then CloudFormation will throw an error. // // If this is set to true and the current account is a management account for an organization in AWS Organizations, the trail will be created in all AWS accounts that belong to the organization. // If this is set to false, the trail will remain in the current AWS account but be deleted from all member accounts in the organization. // Default: - false. // IsOrganizationTrail *bool `field:"optional" json:"isOrganizationTrail" yaml:"isOrganizationTrail"` // When an event occurs in your account, CloudTrail evaluates whether the event matches the settings for your trails. // // Only events that match your trail settings are delivered to your Amazon S3 bucket and Amazon CloudWatch Logs log group. // // This method sets the management configuration for this trail. // // Management events provide insight into management operations that are performed on resources in your AWS account. // These are also known as control plane operations. // Management events can also include non-API events that occur in your account. // For example, when a user logs in to your account, CloudTrail logs the ConsoleLogin event. // Default: ReadWriteType.ALL // ManagementEvents ReadWriteType `field:"optional" json:"managementEvents" yaml:"managementEvents"` // An Amazon S3 object key prefix that precedes the name of all log files. // Default: - No prefix. // S3KeyPrefix *string `field:"optional" json:"s3KeyPrefix" yaml:"s3KeyPrefix"` // If CloudTrail pushes logs to CloudWatch Logs in addition to S3. // // Disabled for cost out of the box. // Default: false. // SendToCloudWatchLogs *bool `field:"optional" json:"sendToCloudWatchLogs" yaml:"sendToCloudWatchLogs"` // SNS topic that is notified when new log files are published. // Default: - No notifications. // SnsTopic awssns.ITopic `field:"optional" json:"snsTopic" yaml:"snsTopic"` // The name of the trail. // // We recommend customers do not set an explicit name. // Default: - AWS CloudFormation generated name. // TrailName *string `field:"optional" json:"trailName" yaml:"trailName"` }
Properties for an AWS CloudTrail trail.
Example:
trail := cloudtrail.NewTrail(this, jsii.String("CloudTrail"), &TrailProps{ // ... ManagementEvents: cloudtrail.ReadWriteType_READ_ONLY, })
Source Files ¶
- AddEventSelectorOptions.go
- CfnChannel.go
- CfnChannelProps.go
- CfnChannel_DestinationProperty.go
- CfnChannel__checks.go
- CfnEventDataStore.go
- CfnEventDataStoreProps.go
- CfnEventDataStore_AdvancedEventSelectorProperty.go
- CfnEventDataStore_AdvancedFieldSelectorProperty.go
- CfnEventDataStore__checks.go
- CfnResourcePolicy.go
- CfnResourcePolicyProps.go
- CfnResourcePolicy__checks.go
- CfnTrail.go
- CfnTrailProps.go
- CfnTrail_AdvancedEventSelectorProperty.go
- CfnTrail_AdvancedFieldSelectorProperty.go
- CfnTrail_DataResourceProperty.go
- CfnTrail_EventSelectorProperty.go
- CfnTrail_InsightSelectorProperty.go
- CfnTrail__checks.go
- DataResourceType.go
- InsightType.go
- InsightType__checks.go
- ManagementEventSources.go
- ReadWriteType.go
- S3EventSelector.go
- Trail.go
- TrailProps.go
- Trail__checks.go
- main.go