# EventBridge Targets

### EventBridge targets

Each rule can have multiple targets and these are displayed in the AWS console when setting or editing a rule. Different rules can all point to the same target if you wish.

Targets are where the event data is forwarded to when a rule is triggered. If the rule is triggered by a schedule (i.e., without events) it can be used to invoke a target such as an AWS Lambda function.

Targets can be another event bus, an EventBridge API destination (for third-party applications), or another AWS service. To target AWS services (such as Lambda or SNS) in other regions or accounts, you must do so via an event bus in that account or region, so events should be forwarded there first. To add a target, simply choose the target type, and select the target from the options.

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F6qyysiHORiLCHneboDPG%2Fimage%2025.png?alt=media&#x26;token=e91123eb-3016-4f24-a6a8-342629a1576f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2Fvo6KX0sv2WAUcwfn45ex%2Fimage%2026.PNG?alt=media&#x26;token=b2de84ad-bc56-458f-bf24-e909aa8abc22" alt=""><figcaption></figcaption></figure>

This is where the Event Buses are, highlighted is the customer bus.

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FMArWVfGQeYOmkDiATflJ%2Fimage%2027.PNG?alt=media&#x26;token=005c4978-1031-45cf-90d7-4048b6050109" alt=""><figcaption></figcaption></figure>

This is where the rules are stored. An existing rule is already in place for the previously mentioned bus.

Creating a new rule called Instance-Tracker, This will be on the default Event Bus. I will be skipping the ‘sample events’ section and ensuring my rule captures any EC2 event of the specific type – ‘Instance state-change notification’ . The rule should also target the instance-notifier SNS Topic

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F6GOHpBzPehSFAFguS29I%2Fimage%2028.PNG?alt=media&#x26;token=d5ec302c-fbc2-4528-bd44-71703dabc124" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FnAMNI3MSOChvrU4Lffe5%2Fimage%2029.PNG?alt=media&#x26;token=33873973-7159-4e59-88be-c92b4ede27e4" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FEfi82mXzHCKexHx3ym5Y%2Fimage%2030.PNG?alt=media&#x26;token=2a17573a-b7e0-45ce-ab8b-4f498f36b703" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F17Lr3WVuLRGT668hiygx%2Fimage%2031.PNG?alt=media&#x26;token=e4f5fbf3-a505-4180-a634-3a9bbda4b797" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FTKzPa6Fg1WYW6tQ8ptqM%2Fimage%2032.PNG?alt=media&#x26;token=34bd6767-5a3b-4194-b576-61ef095417f3" alt=""><figcaption></figcaption></figure>

Rule successfully created

\
Now creating a schedule called ‘backup’ in the default schedule group.

The task should run on a recurring schedule every five minutes. With any flexible time window.\
\
It should Target the AWS Lambda Invoke API and Invoke the existing image-instance lambda function.\
\
It should use the existing role Amazon\_EventBridge\_Scheduler\_image\_instance\_lambda as the execution role.

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FWCHUXO0417Q6RDaQhiFW%2Fimage%2034.PNG?alt=media&#x26;token=e46145ab-1eb2-4c78-bf97-065655e253b7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2F8StZyfRQmGNKToJQL27k%2Fimage%2035.PNG?alt=media&#x26;token=c06da2cd-d812-4f58-b7bc-bc4074ef38ae" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FteOivinBH4sMASUdG0yx%2Fimage%2036.PNG?alt=media&#x26;token=fccc6c29-e1ab-4402-971b-069481f80ad7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FeNXmiWjRXAS4Hepg3FTd%2FiMAGE%2037.PNG?alt=media&#x26;token=e3d1e6f3-13d2-4be2-9fee-7ba9d4e39a28" alt=""><figcaption></figcaption></figure>

Noe switching to US-east-1 region. I am going to create a rule called ‘object-scans’ to capture events from S3 of type ‘object-level API call via CloudTrail’ for the PutObject operation on any bucket. The rule should target the ‘metrolio\_central\_monitoring custom bus in the eu-west-1 region, using the existing eventBridge-events role

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FyURc1r2t56w7zembpr5g%2Fimage%2038.PNG?alt=media&#x26;token=9ee556f5-c0f7-4ace-9ded-64d528905349" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FrrotQK2O5sBVGRIy4uoR%2Fimage%2039.PNG?alt=media&#x26;token=796f06e9-230a-4de8-98c5-52cbc2bc8e6e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FW5eW8pcwHQvZqogdFPNm%2Fimage%2040.PNG?alt=media&#x26;token=9a227d47-9271-44ed-993e-428bdadd8721" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2022164620-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtzurpgroDJSMn9AFVmQP%2Fuploads%2FMQ40Oq2lLHaWpxP2n8DG%2Fimage%2041.PNG?alt=media&#x26;token=720a022b-1881-4adb-9362-4d3538b21a10" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://oklencodes.gitbook.io/untitled/cloud/aws/using-different-aws-services-with-splunk/eventbridge/eventbridge-targets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
