mirror of
https://github.com/floci-io/floci.git
synced 2026-12-03 18:18:02 -05:00
Under enforcement a PutRule scoped by events:source was refused for every event pattern, and a PutTargets scoped by events:TargetArn for every target, as #8320 reports: the request condition key table never filled either key, so a Null or ForAllValues condition on them never saw a value. The table's reader is generic, but which member carries a key comes from SERVICES in regen_request_condition_keys.py, and EventBridge was not there. Neither botocore nor the Service Reference says where a request carries these keys: botocore models EventPattern as a string ("The event pattern"). EventBridge's user guide says it, in its table of condition keys: events:source is "the literal string for the source field of the event", with events:detail-type, events:detail.service, events:detail.eventTypeCode and events:detail.userIdentity.principalId the same for their fields, which a rule's event pattern gives ("EventPattern is a mandatory argument to PutRule"), and events:TargetArn is "the ARN of the target for the rule". A vendored source, tools/aws/sources/eventbridge-condition-keys.json, written by tools/aws/fetch_eventbridge_conditions.py from that page, gives each key its member, and the generator reads it for events (CONDITION_SOURCES), each key in the one operation the page names: PutEvents, CreateEventSource and UpdateEventSource take events:source too, which the page does not describe, so they are not read there. --verify checks the file against the page. The table writes a field of a JSON document a string member holds after #: EventPattern#source.* is each literal string of the pattern's source, read by one generic step of the JSON reader. A pattern leaving a field out names nothing, so ForAllValues allows it and a Null check refuses it, as the page's examples show. The fields are read at the pattern's top level, where every example on the page gives them, so a $or branch's names nothing, and a matcher such as {"prefix": "aws."} is no literal string and names nothing. events:TargetArn reads each target's own Arn, not its dead-letter queue's. Closes #8320.
76 lines
3.7 KiB
JSON
76 lines
3.7 KiB
JSON
{
|
|
"_source": {
|
|
"page": "https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-use-conditions.html",
|
|
"fetcher": "tools/aws/fetch_eventbridge_conditions.py",
|
|
"retrieved": "2026-11-28",
|
|
"note": "Each EventBridge key whose row of the page's table of condition keys names a field of the event, read from PutRule's EventPattern (field), or the ARN of the target, read from PutTargets' Targets[].Arn, with the row and the page's sentences saying so, copied as they stand."
|
|
},
|
|
"keys": [
|
|
{
|
|
"key": "events:detail-type",
|
|
"operation": "PutRule",
|
|
"member": "EventPattern",
|
|
"field": "detail-type",
|
|
"row": "\"events:detail-type\":\" detail-type \" Where detail-type is the literal string for the detail-type field of the event such as \"AWS API Call via CloudTrail\" and \"EC2 Instance State-change Notification\".",
|
|
"says": [
|
|
"PutRule only if the event pattern of the rule being created matches Amazon EC2 events.",
|
|
"EventPattern is a mandatory argument to PutRule."
|
|
]
|
|
},
|
|
{
|
|
"key": "events:detail.eventTypeCode",
|
|
"operation": "PutRule",
|
|
"member": "EventPattern",
|
|
"field": "detail.eventTypeCode",
|
|
"row": "\"events:detail.eventTypeCode\":\" eventTypeCode \" For eventTypeCode, use the literal string for the detail.eventTypeCode field of the event, such as \"AWS_ABUSE_DOS_REPORT\".",
|
|
"says": [
|
|
"PutRule only if the event pattern of the rule being created matches Amazon EC2 events.",
|
|
"EventPattern is a mandatory argument to PutRule."
|
|
]
|
|
},
|
|
{
|
|
"key": "events:detail.service",
|
|
"operation": "PutRule",
|
|
"member": "EventPattern",
|
|
"field": "detail.service",
|
|
"row": "\"events:detail.service\":\" service \" For service, use the literal string for the detail.service field of the event, such as \"ABUSE\".",
|
|
"says": [
|
|
"PutRule only if the event pattern of the rule being created matches Amazon EC2 events.",
|
|
"EventPattern is a mandatory argument to PutRule."
|
|
]
|
|
},
|
|
{
|
|
"key": "events:detail.userIdentity.principalId",
|
|
"operation": "PutRule",
|
|
"member": "EventPattern",
|
|
"field": "detail.userIdentity.principalId",
|
|
"row": "\"events:detail.userIdentity.principalId\":\" principal-id \" For principal-id, use the literal string for the detail.userIdentity.principalId field of the event with detail-type \"AWS API Call via CloudTrail\" such as \"AROAIDPPEZS35WEXAMPLE:AssumedRoleSessionName.\".",
|
|
"says": [
|
|
"PutRule only if the event pattern of the rule being created matches Amazon EC2 events.",
|
|
"EventPattern is a mandatory argument to PutRule."
|
|
]
|
|
},
|
|
{
|
|
"key": "events:source",
|
|
"operation": "PutRule",
|
|
"member": "EventPattern",
|
|
"field": "source",
|
|
"row": "\"events:source\":\" source \" Use source for the literal string for the source field of the event such as \"aws.ec2\" or \"aws.s3\". For more possible values for source, see the example events in Events from AWS services.",
|
|
"says": [
|
|
"PutRule only if the event pattern of the rule being created matches Amazon EC2 events.",
|
|
"EventPattern is a mandatory argument to PutRule."
|
|
]
|
|
},
|
|
{
|
|
"key": "events:TargetArn",
|
|
"operation": "PutTargets",
|
|
"member": "Targets.*.Arn",
|
|
"row": "\"events:TargetArn\":\" target-arn \" For target-arn, use the ARN of the target for the rule, for example \"arn:aws:lambda:*:*:function:*\".",
|
|
"says": [
|
|
"permissions for the events:PutTargets action because, if you want the rule to do more than publish a CloudWatch metric, you must also add a target to a rule.",
|
|
"To grant access to a specific resource, use the events:TargetArn condition key."
|
|
]
|
|
}
|
|
]
|
|
}
|