id
stringlengths
14
16
text
stringlengths
1
2.43k
source
stringlengths
99
229
89695778f365-1
1. Choose **Specific operation\(s\)**, **Put Object**\. 1. Choose **Specific bucket\(s\) by name** and enter the name of the bucket\. 1. For **Select event bus**, choose **AWS default event bus**\. When an AWS service in your account emits an event, it always goes to your account’s default event bus\. 1. For **Targets**, do the following: 1. Choose **ECS task**\. 1. For **Cluster** and **Task Definition**, select the resources that you created\. 1. For **Launch Type**, choose `FARGATE` or `EC2`\. `FARGATE` is shown only in Regions where AWS Fargate is supported\. 1. \(Optional\) Specify a value for **Task Group**\. If the **Launch Type** is `FARGATE`, optionally specify a **Platform Version**\. Specify only the numeric portion of the platform version, such as 1\.1\.0\. 1. \(Optional\) Specify a task definition revision and task count\. If you don't specify a task definition revision, the latest is used\. 1. If your task definition uses the awsvpc network mode, you must specify subnets and security groups\. All subnets and security groups must be in the same VPC\. If you specify more than one security group or subnet, separate them with commas but not spaces\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tutorial-ecs.md
89695778f365-2
If you specify more than one security group or subnet, separate them with commas but not spaces\. For **Subnets**, specify the entire `subnet-id` value for each subnet, as in the following example\. ``` subnet-123abcd,subnet-789abcd ``` 1. Choose whether to allow the public IP address to be auto\-assigned\. 1. EventBridge can create the IAM role needed for your task to run: + To create an IAM role automatically, choose **Create a new role for this specific resource**\. + To use an IAM role that you created before, choose **Use existing role**\. This must be a role that already has sufficient permissions to invoke the build\. EventBridge doesn't grant additional permissions to the role that you select\. 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tutorial-ecs.md
21f41d1e0d06-0
When you grant permissions, you can use the IAM policy language to specify the conditions when a policy should take effect\. In a policy statement, you can optionally specify conditions that control when it is in effect\. Each condition contains one or more key\-value pairs\. Condition keys aren't case sensitive\. For example, you might want a policy to be applied only after a specific date\. If you specify multiple conditions or multiple keys in a single condition, they're evaluated using a logical AND operation\. If you specify a single condition with multiple values for one key, they're evaluated using a logical OR operation\. For permission to be granted, all conditions must be met\. You can also use placeholders when you specify conditions\. For more information, see [Policy Variables](https://docs.aws.amazon.com/IAM/latest/UserGuide/policyvariables.html) in the *IAM User Guide*\. For more information about specifying conditions in an IAM policy language, see [Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/AccessPolicyLanguage_ElementDescriptions.html#Condition) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
21f41d1e0d06-1
By default, IAM users and roles can't access the events in your account\. To consume events, a user must be authorized for the `PutRule` API action\. If you allow an IAM user or role for the `events:PutRule` action in their policy, they can create a rule that matches certain events\. You must add a target to a rule; otherwise, a rule without a target does nothing except publish a CloudWatch metric when it matches an incoming event\. Your IAM user or role must have permissions for the `events:PutTargets` action\. It's possible to limit access to the events by scoping the authorization to specific sources and types of events \(using the `events:source` and `events:detail-type` condition keys\)\. You can provide a condition in the policy statement of the IAM user or role that allows them to create a rule that only matches a specific set of sources and detail types\. Similarly, through setting conditions in your policy statements, you can decide which specific resources in your accounts can be added to a rule by an IAM user or role \(using the `events:TargetArn` condition key\)\. For example, if you turn on CloudTrail in your account and you have a CloudTrail stream, CloudTrail events are also available to the users in your account through EventBridge\. If you want your users to use EventBridge and access all the events but the CloudTrail events, you can add a deny statement on the `PutRule` API action with a condition that any rule created by that user or role can't match the CloudTrail event type\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
21f41d1e0d06-2
For CloudTrail events, you can limit the access to a specific principal that the original API call was originated from \(using the `events:detail.userIdentity.principalId` condition key\)\. For example, you can allow a user to see all the CloudTrail events, except the ones that are made by a specific IAM role in your account that you use for auditing or forensics\. | Condition Key | Key/Value Pair | Evaluation Types | | --- | --- | --- | | `events:source` | `"events:source":"source "` Where *source* is the literal string for the source field of the event such as `"aws.ec2"` and `"aws.s3"`\. To see more possible values for *source*, see the example events in [EventBridge Event Examples from Supported AWS Services](event-types.md)\. | Source, Null | | `events:detail-type` | `"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"`\. To see more possible values for *detail\-type*, see the example events in [EventBridge Event Examples from Supported AWS Services](event-types.md)\. | Detail Type, Null |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
21f41d1e0d06-3
| `events: detail.userIdentity.principalId` | `"events:detail.userIdentity.principalId":"principal-id"` Where *principal\-id* is the literal string for the **detail\.userIdentity\.principalId** field of the event with detail\-type `"AWS API Call via CloudTrail"` such as `"AROAIDPPEZS35WEXAMPLE:AssumedRoleSessionName."`\. | Principal Id, Null | | `events: detail.service` | `"events:detail.service":"service"` Where *service* is the literal string for the **detail\.service** field of the event, such as `"ABUSE"`\. | service, Null | | `events: detail.eventTypeCode` | `"events:detail.eventTypeCode":"eventTypeCode"` Where *eventTypeCode* is the literal string for the **detail\.eventTypeCode** field of the event, such as `"AWS_ABUSE_DOS_REPORT"`\. | eventTypeCode, Null | | `events:TargetArn` | `"events:TargetArn":"target-arn "` Where *target\-arn* is the ARN of the target that can be put to a rule such as `"arn:aws:lambda:*:*:function:*"`\. | ARN, Null | For example policy statements for EventBridge, see [Overview of Managing Access Permissions to Your EventBridge Resources](iam-access-control-identity-based-eventbridge.md)\. **Topics**
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
21f41d1e0d06-4
**Topics** + [Example 1: Limit Access to a Specific Source](#events-limit-access-control) + [Example 2: Define Multiple Sources That Can Be Used in an Event Pattern Individually](#events-pattern-sources) + [Example 3: Define a Source and a DetailType That Can Be Used in an Event Pattern](#events-pattern-detail-type) + [Example 4: Ensure That the Source Is Defined in the Event Pattern](#source-defined-events-pattern) + [Example 5: Define a List of Allowed Sources in an Event Pattern with Multiple Sources](#allowed-sources-events-pattern) + [Example 6: Limiting PutRule Access by detail\.service](#limit-rule-by-service) + [Example 7: Limiting PutRule Access by detail\.eventTypeCode](#limit-rule-by-type-code) + [Example 8: Ensure That AWS CloudTrail Events for API Calls from a Certain PrincipalId Are Consumed](#consume-specific-events) + [Example 9: Limiting Access to Targets](#limiting-access-to-targets)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
bac651b6ebb8-0
The following example policies can be attached to an IAM user\. Policy A allows the `PutRule` API action for all events, whereas Policy B allows `PutRule` only if the event pattern of the rule being created matches Amazon EC2 events\. **Policy A:—allow any events** ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleForAllEvents", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*" } ] } ``` **Policy B:—allow events only from Amazon EC2** ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleForAllEC2Events", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "StringEquals": { "events:source": "aws.ec2" } } } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
bac651b6ebb8-1
} } } ] } ``` `EventPattern` is a mandatory argument to `PutRule`\. Hence, if the user with Policy B calls `PutRule` with an event pattern like the following\. ``` { "source": [ "aws.ec2" ] } ``` The rule would be created because the policy allows for this specific source: that is, `"aws.ec2"`\. However, if the user with Policy B calls `PutRule` with an event pattern like the following, the rule creation would be denied because the policy doesn't allow for this specific source: that is, `"aws.s3"`\. ``` { "source": [ "aws.s3" ] } ``` Essentially, the user with Policy B is only allowed to create a rule that would match the events originating from Amazon EC2; hence, they're only allowed access to the events from Amazon EC2\. See the following table for a comparison of Policy A and Policy B\. | Event Pattern | Allowed by Policy A | Allowed by Policy B | | --- | --- | --- | | <pre>{<br /> "source": [ "aws.ec2" ]<br />}</pre> | Yes | Yes |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
bac651b6ebb8-2
| <pre>{<br /> "source": [ "aws.ec2" ]<br />}</pre> | Yes | Yes | | <pre>{<br /> "source": [ "aws.ec2", "aws.s3" ]<br />}</pre> | Yes | No \(Source aws\.s3 is not allowed\) | | <pre>{<br /> "source": [ "aws.ec2" ],<br /> "detail-type": [ "EC2 Instance State-change Notification" ]<br />}</pre> | Yes | Yes | | <pre>{<br /> "detail-type": [ "EC2 Instance State-change Notification" ]<br />}</pre> | Yes | No \(Source must be specified\) |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
bbb6f23779b4-0
The following policy allows events from Amazon EC2 or EventBridge\. In other words, it allows an IAM user or role to create a rule where the source in the `EventPattern` is specified as either `"aws.ec2"` or `"aws.ecs"`\. Not defining the source results in a "deny"\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleIfSourceIsEC2OrECS", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "StringEquals": { "events:source": [ "aws.ec2", "aws.ecs" ] } } } ] } ``` See the following table for examples of event patterns that would be allowed or denied by this policy\. | Event Pattern | Allowed by the Policy | | --- | --- | | <pre>{<br /> "source": [ "aws.ec2" ]<br />}</pre> | Yes | | <pre>{<br /> "source": [ "aws.ecs" ]<br />}</pre> | Yes |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
bbb6f23779b4-1
| <pre>{<br /> "source": [ "aws.ecs" ]<br />}</pre> | Yes | | <pre>{<br /> "source": [ "aws.s3" ]<br />}</pre> | No | | <pre>{<br /> "source": [ "aws.ec2", "aws.ecs" ]<br />}</pre> | No | | <pre>{<br /> "detail-type": [ "AWS API Call via CloudTrail" ]<br />}</pre> | No |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
201d387fd233-0
The following policy allows events only from the `aws.ec2` source with DetailType equal to `EC2 instance state change notification`\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleIfSourceIsEC2AndDetailTypeIsInstanceStateChangeNotification", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "StringEquals": { "events:source": "aws.ec2", "events:detail-type": "EC2 Instance State-change Notification" } } } ] } ``` See the following table for examples of event patterns that would be allowed or denied by this policy\. | Event Pattern | Allowed by the Policy | | --- | --- | | <pre>{<br /> "source": [ "aws.ec2" ]<br />}</pre> | No | | <pre>{<br /> "source": [ "aws.ecs" ]<br />}</pre> | No |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
201d387fd233-1
| <pre>{<br /> "source": [ "aws.ecs" ]<br />}</pre> | No | | <pre>{<br /> "source": [ "aws.ec2" ],<br /> "detail-type": [ "EC2 Instance State-change Notification" ]<br />}</pre> | Yes | | <pre>{<br /> "source": [ "aws.ec2" ],<br /> "detail-type": [ "EC2 Instance Health Failed" ]<br />}</pre> | No | | <pre>{<br /> "detail-type": [ "EC2 Instance State-change Notification" ]<br />}</pre> | No |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
9abe05d5ff73-0
The following policy allows creating rules with `EventPatterns` that must have the source field\. In other words, an IAM user or role can't create a rule with an `EventPattern` that doesn't provide a specific source\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleIfSourceIsSpecified", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "Null": { "events:source": "false" } } } ] } ``` See the following table for examples of event patterns that would be allowed or denied by this policy\. | Event Pattern | Allowed by the Policy | | --- | --- | | <pre>{<br /> "source": [ "aws.ec2" ],<br /> "detail-type": [ "EC2 Instance State-change Notification" ]<br />}</pre> | Yes | | <pre>{<br /> "source": [ "aws.ecs", "aws.ec2" ]<br />}</pre> | Yes |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
9abe05d5ff73-1
| <pre>{<br /> "detail-type": [ "EC2 Instance State-change Notification" ]<br />}</pre> | No |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
02310ed54159-0
The following policy allows creating rules with `EventPatterns` that can have multiple sources in them\. Each source listed in the event pattern must be a member of the list provided in the condition\. When using the `ForAllValues` condition, make sure that at least one of the items in the condition list is defined\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleIfSourceIsSpecifiedAndIsEitherS3OrEC2OrBoth", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "ForAllValues:StringEquals": { "events:source": [ "aws.ec2", "aws.s3" ] }, "Null": { "events:source": "false" } } } ] } ``` See the following table for examples of event patterns that would be allowed or denied by this policy\. | Event Pattern | Allowed by the Policy | | --- | --- | | <pre>{<br /> "source": [ "aws.ec2" ]<br />}</pre> | Yes |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
02310ed54159-1
| <pre>{<br /> "source": [ "aws.ec2" ]<br />}</pre> | Yes | | <pre>{<br /> "source": [ "aws.ec2", "aws.s3" ]<br />}</pre> | Yes | | <pre>{<br /> "source": [ "aws.ec2", "aws.autoscaling" ]<br />}</pre> | No | | <pre>{<br /> "detail-type": [ "EC2 Instance State-change Notification" ]<br />}</pre> | No |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
efc131782709-0
You can restrict an IAM user or role to creating rules only for events that have a certain value in the `events:details.service` field\. The value of `events:details.service` is not necessarily the name of an AWS service\. This policy condition is helpful when working with events from AWS Health that relate to security or abuse\. By using this policy condition, you can limit access to these sensitive alerts to only those users who need to see them\. For example, the following policy allows the creation of rules only for events where the value of `events:details.service` is `ABUSE`\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleEventsWithDetailServiceEC2", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "StringEquals": { "events:detail.service": "ABUSE" } } } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
180ce0825496-0
You can restrict an IAM user or role to creating rules only for events that have a certain value in the `events:details.eventTypeCode` field\. This policy condition is helpful when working with events from AWS Health that relate to security or abuse\. By using this policy condition, you can limit access to these sensitive alerts to only those users who need to see them\. For example, the following policy allows the creation of rules only for events where the value of `events:details.eventTypeCode` is `AWS_ABUSE_DOS_REPORT`\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleEventsWithDetailServiceEC2", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "StringEquals": { "events:detail.eventTypeCode": "AWS_ABUSE_DOS_REPORT" } } } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
9580b15f4c14-0
All AWS CloudTrail events have the ID of the user who made the API call \(`PrincipalId`\) in the `detail.userIdentity.principalId` path of an event\. With the help of the `events:detail.userIdentity.principalId` condition key, you can limit the access of IAM users or roles to the CloudTrail events for only those coming from a specific account\. ``` "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutRuleOnlyForCloudTrailEventsWhereUserIsASpecificIAMUser", "Effect": "Allow", "Action": "events:PutRule", "Resource": "*", "Condition": { "StringEquals": { "events:detail-type": [ "AWS API Call via CloudTrail" ], "events:detail.userIdentity.principalId": [ "AIDAJ45Q7YFFAREXAMPLE" ] } } } ] } ``` See the following table for examples of event patterns that would be allowed or denied by this policy\. | Event Pattern | Allowed by the Policy | | --- | --- |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
9580b15f4c14-1
| Event Pattern | Allowed by the Policy | | --- | --- | | <pre>{<br /> "detail-type": [ "AWS API Call via CloudTrail" ]<br />}</pre> | No | | <pre>{<br /> "detail-type": [ "AWS API Call via CloudTrail" ],<br /> "detail.userIdentity.principalId": [ "AIDAJ45Q7YFFAREXAMPLE" ]<br />}</pre> | Yes | | <pre>{<br /> "detail-type": [ "AWS API Call via CloudTrail" ],<br /> "detail.userIdentity.principalId": [ "AROAIDPPEZS35WEXAMPLE:AssumedRoleSessionName" ]<br />}</pre> | No |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
e18f31e97860-0
If an IAM user or role has `events:PutTargets` permission, they can add any target under the same account to the rules that they are allowed to access\. For example, the following policy limits adding targets to only a specific rule \(`MyRule` under account `123456789012`\)\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutTargetsOnASpecificRule", "Effect": "Allow", "Action": "events:PutTargets", "Resource": "arn:aws:events:us-east-1:123456789012:rule/MyRule" } ] } ``` To limit what target can be added to the rule, use the `events:TargetArn` condition key\. For example, you can limit targets to only Lambda functions, as in the following example\. ``` { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPutTargetsOnASpecificRuleAndOnlyLambdaFunctions", "Effect": "Allow", "Action": "events:PutTargets",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
e18f31e97860-1
"Effect": "Allow", "Action": "events:PutTargets", "Resource": "arn:aws:events:us-east-1:123456789012:rule/MyRule", "Condition": { "ArnLike": { "events:TargetArn": "arn:aws:lambda:*:*:function:*" } } } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/policy-keys-eventbridge.md
ab802ec9a78a-0
To be able to receive events from SaaS partner applications and services, you must have a partner event source offered to you from the partner\. You can then create a partner event bus and match it to the corresponding partner event source\. Partner event sources are available in the following Regions\. | Code | Name | | --- | --- | | `us-east-1` | US East \(N\. Virginia\) | | `us-east-2` | US East \(Ohio\) | | `us-west-1` | US West \(N\. California\) | | `us-west-2` | US West \(Oregon\) | | `ca-central-1` | Canada \(Central\) | | `eu-central-1` | Europe \(Frankfurt\) | | `eu-west-1` | Europe \(Ireland\) | | `eu-west-2` | Europe \(London\) | | `eu-west-3` | Europe \(Paris\) | | `eu-north-1` | Europe \(Stockholm\) | | `ap-east-1` | Asia Pacific \(Hong Kong\) | | `ap-northeast-1` | Asia Pacific \(Tokyo\) | | `ap-northeast-2` | Asia Pacific \(Seoul\) | | `ap-southeast-1` | Asia Pacific \(Singapore\) |
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-partner-event-bus.md
ab802ec9a78a-1
| `ap-northeast-2` | Asia Pacific \(Seoul\) | | `ap-southeast-1` | Asia Pacific \(Singapore\) | | `ap-southeast-2` | Asia Pacific \(Sydney\) | | `ap-south-1` | Asia Pacific \(Mumbai\) | | `sa-east-1` | South America \(São Paulo\) | **To begin to receive events from an SaaS partner** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Partner event sources**\. 1. Find the partner that you want and choose **Set up** for that partner\. 1. Choose **Copy** to copy your account ID to the clipboard\. 1. In the navigation pane, choose **Partner event sources**\. 1. Go to the partner's website and follow the instructions to create a partner event source\. Use your account ID for this\. The event source that you create will be available to only your account\. 1. Go back to the EventBridge console and choose **Partner event sources** in the navigation pane\. 1. Select the button next to the partner event source, and choose **Associate with event bus**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-partner-event-bus.md
ab802ec9a78a-2
1. Select the button next to the partner event source, and choose **Associate with event bus**\. The status of that event source changes from `Pending` to `Active`, and the name of the event bus is updated to match the partner event source name\. You can now start creating rules that trigger on events from that partner event source\. For more information, see [Creating a Rule That Triggers on an SaaS Partner Event](create-rule-partner-events.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-partner-event-bus.md
2cc0f0f53f42-0
Access to Amazon EventBridge requires credentials that AWS can use to authenticate your requests\. Those credentials must have permissions to access AWS resources, such as retrieving event data from other AWS resources\. The following sections provide details on how you can use [AWS Identity and Access Management \(IAM\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) and EventBridge to help secure your resources by controlling who can access them: + [Authentication](#authentication-eventbridge) + [Access Control](#access-control-eventbridge)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/auth-and-access-control-eventbridge.md
a0ab79f16118-0
You can access AWS as any of the following types of identities: + **AWS account root user** – When you sign up for AWS, you provide an email address and password that is associated with your account\. These are your *root credentials*, and they provide complete access to all of your AWS resources\. **Important** For security reasons, we recommend that you use the root credentials only to create an *administrator*, which is an *IAM user* with full permissions to your account\. Then you can use this administrator to create other IAM users and roles with limited permissions\. For more information, see [IAM Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) and [Creating an Admin User and Group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/auth-and-access-control-eventbridge.md
a0ab79f16118-1
+ **IAM user** – An [IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html) is an identity within your account that has specific custom permissions \(for example, permissions to send event data to a target in EventBridge\)\. You can use an IAM user name and password to sign in to secure AWS webpages such as the [AWS Management Console](https://console.aws.amazon.com/), [AWS Discussion Forums](https://forums.aws.amazon.com/), or the [AWS Support Center](https://console.aws.amazon.com/support/home#/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/auth-and-access-control-eventbridge.md
a0ab79f16118-2
In addition to a user name and password, you can also generate [access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) for each user\. You can use these keys when you access AWS services programmatically, either through [one of the several SDKs](https://aws.amazon.com/tools/) or by using the [AWS Command Line Interface \(AWS CLI\)](https://aws.amazon.com/cli/)\. The SDK and AWS CLI tools use the access keys to cryptographically sign your request\. If you don’t use the AWS tools, you must sign the request yourself\. EventBridge supports *Signature Version 4*, a protocol for authenticating inbound API requests\. For more information about authenticating requests, see [Signature Version 4 Signing Process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *Amazon Web Services General Reference*\. + **IAM role** – An [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) is another IAM identity that you can create in your account that has specific permissions\. It's similar to an *IAM user*, but it isn't associated with a specific person\. An IAM role enables you to obtain temporary access keys that can be used to access AWS services and resources\. IAM roles with temporary credentials are useful in the following situations:
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/auth-and-access-control-eventbridge.md
a0ab79f16118-3
+ **Federated user access** – Instead of creating an IAM user, you can use preexisting identities from AWS Directory Service, your enterprise user directory, or a web identity provider \(IdP\)\. These are known as *federated users*\. AWS assigns a role to a federated user when access is requested through an [identity provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html)\. For more information about federated users, see [Federated Users and Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_access-management.html#intro-access-roles) in the *IAM User Guide*\. + **Cross\-account access** – You can use an IAM role in your account to grant another account permissions to access your account’s resources\. For an example, see [Tutorial: Delegate Access Across AWS Accounts Using IAM Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/auth-and-access-control-eventbridge.md
a0ab79f16118-4
+ **AWS service access** – You can use an IAM role in your account to grant to an AWS service the permissions needed to access your account’s resources\. For example, you can create a role that allows Amazon Redshift to access an Amazon S3 bucket on your behalf and then load data stored in the bucket into an Amazon Redshift cluster\. For more information, see [Creating a Role to Delegate Permissions to an AWS Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. + **Applications running on Amazon EC2** – Instead of storing access keys in the EC2 instance for use by applications running on the instance and making AWS API requests, you can use an IAM role to manage temporary credentials for these applications\. To assign an AWS role to an EC2 instance and make it available to all of its applications, you can create an instance profile that is attached to the instance\. An instance profile contains the role and enables programs running on the EC2 instance to get temporary credentials\. For more information, see [Using Roles for Applications on Amazon EC2](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/auth-and-access-control-eventbridge.md
da1f38d2140b-0
You can have valid credentials to authenticate your requests, but unless you have permissions you cannot create or access EventBridge resources\. For example, you must have permissions to invoke AWS Lambda, Amazon Simple Notification Service \(Amazon SNS\), and Amazon Simple Queue Service \(Amazon SQS\) targets associated with your EventBridge rules\. The following sections describe how to manage permissions for EventBridge\. We recommend that you read the overview first\. + [Overview of Managing Access Permissions to Your EventBridge Resources](iam-access-control-identity-based-eventbridge.md) + [Using Identity\-Based Policies \(IAM Policies\) for EventBridge](iam-identity-based-access-control-eventbridge.md) + [Using Resource\-Based Policies for EventBridge](resource-based-policies-eventbridge.md) + [EventBridge Permissions Reference](permissions-reference-eventbridge.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/auth-and-access-control-eventbridge.md
ab2c4214b18c-0
To create a rule that triggers on an action by an AWS service that does not emit events, you can base the rule on API calls made by that service\. The API calls are recorded by AWS CloudTrail\. For more information about the API calls that you can use as triggers for rules, see [Services Supported by CloudTrail Event History](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-supported-services.html)\. Rules in EventBridge work only in the Region where they're created\. If you configure CloudTrail to track API calls in multiple Regions and you want a rule based on CloudTrail to trigger in each of those Regions, you must create a separate rule in each Region that you want to track\. All events that are delivered via CloudTrail have `AWS API Call via CloudTrail` as the value for `detail-type`\. **Note** You might accidentally create rules that lead to infinite loops, where a rule is fired repeatedly\. For example, a rule might detect that ACLs have changed on an S3 bucket and trigger software to change them to the desired state\. If you don't write the rule carefully, the subsequent change to the ACLs fires the rule again, creating an infinite loop\. To prevent this, write the rules so that the triggered actions don't refire the same rule\. For example, your rule could fire only if ACLs are found to be in a bad state instead of after any change\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-eventbridge-cloudtrail-rule.md
ab2c4214b18c-1
An infinite loop can quickly cause higher than expected charges\. We recommend that you use budgeting, which alerts you when charges exceed your specified quota\. For more information, see [Managing Your Costs with Budgets](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-managing-costs.html) in the *AWS Billing and Cost Management User Guide*\. **To create a rule that triggers on an API call via CloudTrail** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Choose **Create rule**\. 1. Enter a name and description for the rule\. A rule can't have the same name as another rule in the same Region and on the same event bus\. 1. For **Define pattern**, choose **Event pattern**\. 1. Choose **Pre\-defined pattern by service**\. 1. For **Service provider**, choose **AWS**\. 1. For **Service name**, choose the name of the service that emits the event\. 1. For **Event type**, choose **AWS API Call via CloudTrail**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-eventbridge-cloudtrail-rule.md
ab2c4214b18c-2
1. For **Event type**, choose **AWS API Call via CloudTrail**\. If you want to customize the event pattern, choose **Edit**, make your changes, and choose **Save**\. 1. For **Select event bus**, choose the event bus that you want to associate with this rule\. 1. For **Select event bus**, choose the event bus that you want to associate with this rule\. If you want this rule to trigger on matching events that come from your own AWS account, select ** AWS default event bus**\. When an AWS service in your account emits an event, it always goes to your account’s default event bus\. > 1. In the other fields in this section, enter information specific to this target type, if any is needed\. 1. For many target types, EventBridge needs permissions to send events to the target\. In these cases, EventBridge can create the IAM role needed for your rule to run: + To create an IAM role automatically, choose **Create a new role for this specific resource** + To use an IAM role that you created before, choose **Use existing role** 1. \(Optional\) Choose **Add target** to add another target for this rule\. 1. \(Optional\) Enter one or more tags for the rule\. For more information, see [Tagging Your Amazon EventBridge Resources](eventbridge-tagging.md)\. 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-eventbridge-cloudtrail-rule.md
17b137f97e3e-0
You can use EventBridge to invoke AWS Systems Manager Automation on a regular timed schedule or when specified events are detected\. This tutorial assumes that you're invoking Systems Manager Automation based on certain events\. **To create the EventBridge rule** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Choose **Create rule**\. 1. Enter a name and description for the rule\. 1. For **Define pattern**, do the following: 1. Choose **Event pattern** 1. Choose **Pre\-defined pattern by service**\. 1. For **Service provider**, choose **AWS**\. 1. For **Service Name** and **Event type**, choose the service and event type to use as the trigger\. Depending on the service and event type that you choose, you might need to specify additional options\. 1. For **Select event bus**, choose **AWS default event bus**\. When an AWS service in your account emits an event, it always goes to your account’s default event bus\. 1. For **Target**, choose **SSM Automation\.** 1. For **Document**, choose the Systems Manager document to run when the target is triggered\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/ssm-automation-as-target.md
17b137f97e3e-1
1. For **Document**, choose the Systems Manager document to run when the target is triggered\. 1. \(Optional\) To specify a certain version of the document, choose **Configure document version**\. 1. Under **Configure automation parameter\(s\)**, choose **No Parameter\(s\)** or **Constant**\. If you choose **Constant**, specify the constants to pass to the document execution\. 1. EventBridge can create the IAM role needed for your event to run: + To create an IAM role automatically, choose **Create a new role for this specific resource** + To use an IAM role that you created before, choose **Use existing role** 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/ssm-automation-as-target.md
eaccbdcf5201-0
Amazon EventBridge supports declarative filtering using event patterns\. With event pattern content filtering you can write complex rules that only trigger under very specific conditions\. For instance, you might want a rule that will trigger only when a field of the event is within a specific numeric range, if the event comes from a specific IP address, or only if a specific field does not exist in the event JSON\. Content filtering allows you to create complex rules in your event patterns, so that the rule will only call a target if your filtering conditions are met\. **Topics** + [Prefix Matching](#filtering-prefix-matching) + [Anything\-but Matching](#filtering-anything-but) + [Numeric Matching](#filtering-numeric-matching) + [IP Address Matching](#filtering-ip-matching) + [Exists Matching](#filtering-exists-matching) + [Complex Example with Multiple Matching](#filtering-complex-example)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
3253806f3be9-0
You can match on the prefix of a value in the event source\. For example, the following event pattern would match on any event where the `"time"` field started with `"2017-10-02"`\. ``` { "time": [ { "prefix": "2017-10-02" } ], } ``` The above event pattern would match on any event with that date in the time field, including `"time": "2017-10-02T18:43:48Z"`\. **Note** Prefix matching only works on string\-valued fields\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
b3866b35b9d8-0
Suppose you want to process all AWS Auto Scaling events from European regions\. The following event pattern shows how to matches on that\. ``` { "source": [ "aws.autoscaling" ], "region": [ { "prefix": "eu-" } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
1ddfee6fb373-0
Anything\-but matching matches anything except what's provided in the rule\. You can use `anything-but` with strings and numeric values, including lists that contain only strings, or only numbers\. The following shows single `anyting-but` matching, first with strings and then with numbers\. ``` { "detail": { "state": [ { "anything-but": "initializing" } ] } } { "detail": { "x-limit": [ { "anything-but": 123 } ] } } ``` The following shows `anything-but` matching with a list of strings\. ``` { "detail": { "state": [ { "anything-but": [ "stopped", "overloaded" ] } ] } } ``` The following shows `anything-but` matching with a list of numbers\. ``` { "detail": { "x-limit": [ { "anything-but": [ 100, 200, 300 ] } ] } } ``` The following shows an `anything-but` event pattern that matches on a prefix\. It will match on any event, except those that have the prefix `init` for the `"state"` field\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
1ddfee6fb373-1
``` { "detail": { "state": [ { "anything-but": { "prefix": "init" } } ] } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
ec4fae7c97a2-0
Sometimes you want to exclude rather than include a particular field value\. Suppose you want to process all events except those that are AWS CloudTrail reports of API calls\. ``` { "detail-type": [ { "anything-but": "AWS API Call via CloudTrail" } ] } ``` The `anything-but` match expression can blacklist literal strings or also a list of values\. The list must contain either all strings, or all numbers\. To see all the events except those that came from Amazon EC2 or Amazon S3, do the following\. ``` { "source": [ { "anything-but": [ "aws.ec2", "aws.s3" ] } ] } ``` The `anything-but` match expression can also use a nested match expression to exclude prefixes\. For example, the EventBridge main event bus has a large number of events coming from all AWS services\. But, you can also inject your own events using the [PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) API\. You can distinguish AWS events and process only your own because the `“source”` field in all AWS events begins with the string "`aws.`"\. ``` { "source": [ { "anything-but": { "prefix": "aws." } } ] }
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
ec4fae7c97a2-1
{ "source": [ { "anything-but": { "prefix": "aws." } } ] } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
3b91cd8e974e-0
The following shows numeric matching for an event pattern\. ``` { "detail": { "c-count": [ { "numeric": [ ">", 0, "<=", 5 ] } ], "d-count": [ { "numeric": [ "<", 10 ] } ], "x-limit": [ { "numeric": [ "=", 3.018e2 ] } ] } } ``` This pattern will only match evaluations that are true for all the fields\. Numeric matching only works with values that are JSON numbers, and is limited to values between \-1\.0e9 and \+1\.0e9 inclusive, with 15 digits of precision \(six digits to the right of the decimal point\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
f4047077c540-0
IP address matching is available for both IPv4 and IPv6 addresses\. ``` { "detail": { "source-ip": [ { "cidr": "10.0.0.0/24" } ] } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
606ed4eec24d-0
Exists matching works on the presence or absence of a field in the JSON of the event\. The following event pattern will match any event which does not have a `detail.c-count` field\. ``` { "detail": { "c-count": [ { "exists": false } ] } } ``` **Note** Exists matching **only works on leaf nodes**\. It does not work on intermediate nodes\. For example, the above pattern would match the following event\. ``` { "detail-type": [ "EC2 Instance State-change Notification" ], "resources": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-02ebd4584a2ebd341" ], "detail": { "state": [ "initializing", "running" ] } } ``` But, it would also match the following event because `c-count` is not a leaf node\. ``` { "detail-type": [ "EC2 Instance State-change Notification" ], "resources": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-02ebd4584a2ebd341" ],
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
606ed4eec24d-1
"detail": { "state": [ "initializing", "running" ] "c-count" : { "c1" : 100 } } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
8e2813db0d05-0
Suppose you wanted to make an Elasticsearch full\-text index of a bunch of events\. To do this, you select all the events that have a description field as follows\. ``` { "detail": { "description": [ { "exists": true } ], } } ``` You could also use `{ "exists": false }` to select events that do not contain a particular field\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
007a05814e79-0
You can combine multiple matching rules into a more complex event pattern\. For example, the following combines `anything-but` and `numeric` in a single event pattern\. ``` { "time": [ { "prefix": "2017-10-02" } ], "detail": { "state": [ { "anything-but": "initializing" } ], "c-count": [ { "numeric": [ ">", 0, "<=", 5 ] } ], "d-count": [ { "numeric": [ "<", 10 ] } ], "x-limit": [ { "anything-but": [ 100, 200, 300 ] } ] } } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/content-filtering-with-event-patterns.md
4a45fcfbd511-0
To use Amazon EventBridge you need an AWS account\. Your AWS account allows you to use services \(for example, Amazon EC2\) to generate events that you can view in the CloudWatch console, a web\-based interface\. In addition, you can install and configure the AWS Command Line Interface \(AWS CLI\) to use a command\-line interface\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/getting-set-up-eventbridge.md
9047b72c4a03-0
When you create an AWS account, we automatically sign up your account for all AWS services\. You pay only for the services that you use\. If you have an AWS account already, skip to the next step\. If you don't have an AWS account, use the following procedure to create one\. **To sign up for an AWS account** 1. Open [https://portal\.aws\.amazon\.com/billing/signup](https://portal.aws.amazon.com/billing/signup)\. 1. Follow the online instructions\. Part of the sign\-up procedure involves receiving a phone call and entering a verification code on the phone keypad\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/getting-set-up-eventbridge.md
36fc18ac0001-0
**To sign in to the Amazon EventBridge console** + Sign in to the AWS Management Console and open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/getting-set-up-eventbridge.md
a93f44359ee6-0
Although you can use your root user credentials to access EventBridge, we recommend that you use an AWS Identity and Access Management \(IAM\) account\. If you're using an IAM account to access EventBridge, you must have the following permissions: ``` { "Version": "2012-10-17", "Statement": [ { "Action": [ "events:*", "iam:PassRole" ], "Effect": "Allow", "Resource": "*" } ] } ``` For more information, see [Authentication](auth-and-access-control-eventbridge.md#authentication-eventbridge)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/getting-set-up-eventbridge.md
3d1ce57f7cb7-0
You can use the AWS CLI to perform EventBridge operations\. For information about how to install and configure the AWS CLI, see [Getting Set Up with the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html) in the *AWS Command Line Interface User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/getting-set-up-eventbridge.md
2b0c2bf519b1-0
You must enable regional endpoints \(the default\) in order to use EventBridge\. For more information, see [Activating and Deactivating AWS STS in an AWS Region](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/getting-set-up-eventbridge.md
5379666e1179-0
You can use the input transformer feature of EventBridge to customize the text that is taken from an event before it's input to the target of a rule\. You can define multiple JSON paths from the event and assign their outputs to different variables\. Then you can use those variables in the input template as <*variable\-name*>\. The characters < and > cannot be escaped\. If you specify a variable to match a JSON path that doesn't exist in the event, that variable isn't created and doesn't appear in the output\. In this tutorial, we extract the `instance-id` and `state` of an Amazon EC2 instance from the instance state change event\. We use the input transformer to put that data into an easy\-to\-read message that is sent to an Amazon SNS topic\. The rule is triggered when any instance changes to any state\. For example, with this rule, the following Amazon EC2 instance state\-change notification event produces the Amazon SNS message **The EC2 instance i\-1234567890abcdef0 has changed state to stopped\.** ``` { "id":"7bf73129-1428-4cd3-a780-95db273d1602", "detail-type":"EC2 Instance State-change Notification", "source":"aws.ec2", "account":"123456789012", "time":"2015-11-11T21:29:54Z",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-input-transformer-tutorial.md
5379666e1179-1
"account":"123456789012", "time":"2015-11-11T21:29:54Z", "region":"us-east-1", "resources":[ "arn:aws:ec2:us-east-1:123456789012:instance/ i-1234567890abcdef0" ], "detail":{ "instance-id":" i-1234567890abcdef0", "state":"stopped" } } ``` We achieve this by mapping the `instance` variable to the `$.detail.instance-id` JSON path from the event, and the `state` variable to the `$.detail.state` JSON path\. We then set the input template as "The EC2 instance <instance> has changed state to <state>\." **Note** For more information on the event transformer, see [Transforming Target Input](transform-input.md)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-input-transformer-tutorial.md
53d3c41969ca-0
**To customize instance state change information sent to a target using the input transformer** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Choose **Create rule**\. 1. Type a name and description for the rule\. 1. For **Define pattern**, do the following: 1. Choose **Event pattern**\. 1. Choose **Pre\-defined pattern by service**\. 1. For **Service provider**, choose **AWS**\. 1. For **Service Name**, choose **EC2**\. 1. For **Event type**, choose **EC2 Instance State\-change Notification**\. 1. Choose **Any state**, **Any instance**\. 1. For **Select event bus**, choose **AWS default event bus**\. When an AWS service in your account emits an event, it always goes to your account’s default event bus\. 1. For **Target**, choose **SNS topic**\. 1. For **Topic**, select the Amazon SNS topic that is to be notified when Amazon EC2 instances change state\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-input-transformer-tutorial.md
53d3c41969ca-1
1. For **Topic**, select the Amazon SNS topic that is to be notified when Amazon EC2 instances change state\. 1. Choose **Configure input**, **Input Transformer**\. 1. For **Input Path**, enter **\{"state" : "$\.detail\.state", "instance" : "$\.detail\.instance\-id"\}**\. 1. For **Input Template**, enter **"The EC2 instance <instance> has changed state to <state>\."** 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-input-transformer-tutorial.md
2026c4efe33c-0
Use the procedures in this section to create and delete EventBridge rules and event buses\. For tutorials on specific scenarios and specific targets, see [Amazon EventBridge Tutorials](eventbridge-tutorials.md)\. **Topics** + [Creating an EventBridge Rule That Triggers on an Event from an AWS Resource](create-eventbridge-rule.md) + [Creating a Rule That Triggers on an AWS API Call via CloudTrail](create-eventbridge-cloudtrail-rule.md) + [Creating a Rule That Triggers on a Schedule](create-eventbridge-scheduled-rule.md) + [Receiving Events from an SaaS Partner](create-partner-event-bus.md) + [Creating an Event Bus](create-event-bus.md) + [Deleting or Disabling a Rule](delete-or-disable-rule.md) **Limitations** + The targets you associate with a rule must be in the same Region as the rule\. + Some target types might not be available in every Region\. For more information, see [Regions and Endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) in the *Amazon Web Services General Reference*\. + Creating rules with built\-in targets is supported only in the AWS Management Console\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-getting-set-up.md
2026c4efe33c-1
+ Creating rules with built\-in targets is supported only in the AWS Management Console\. + If you create a rule with an encrypted Amazon SQS queue as a target, you must have the following section included in your AWS Key Management Service key policy\. It allows the event to be successfully delivered to the encrypted queue\. ``` { "Sid": "Allow CWE to use the key", "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" }, "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": "*" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-getting-set-up.md
b0011676d5d0-0
The value of each field in a pattern is an array containing one or more values, and the pattern matches if any of the values in the array match the value in the event\. If the value in the event is an array, then the pattern matches if the intersection of the pattern array and the event array is non\-empty\. For example, consider an event pattern that includes the following\. ``` "resources": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-b188560f", "arn:aws:ec2:us-east-1:111122223333:instance/i-b188560f", "arn:aws:ec2:us-east-1:444455556666:instance/i-b188560f", ] ``` This example pattern matches an event that includes the following text, because the first item in the pattern array matches the second item in the event array\. ``` "resources": [ "arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:eb56d16b-bbf0-401d-b893-d5978ed4a025:autoScalingGroupName/ASGTerminate", "arn:aws:ec2:us-east-1:123456789012:instance/i-b188560f" ]
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/arrays-in-eventbridge-event-patterns.md
b0011676d5d0-1
] ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/arrays-in-eventbridge-event-patterns.md
a4fe62dbea7b-0
You can run EventBridge rules according to a schedule\. In this tutorial, you create an automated snapshot of an existing Amazon Elastic Block Store \(Amazon EBS\) volume on a schedule\. You can choose a fixed rate to create a snapshot every few minutes or use a cron expression to specify that the snapshot is made at a specific time of day\. **Important** Creating rules with built\-in targets is supported only on the AWS Management Console\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/take-scheduled-snapshot.md
7fb0742d57b6-0
Create a rule that takes snapshots on a schedule\. You can use a rate expression or a cron expression to specify the schedule\. For more information, see [Schedule Expressions for Rules](scheduled-events.md)\. **To create a rule** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Choose **Create rule**\. 1. Enter a name and description for the rule\. 1. For **Define pattern**, do the following: 1. Choose **Schedule**\. 1. Choose **Fixed rate every** and specify the schedule interval \(for example, 5 minutes\)\. Alternatively, choose **Cron expression** and specify a cron expression \(for example, every 15 minutes Monday through Friday, starting at the current time\)\. 1. For **Select event bus**, choose **AWS default event bus**\. Scheduled rules are supported only on the default event bus\. 1. For **Target**, choose select **EC2 CreateSnapshot API call**\. 1. For **Volume ID**, enter the volume ID of the targeted Amazon EBS volume\. 1. Choose **Create a new role for this specific resource**\. The new role grants the target permissions to access resources on your behalf\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/take-scheduled-snapshot.md
7fb0742d57b6-1
1. Choose **Create a new role for this specific resource**\. The new role grants the target permissions to access resources on your behalf\. 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/take-scheduled-snapshot.md
7ff98f659f2c-0
You can verify your rule by viewing your first snapshot after it's taken\. **To test your rule** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. In the navigation pane, choose **Elastic Block Store**, **Snapshots**\. 1. Verify that the first snapshot appears in the list\. 1. \(Optional\) When you're finished, disable the rule to prevent additional snapshots from being taken\. 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Select the button next to the rule and choose **Disable**\. 1. When prompted for confirmation, choose **Disable**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/take-scheduled-snapshot.md
4bba42d486a5-0
A *tag* is a custom attribute label that you assign or that AWS assigns to an AWS resource\. Each tag has two parts: + A *tag key* \(for example, `CostCenter`, `Environment`, or `Project`\)\. Tag keys are case sensitive\. + An optional field known as a *tag value* \(for example, `111122223333` or `Production`\)\. Omitting the tag value is the same as using an empty string\. Like tag keys, tag values are case sensitive\. Tags help you do the following: + Identify and organize your AWS resources\. Many AWS services support tagging, so you can assign the same tag to resources from different services to indicate that the resources are related\. For example, you could assign the same tag to a EventBridge rule that you assign to an EC2 instance\. + Track your AWS costs\. You activate these tags on the AWS Billing and Cost Management dashboard\. AWS uses the tags to categorize your costs and deliver a monthly cost allocation report to you\. For more information, see [Use Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the [AWS Billing and Cost Management User Guide](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/)\. The following sections provide more information about tags for EventBridge\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tagging.md
f5d19776db67-0
The following resources in EventBridge support tagging: + Rules + Event buses For information about adding and managing tags, see [Managing Tags](#tagging-add-edit-delete)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tagging.md
af056cdb5b26-0
Tags consist of the `Key` and `Value` properties on a resource\. You can use the CloudWatch console, the AWS CLI, or the EventBridge API to add, edit, or delete the values for these properties\. For information about working with tags, see the following: + [TagResource](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_TagResource.html), [UntagResource](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_UntagResource.html), and [ListTagsForResource](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_ListTagsForResource.html) in the *Amazon CloudWatch Events API Reference* + [tag\-resource](https://docs.aws.amazon.com/cli/latest/reference/events/tag-resource.html), [untag\-resource](https://docs.aws.amazon.com/cli/latest/reference/events/untag-resource.html), and [list\-tags\-for\-resource](https://docs.aws.amazon.com/cli/latest/reference/events/list-tags-for-resource.html) in the *Amazon CloudWatch CLI Reference*
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tagging.md
af056cdb5b26-1
+ [Working with Tag Editor](https://docs.aws.amazon.com/ARG/latest/userguide/tag-editor.html) in the *Resource Groups User Guide*
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tagging.md
49b0fc94e507-0
The following basic naming and usage conventions apply to using tags with EventBridge resources: + Each resource can have a maximum of 50 tags\. + For each resource, each tag key must be unique, and each tag key can have only one value\. + The maximum tag key length is 128 Unicode characters in UTF\-8\. + The maximum tag value length is 256 Unicode characters in UTF\-8\. + Allowed characters are letters, numbers, spaces representable in UTF\-8, and the following characters: ***\. : \+ = @ \_ / \-*** \(hyphen\)\. + Tag keys and values are case sensitive\. As a best practice, decide on a strategy for capitalizing tags and consistently implement that strategy across all resource types\. For example, decide whether to use `Costcenter`, `costcenter`, or `CostCenter` and use the same convention for all tags\. Avoid using similar tags with inconsistent case treatment\. + The `aws:` prefix is prohibited for tags because it's reserved for AWS use\. You can't edit or delete tag keys or values with this prefix\. Tags with this prefix don't count against your tags per resource limit\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tagging.md
1897126cb4dc-0
You can create an AWS Lambda function that logs the changes in state for an Amazon EC2 instance\. You can choose to create a rule that runs the function whenever there is a state transition or a transition to one or more states that are of interest\. In this tutorial, you log the launch of any new instance\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-ec2-instance-state.md
3eed11bd7547-0
Create a Lambda function to log the state change events\. You specify this function when you create your rule\. **To create a Lambda function** 1. Open the AWS Lambda console at [https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\. 1. If you're new to Lambda, you see a welcome page\. Choose **Get Started Now**\. Otherwise, choose **Create a Lambda function**\. 1. On the **Select blueprint** page, enter `hello` for the filter and choose the **hello\-world** blueprint\. 1. On the **Configure triggers** page, choose **Next**\. 1. On the **Configure function** page, do the following: 1. Enter a name and description for the Lambda function\. For example, name the function `LogEC2InstanceStateChange`\. 1. Edit the sample code for the Lambda function\. For example: ``` 'use strict'; exports.handler = (event, context, callback) => { console.log('LogEC2InstanceStateChange'); console.log('Received event:', JSON.stringify(event, null, 2)); callback(null, 'Finished'); }; ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-ec2-instance-state.md
3eed11bd7547-1
callback(null, 'Finished'); }; ``` 1. For **Role**, choose **Choose an existing role**\. For **Existing role**, select your basic execution role\. Otherwise, create a basic execution role\. 1. Choose **Next**\. 1. On the **Review** page, choose **Create function**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-ec2-instance-state.md
b8f6def7112e-0
Create a rule to run your Lambda function whenever you launch an Amazon EC2 instance\. **To create the EventBridge rule** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Choose **Create rule**\. 1. Enter a name and description for the rule\. 1. For **Define pattern**, do the following: 1. Choose **Event pattern**\. 1. Choose **Pre\-defined pattern by service**\. 1. For **Service provider**, choose **AWS**\. 1. For **Service Name**, choose **EC2**\. 1. For **Event type**, choose **EC2 Instance State\-change Notification**\. 1. Choose **Specific state\(s\)**, **running**\. 1. By default, the rule matches any instance group in the Region\. To make the rule match a specific instance, choose **Specific instance Id\(s\)** and enter one or more instance IDs\. 1. For **Select event bus**, choose **AWS default event bus**\. When an AWS service in your account emits an event, it always goes to your account’s default event bus\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-ec2-instance-state.md
b8f6def7112e-1
1. For **Target**, choose **Lambda function**\. 1. For **Function**, select the Lambda function that you created\. 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-ec2-instance-state.md
e7130f1d273b-0
To test your rule, launch an Amazon EC2 instance\. After waiting a few minutes for the instance to launch and initialize, verify that your Lambda function was invoked\. **To test your rule by launching an instance** 1. Open the Amazon EC2 console at [https://console\.aws\.amazon\.com/ec2/](https://console.aws.amazon.com/ec2/)\. 1. Launch an instance\. For more information, see [Launch Your Instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/LaunchingAndUsingInstances.html) in the *Amazon EC2 User Guide for Linux Instances*\. 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**, choose the name of the rule that you created, and choose**Metrics for the rule**\. 1. To view the output from your Lambda function, do the following: 1. Open the CloudWatch console at [https://console\.aws\.amazon\.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/)\. 1. In the navigation pane, choose **Logs**\. 1. Choose the name of the log group for your Lambda function \(`/aws/lambda/function-name`\)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-ec2-instance-state.md
e7130f1d273b-1
1. Choose the name of the log group for your Lambda function \(`/aws/lambda/function-name`\)\. 1. Choose the name of the log stream to view the data provided by the function for the instance that you launched\. 1. \(Optional\) When you're finished, you can open the Amazon EC2 console and stop or terminate the instance that you launched\. For more information, see [Terminate Your Instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html) in the *Amazon EC2 User Guide for Linux Instances*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/log-ec2-instance-state.md
cf611e2cc0ad-0
Before you can create rules for events from SaaS partner applications and services, you must create a partner event bus and match it to that partner event source\. For more information, see [Receiving Events from an SaaS Partner](create-partner-event-bus.md)\. **To create a rule that triggers on an event from an SaaS partner** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Choose **Create rule**\. 1. Enter a name and description for the rule\. 1. For **Define pattern**, choose **Event pattern**\. 1. Choose **Pre\-defined pattern by service**\. 1. For **Service provider**, choose **Service partners**\. 1. For **Service name**, choose the name of the partner\. 1. For **Event type**, choose **All Events** or choose the type of event to use for this rule\. If you choose **All Events**, all events emitted by this partner event source will match the rule\. If you want to customize the event pattern, choose **Edit**, make your changes, and choose **Save**\. 1. For **Service event bus**, confirm that the event bus that corresponds to this partner is selected\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-rule-partner-events.md
cf611e2cc0ad-1
1. For **Service event bus**, confirm that the event bus that corresponds to this partner is selected\. 1. For **Select targets**, choose the AWS service that is to act when an event of the selected type is detected\. 1. In the other fields in this section, enter information specific to this target type, if any is needed\. 1. For many target types, EventBridge needs permissions to send events to the target\. In these cases, EventBridge can create the IAM role needed for your rule to run: + To create an IAM role automatically, choose **Create a new role for this specific resource** + To use an IAM role that you created before, choose **Use existing role** 1. \(Optional\) Choose **Add target** to add another target for this rule\. 1. \(Optional\) Enter one or more tags for the rule\. For more information, see [Tagging Your Amazon EventBridge Resources](eventbridge-tagging.md)\. 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/create-rule-partner-events.md
e057e1fdd1aa-0
In the example in this tutorial, you schedule CodeBuild to run a build every week night at 20:00 GMT\. You also pass a constant to CodeBuild to be used for this scheduled build\. **To create a rule scheduling a CodeBuild project build nightly at 20:00 GMT** 1. Open the Amazon EventBridge console at [https://console\.aws\.amazon\.com/events/](https://console.aws.amazon.com/events/)\. 1. In the navigation pane, choose **Rules**\. 1. Choose **Create rule**\. 1. Enter a name and description for the rule\. 1. For **Define pattern**, do the following: 1. Choose **Schedule**\. 1. Choose **Cron expression** and specify the following as the expression: **0 20 ? \* MON\-FRI \*\.** \(for example, 5 minutes\)\. 1. For **Select event bus**, choose **AWS default event bus**\. When an AWS service in your account emits an event, it always goes to your account’s default event bus\. 1. For **Targets**, choose **CodeBuild project**\. 1. For **Project ARN**, enter the ARN of the build project\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tutorial-codebuild.md
e057e1fdd1aa-1
1. For **Project ARN**, enter the ARN of the build project\. 1. In this tutorial, we add the optional step of passing a parameter to CodeBuild, to override the default\. This isn't required when you set CodeBuild as the target\. To pass the parameter, choose **Configure input**, **Constant \(JSON text\)**\. In the box under **Constant \(JSON text\)**, enter the following to set the timeout override to 30 minutes for these scheduled builds: **\{ "timeoutInMinutesOverride": 30 \}**\. For more information about the parameters that you can pass, see [StartBuild](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_StartBuild.html) in the *AWS CodeBuild API Reference*\. You can't pass the `projectName` parameter in this field\. Instead, specify the project using the ARN in **Project ARN**\. 1. EventBridge can create the IAM role needed for your build project to run: + To create an IAM role automatically, choose **Create a new role for this specific resource**\. + To use an IAM role that you created before, choose **Use existing role**\. This must be a role that already has sufficient permissions to invoke the build\. EventBridge doesn't grant additional permissions to the role that you select\. 1. Choose **Create**\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/eventbridge-tutorial-codebuild.md
9d2baebeb105-0
Amazon EventBridge is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in EventBridge\. CloudTrail captures API calls made by or on behalf of your AWS account\. The calls captured include calls from the CloudWatch console and code calls to the EventBridge API operations\. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for EventBridge\. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**\. Using the information collected by CloudTrail, you can determine the request that was made to EventBridge, the IP address from which the request was made, who made the request, when it was made, and additional details\. To learn more about CloudTrail, including how to configure and enable it, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\. **Topics** + [EventBridge Information in CloudTrail](#eventbridge-info-in-cloudtrail) + [Example: EventBridge Log File Entries](#understanding-eventbridge-entries-in-cloudtrail)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
72652f010fb3-0
CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in EventBridge, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing Events with CloudTrail Event History](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)\. For an ongoing record of events in your AWS account, including events for EventBridge, create a trail\. A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. For more information, see the following: + [Overview for Creating a Trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) + [CloudTrail Supported Services and Integrations](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
72652f010fb3-1
+ [Configuring Amazon SNS Notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html) + [Receiving CloudTrail Log Files from Multiple Regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail Log Files from Multiple Accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) EventBridge supports logging the following actions as events in CloudTrail log files: + [DeleteRule](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_DeleteRule.html) + [DescribeEventBus](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_DescribeRule.html) + [DescribeRule](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_DescribeRule.html) + [DisableRule](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_DisableRule.html)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
72652f010fb3-2
+ [EnableRule](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_EnableRule.html) + [ListRuleNamesByTarget](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_ListRuleNamesByTarget.html) + [ListRules](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_ListRules.html) + [ListTargetsByRule](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_ListTargetsByRule.html) + [PutPermission](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_PutPermission.html) + [PutRule](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_PutRule.html) + [PutTargets](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_PutTargets.html) + [RemoveTargets](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_RemoveTargets.html)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
72652f010fb3-3
+ [TestEventPattern](https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_TestEventPattern.html) Every event or log entry contains information about who generated the request\. The identity information helps you determine the following: + Whether the request was made with root or AWS Identity and Access Management \(IAM\) user credentials\. + Whether the request was made with temporary security credentials for a role or federated user\. + Whether the request was made by another AWS service\. For more information, see the [CloudTrail userIdentity Element](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
f855b7ca3a6e-0
A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify\. CloudTrail log files contain one or more log entries\. An event represents a single request from any source and includes information about the requested action, the date and time of the action, request parameters, and so on\. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order\. The following CloudTrail log file entry shows that a user called the EventBridge **PutRule** action\. ``` { "eventVersion":"1.03", "userIdentity":{ "type":"Root", "principalId":"123456789012", "arn":"arn:aws:iam::123456789012:root", "accountId":"123456789012", "accessKeyId":"AKIAIOSFODNN7EXAMPLE", "sessionContext":{ "attributes":{ "mfaAuthenticated":"false", "creationDate":"2015-11-17T23:56:15Z" } } }, "eventTime":"2015-11-18T00:11:28Z", "eventSource":"events.amazonaws.com",
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
f855b7ca3a6e-1
"eventSource":"events.amazonaws.com", "eventName":"PutRule", "awsRegion":"us-east-1", "sourceIPAddress":"AWS Internal", "userAgent":"AWS CloudWatch Console", "requestParameters":{ "description":"", "name":"cttest2", "state":"ENABLED", "eventPattern":"{\"source\":[\"aws.ec2\"],\"detail-type\":[\"EC2 Instance State-change Notification\"]}", "scheduleExpression":"" }, "responseElements":{ "ruleArn":"arn:aws:events:us-east-1:123456789012:rule/cttest2" }, "requestID":"e9caf887-8d88-11e5-a331-3332aa445952", "eventID":"49d14f36-6450-44a5-a501-b0fdcdfaeb98", "eventType":"AwsApiCall", "apiVersion":"2015-10-07", "recipientAccountId":"123456789012"
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
f855b7ca3a6e-2
"apiVersion":"2015-10-07", "recipientAccountId":"123456789012" } ```
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/logging-cw-api-calls-eventbridge.md
f60438e69c3a-0
Every AWS resource is owned by an AWS account, and permissions to create or access a resource are governed by permissions policies\. An account administrator can attach permissions policies to IAM identities \(that is, users, groups, and roles\), and some services \(such as AWS Lambda\) also support attaching permissions policies to resources\. **Note** An *account administrator* \(or administrator IAM user\) is a user with administrator privileges\. For more information, see [IAM Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the *IAM User Guide*\. When granting permissions, you decide who is getting the permissions, the resources they get permissions for, and the specific actions that you want to allow on those resources\. **Topics** + [EventBridge Resources and Operations](#eventbridge-arn-format) + [Understanding Resource Ownership](#understanding-resource-ownership-eventbridge) + [Managing Access to Resources](#managing-access-resources-eventbridge) + [Specifying Policy Elements: Actions, Effects, and Principals](#actions-effects-principals-eventbridge) + [Specifying Conditions in a Policy](#policy-conditions-eventbridge)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/iam-access-control-identity-based-eventbridge.md
913aae760f2a-0
In EventBridge, the primary resource is a rule\. EventBridge supports other resources that can be used with the primary resource, such as events\. These are referred to as subresources\. These resources and subresources have unique Amazon Resource Names \(ARNs\) associated with them\. For more information about ARNs, see [Amazon Resource Names \(ARN\) and AWS Service Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *Amazon Web Services General Reference*\. | Resource Type | ARN Format | | --- | --- | | Rule | `arn:aws:events:region:account:rule/[event-bus-name]/rule-name` | | Event bus | `arn:aws:events:region:account:event-bus/event-bus-name` | | All EventBridge resources | `arn:aws:events:*` | | All EventBridge resources owned by the specified account in the specified Region | `arn:aws:events:region:account:*` | **Note** Most services in AWS treat a colon \(`:`\) or a forward slash \(`/`\) as the same character in ARNs\. However, EventBridge uses an exact match in event patterns and rules\. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event that you want to match\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/iam-access-control-identity-based-eventbridge.md
913aae760f2a-1
For example, you can indicate a specific rule \(*myRule*\) in your statement using its ARN as follows\. ``` "Resource": "arn:aws:events:us-east-1:123456789012:rule/myRule" ``` You can also specify all rules that belong to a specific account by using the asterisk \(\*\) wildcard as follows\. ``` "Resource": "arn:aws:events:us-east-1:123456789012:rule/*" ``` To specify all resources or if a specific API action doesn't support ARNs, use the asterisk \(\*\) wildcard in the `Resource` element as follows\. ``` "Resource": "*" ``` Some EventBridge API actions accept multiple resources \(that is, `PutTargets`\)\. To specify multiple resources in a single statement, separate their ARNs with commas, as follows\. ``` "Resource": ["arn1", "arn2"] ``` EventBridge provides a set of operations to work with the EventBridge resources\. For a list of available operations, see [EventBridge Permissions Reference](permissions-reference-eventbridge.md)\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/iam-access-control-identity-based-eventbridge.md
0cd0fb5b24e8-0
The account owns the resources that are created in the account, regardless of who created the resources\. Specifically, the resource owner is the account of the [principal entity](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) \(that is, the account root user, an IAM user, or an IAM role\) that authenticates the resource creation request\. The following examples illustrate how this works: + If you use the root user credentials of your account to create a rule, your account is the owner of the EventBridge resource\. + If you create an IAM user in your account and grant permissions to create EventBridge resources to that user, the user can create EventBridge resources\. However, your account, which the user belongs to, owns the EventBridge resources\. + If you create an IAM role in your account with permissions to create EventBridge resources, anyone who can assume the role can create EventBridge resources\. Your account, which the role belongs to, owns the EventBridge resources\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/iam-access-control-identity-based-eventbridge.md
2e5f7d14af22-0
A *permissions policy* describes who has access to what\. The following section explains the available options for creating permissions policies\. **Note** This section discusses using IAM in the context of EventBridge\. It doesn't provide detailed information about the IAM service\. For complete IAM documentation, see [What Is IAM?](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) in the *IAM User Guide*\. For information about IAM policy syntax and descriptions, see [IAM Policy Reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) in the *IAM User Guide*\. Policies attached to an IAM identity are referred to as identity\-based policies \(IAM policies\) and policies attached to a resource are referred to as resource\-based policies\. EventBridge supports both identity\-based \(IAM policies\) and resource\-based policies\. **Topics** + [Identity\-Based Policies \(IAM Policies\)](#identity-based-policies-eventbridge) + [Resource\-Based Policies \(IAM Policies\)](#resource-based-policies-overview-eventbridge)
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/iam-access-control-identity-based-eventbridge.md
3066efddd17c-0
You can attach policies to IAM identities\. For example, you can do the following: + **Attach a permissions policy to a user or a group in your account** – To grant a user permissions to view rules in the Amazon CloudWatch console, you can attach a permissions policy to a user or group that the user belongs to\. + **Attach a permissions policy to a role \(grant cross\-account permissions\)** – You can attach an identity\-based permissions policy to an IAM role to grant cross\-account permissions\. For example, the administrator in account A can create a role to grant cross\-account permissions to another account \(for example, account B\) or an AWS service as follows: 1. Account A administrator creates an IAM role and attaches a permissions policy to the role that grants permissions on resources in account A\. 1. Account A administrator attaches a trust policy to the role identifying account B as the principal who can assume the role\. 1. Account B administrator can then delegate permissions to assume the role to any users in account B\. Doing this allows users in account B to create or access resources in account A\. The principal in the trust policy can also be an AWS service principal to grant to an AWS service the permissions needed to assume the role\. For more information about using IAM to delegate permissions, see [Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide*\.
https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-eventbridge-user-guide/doc_source/iam-access-control-identity-based-eventbridge.md