OnCloudTrailBucketEventOptions Struct
Options for the onCloudTrailPutObject method.
| Source | aws-s3/lib/bucket.ts |
|---|
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,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_events as events
from aws_cdk import aws_s3 as s3
import constructs as constructs
# construct: constructs.Construct
# detail: Any
# rule_target: events.IRuleTarget
on_cloud_trail_bucket_event_options = s3.OnCloudTrailBucketEventOptions(
cross_stack_scope=construct,
description="description",
event_pattern=events.EventPattern(
account=["account"],
detail={
"detail_key": detail
},
detail_type=["detailType"],
id=["id"],
region=["region"],
resources=["resources"],
source=["source"],
time=["time"],
version=["version"]
),
paths=["paths"],
rule_name="ruleName",
target=rule_target
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.events.*;
import software.amazon.awscdk.services.s3.*;
import software.constructs.*;
Construct construct;
Object detail;
IRuleTarget ruleTarget;
OnCloudTrailBucketEventOptions onCloudTrailBucketEventOptions = OnCloudTrailBucketEventOptions.builder()
.crossStackScope(construct)
.description("description")
.eventPattern(EventPattern.builder()
.account(List.of("account"))
.detail(Map.of(
"detailKey", detail))
.detailType(List.of("detailType"))
.id(List.of("id"))
.region(List.of("region"))
.resources(List.of("resources"))
.source(List.of("source"))
.time(List.of("time"))
.version(List.of("version"))
.build())
.paths(List.of("paths"))
.ruleName("ruleName")
.target(ruleTarget)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Events;
using Amazon.CDK.AWS.S3;
using Constructs;
Construct construct;
var detail;
IRuleTarget ruleTarget;
var onCloudTrailBucketEventOptions = new OnCloudTrailBucketEventOptions {
CrossStackScope = construct,
Description = "description",
EventPattern = new EventPattern {
Account = new [] { "account" },
Detail = new Dictionary<string, object> {
{ "detailKey", detail }
},
DetailType = new [] { "detailType" },
Id = new [] { "id" },
Region = new [] { "region" },
Resources = new [] { "resources" },
Source = new [] { "source" },
Time = new [] { "time" },
Version = new [] { "version" }
},
Paths = new [] { "paths" },
RuleName = "ruleName",
Target = ruleTarget
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// 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"
import constructs "github.com/aws/constructs-go/constructs"
var construct Construct
var detail interface{}
var ruleTarget IRuleTarget
onCloudTrailBucketEventOptions := &OnCloudTrailBucketEventOptions{
CrossStackScope: construct,
Description: jsii.String("description"),
EventPattern: &EventPattern{
Account: []*string{
jsii.String("account"),
},
Detail: map[string]interface{}{
"detailKey": detail,
},
DetailType: []*string{
jsii.String("detailType"),
},
Id: []*string{
jsii.String("id"),
},
Region: []*string{
jsii.String("region"),
},
Resources: []*string{
jsii.String("resources"),
},
Source: []*string{
jsii.String("source"),
},
Time: []*string{
jsii.String("time"),
},
Version: []*string{
jsii.String("version"),
},
},
Paths: []*string{
jsii.String("paths"),
},
RuleName: jsii.String("ruleName"),
Target: ruleTarget,
}
Properties
crossStackScopeoptionalConstructcross_stack_scopeoptionalConstructcrossStackScopeoptionalConstructCrossStackScopeoptionalConstructCrossStackScopeoptionalConstruct #The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
Default: none (the main scope will be used, even for cross-stack Events)
This helps dealing with cycles that often arise in these situations.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #A description of the rule's purpose.
Default: No description
eventPatternoptionalEventPatternevent_patternoptionalEventPatterneventPatternoptionalEventPatternEventPatternoptionalEventPatternEventPatternoptionalEventPattern #Additional restrictions for the event to route to the specified target.
Default: No additional filtering based on an event pattern.
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.
pathsoptionalstring[]pathsoptionaltyping.List[str]pathsoptionalList<String>Pathsoptionalstring[]Pathsoptional*[]*string #Only watch changes to these object paths.
Default: Watch changes to all objects
ruleNameoptionalstringrule_nameoptionalstrruleNameoptionalStringRuleNameoptionalstringRuleNameoptional*string #A name for the rule.
Default: AWS CloudFormation generates a unique physical ID.
targetoptionalIRuleTargettargetoptionalIRuleTargettargetoptionalIRuleTargetTargetoptionalIRuleTargetTargetoptionalIRuleTarget #The target to register for the event.
Default: No target is added to the rule. Use addTarget() to add a target.