Skip to content
v2.274.0

OnCloudTrailBucketEventOptions Struct ​

Options for the onCloudTrailPutObject method.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_events as events } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';
import * as constructs from 'constructs';

declare const construct: constructs.Construct;
declare const detail: any;
declare const ruleTarget: events.IRuleTarget;
const onCloudTrailBucketEventOptions: s3.OnCloudTrailBucketEventOptions = {
  crossStackScope: construct,
  description: 'description',
  eventPattern: {
    account: ['account'],
    detail: {
      detailKey: detail,
    },
    detailType: ['detailType'],
    id: ['id'],
    region: ['region'],
    resources: ['resources'],
    source: ['source'],
    time: ['time'],
    version: ['version'],
  },
  paths: ['paths'],
  ruleName: 'ruleName',
  target: ruleTarget,
};

Properties ​

crossStackScopeConstructcross_stack_scopeConstructcrossStackScopeConstructCrossStackScopeConstructCrossStackScopeConstruct= none (the main scope will be use…#
The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).

This helps dealing with cycles that often arise in these situations.

default

Default: none (the main scope will be used, even for cross-stack Events)

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= No description#
A description of the rule's purpose.
eventPatternEventPatternevent_patternEventPatterneventPatternEventPatternEventPatternEventPatternEventPatternEventPattern= No additional filtering based on…#
Additional restrictions for the event to route to the specified target.

The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering.

default

Default: No additional filtering based on an event pattern.

pathsstring[]pathstyping.List[str]pathsList<String>Pathsstring[]Paths*[]*string= Watch changes to all objects#
Only watch changes to these object paths.
ruleNamestringrule_namestrruleNameStringRuleNamestringRuleName*string= AWS CloudFormation generates a u…#
A name for the rule.
default

Default: AWS CloudFormation generates a unique physical ID.

targetIRuleTargettargetIRuleTargettargetIRuleTargetTargetIRuleTargetTargetIRuleTarget= No target is added to the rule. …#
The target to register for the event.
default

Default: No target is added to the rule. Use addTarget() to add a target.