---
title: Create an Amazon EventBridge source
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > AWS Integration
---

# Create an Amazon EventBridge source{% #create-an-amazon-eventbridge-source %}

{% tab title="v1" %}

| Datadog site      | API endpoint                                                           |
| ----------------- | ---------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v1/integration/aws/event_bridge |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v1/integration/aws/event_bridge |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v1/integration/aws/event_bridge      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v1/integration/aws/event_bridge      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v1/integration/aws/event_bridge  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v1/integration/aws/event_bridge     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v1/integration/aws/event_bridge |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v1/integration/aws/event_bridge |

### Overview

**This endpoint is deprecated - use the V2 endpoints instead.** Create an Amazon EventBridge source. This endpoint requires the `manage_integrations` permission.

### Request

#### Body Data (required)

Create an Amazon EventBridge source for an AWS account with a given name and region.

{% tab title="Model" %}

| Field                | Type    | Description                                                                                                                   |
| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| account_id           | string  | Your AWS Account ID without dashes.                                                                                           |
| create_event_bus     | boolean | True if Datadog should create the event bus in addition to the event source. Requires the `events:CreateEventBus` permission. |
| event_generator_name | string  | The given part of the event source name, which is then combined with an assigned suffix to form the full name.                |
| region               | string  | The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints).                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "account_id": "123456789012",
  "create_event_bus": true,
  "event_generator_name": "app-alerts",
  "region": "us-east-1"
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
A created EventBridge source.

| Field             | Type    | Description                                                                                                   |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
| event_source_name | string  | The event source name.                                                                                        |
| has_bus           | boolean | True if the event bus was created in addition to the source.                                                  |
| region            | string  | The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). |
| status            | enum    | The event source status "created". Allowed enum values: `created`                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "event_source_name": "app-alerts-zyxw3210",
  "has_bus": true,
  "region": "us-east-1",
  "status": "created"
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Authentication Error
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v1/integration/aws/event_bridge" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "account_id": "123456789012",
  "create_event_bus": true,
  "event_generator_name": "app-alerts",
  "region": "us-east-1"
}
EOF 
                
##### 

```python
"""
Create an Amazon EventBridge source returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.aws_integration_api import AWSIntegrationApi
from datadog_api_client.v1.model.aws_event_bridge_create_request import AWSEventBridgeCreateRequest

body = AWSEventBridgeCreateRequest(
    account_id="123456789012",
    create_event_bus=True,
    event_generator_name="app-alerts",
    region="us-east-1",
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = AWSIntegrationApi(api_client)
    response = api_instance.create_aws_event_bridge_source(body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Create an Amazon EventBridge source returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new

body = DatadogAPIClient::V1::AWSEventBridgeCreateRequest.new({
  account_id: "123456789012",
  create_event_bus: true,
  event_generator_name: "app-alerts",
  region: "us-east-1",
})
p api_instance.create_aws_event_bridge_source(body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Create an Amazon EventBridge source returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	body := datadogV1.AWSEventBridgeCreateRequest{
		AccountId:          datadog.PtrString("123456789012"),
		CreateEventBus:     datadog.PtrBool(true),
		EventGeneratorName: datadog.PtrString("app-alerts"),
		Region:             datadog.PtrString("us-east-1"),
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewAWSIntegrationApi(apiClient)
	resp, r, err := api.CreateAWSEventBridgeSource(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.CreateAWSEventBridgeSource`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `AWSIntegrationApi.CreateAWSEventBridgeSource`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Create an Amazon EventBridge source returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.AwsIntegrationApi;
import com.datadog.api.client.v1.model.AWSEventBridgeCreateRequest;
import com.datadog.api.client.v1.model.AWSEventBridgeCreateResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);

    AWSEventBridgeCreateRequest body =
        new AWSEventBridgeCreateRequest()
            .accountId("123456789012")
            .createEventBus(true)
            .eventGeneratorName("app-alerts")
            .region("us-east-1");

    try {
      AWSEventBridgeCreateResponse result = apiInstance.createAWSEventBridgeSource(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AwsIntegrationApi#createAWSEventBridgeSource");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Create an Amazon EventBridge source returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV1::model::AWSEventBridgeCreateRequest;

#[tokio::main]
async fn main() {
    let body = AWSEventBridgeCreateRequest::new()
        .account_id("123456789012".to_string())
        .create_event_bus(true)
        .event_generator_name("app-alerts".to_string())
        .region("us-east-1".to_string());
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_aws_event_bridge_source(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Create an Amazon EventBridge source returns "OK" response
 */

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v1.AWSIntegrationApi(configuration);

const params: v1.AWSIntegrationApiCreateAWSEventBridgeSourceRequest = {
  body: {
    accountId: "123456789012",
    createEventBus: true,
    eventGeneratorName: "app-alerts",
    region: "us-east-1",
  },
};

apiInstance
  .createAWSEventBridgeSource(params)
  .then((data: v1.AWSEventBridgeCreateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                           |
| ----------------- | ---------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/integration/aws/event_bridge |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/integration/aws/event_bridge |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/integration/aws/event_bridge      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/integration/aws/event_bridge      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/integration/aws/event_bridge  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/integration/aws/event_bridge     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/integration/aws/event_bridge |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/integration/aws/event_bridge |

### Overview

Create an Amazon EventBridge source. This endpoint requires the `manage_integrations` permission.

### Request

#### Body Data (required)

Create an Amazon EventBridge source for an AWS account with a given name and region.

{% tab title="Model" %}

| Parent field | Field                                  | Type    | Description                                                                                                                          |
| ------------ | -------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]                 | object  | Amazon EventBridge create request data.                                                                                              |
| data         | attributes [*required*]           | object  | The EventBridge source to be created.                                                                                                |
| attributes   | account_id [*required*]           | string  | AWS Account ID.                                                                                                                      |
| attributes   | create_event_bus                       | boolean | Set to true if Datadog should create the event bus in addition to the event source. Requires the `events:CreateEventBus` permission. |
| attributes   | event_generator_name [*required*] | string  | The given part of the event source name, which is then combined with an assigned suffix to form the full name.                       |
| attributes   | region [*required*]               | string  | The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints).                        |
| data         | type [*required*]                 | enum    | Amazon EventBridge resource type. Allowed enum values: `event_bridge`                                                                |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "account_id": "123456789012",
      "create_event_bus": true,
      "event_generator_name": "app-alerts",
      "region": "us-east-1"
    },
    "type": "event_bridge"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
Amazon EventBridge source created.
{% tab title="Model" %}
Amazon EventBridge create response body.

| Parent field | Field                        | Type    | Description                                                                                                   |
| ------------ | ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object  | Amazon EventBridge create response data.                                                                      |
| data         | attributes [*required*] | object  | A created EventBridge source.                                                                                 |
| attributes   | event_source_name            | string  | The event source name.                                                                                        |
| attributes   | has_bus                      | boolean | True if the event bus was created in addition to the source.                                                  |
| attributes   | region                       | string  | The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). |
| attributes   | status                       | enum    | The event source status "created". Allowed enum values: `created`                                             |
| data         | id                           | string  | The ID of the Amazon EventBridge create response data.                                                        |
| data         | type [*required*]       | enum    | Amazon EventBridge resource type. Allowed enum values: `event_bridge`                                         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "event_source_name": "app-alerts-zyxw3210",
      "has_bus": true,
      "region": "us-east-1",
      "status": "created"
    },
    "id": "create_event_bridge",
    "type": "event_bridge"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="409" %}
Conflict
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/integration/aws/event_bridge" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "account_id": "123456789012",
      "create_event_bus": true,
      "event_generator_name": "app-alerts",
      "region": "us-east-1"
    },
    "type": "event_bridge"
  }
}
EOF 
                
##### 

```python
"""
Create an Amazon EventBridge source returns "Amazon EventBridge source created." response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi
from datadog_api_client.v2.model.aws_event_bridge_create_request import AWSEventBridgeCreateRequest
from datadog_api_client.v2.model.aws_event_bridge_create_request_attributes import AWSEventBridgeCreateRequestAttributes
from datadog_api_client.v2.model.aws_event_bridge_create_request_data import AWSEventBridgeCreateRequestData
from datadog_api_client.v2.model.aws_event_bridge_type import AWSEventBridgeType

body = AWSEventBridgeCreateRequest(
    data=AWSEventBridgeCreateRequestData(
        attributes=AWSEventBridgeCreateRequestAttributes(
            account_id="123456789012",
            create_event_bus=True,
            event_generator_name="app-alerts",
            region="us-east-1",
        ),
        type=AWSEventBridgeType.EVENT_BRIDGE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = AWSIntegrationApi(api_client)
    response = api_instance.create_aws_event_bridge_source(body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Create an Amazon EventBridge source returns "Amazon EventBridge source created." response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new

body = DatadogAPIClient::V2::AWSEventBridgeCreateRequest.new({
  data: DatadogAPIClient::V2::AWSEventBridgeCreateRequestData.new({
    attributes: DatadogAPIClient::V2::AWSEventBridgeCreateRequestAttributes.new({
      account_id: "123456789012",
      create_event_bus: true,
      event_generator_name: "app-alerts",
      region: "us-east-1",
    }),
    type: DatadogAPIClient::V2::AWSEventBridgeType::EVENT_BRIDGE,
  }),
})
p api_instance.create_aws_event_bridge_source(body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Create an Amazon EventBridge source returns "Amazon EventBridge source created." response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.AWSEventBridgeCreateRequest{
		Data: datadogV2.AWSEventBridgeCreateRequestData{
			Attributes: datadogV2.AWSEventBridgeCreateRequestAttributes{
				AccountId:          "123456789012",
				CreateEventBus:     datadog.PtrBool(true),
				EventGeneratorName: "app-alerts",
				Region:             "us-east-1",
			},
			Type: datadogV2.AWSEVENTBRIDGETYPE_EVENT_BRIDGE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewAWSIntegrationApi(apiClient)
	resp, r, err := api.CreateAWSEventBridgeSource(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AWSIntegrationApi.CreateAWSEventBridgeSource`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `AWSIntegrationApi.CreateAWSEventBridgeSource`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Create an Amazon EventBridge source returns "Amazon EventBridge source created." response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.AwsIntegrationApi;
import com.datadog.api.client.v2.model.AWSEventBridgeCreateRequest;
import com.datadog.api.client.v2.model.AWSEventBridgeCreateRequestAttributes;
import com.datadog.api.client.v2.model.AWSEventBridgeCreateRequestData;
import com.datadog.api.client.v2.model.AWSEventBridgeCreateResponse;
import com.datadog.api.client.v2.model.AWSEventBridgeType;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient);

    AWSEventBridgeCreateRequest body =
        new AWSEventBridgeCreateRequest()
            .data(
                new AWSEventBridgeCreateRequestData()
                    .attributes(
                        new AWSEventBridgeCreateRequestAttributes()
                            .accountId("123456789012")
                            .createEventBus(true)
                            .eventGeneratorName("app-alerts")
                            .region("us-east-1"))
                    .type(AWSEventBridgeType.EVENT_BRIDGE));

    try {
      AWSEventBridgeCreateResponse result = apiInstance.createAWSEventBridgeSource(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AwsIntegrationApi#createAWSEventBridgeSource");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Create an Amazon EventBridge source returns "Amazon EventBridge source
// created." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;
use datadog_api_client::datadogV2::model::AWSEventBridgeCreateRequest;
use datadog_api_client::datadogV2::model::AWSEventBridgeCreateRequestAttributes;
use datadog_api_client::datadogV2::model::AWSEventBridgeCreateRequestData;
use datadog_api_client::datadogV2::model::AWSEventBridgeType;

#[tokio::main]
async fn main() {
    let body = AWSEventBridgeCreateRequest::new(AWSEventBridgeCreateRequestData::new(
        AWSEventBridgeCreateRequestAttributes::new(
            "123456789012".to_string(),
            "app-alerts".to_string(),
            "us-east-1".to_string(),
        )
        .create_event_bus(true),
        AWSEventBridgeType::EVENT_BRIDGE,
    ));
    let configuration = datadog::Configuration::new();
    let api = AWSIntegrationAPI::with_config(configuration);
    let resp = api.create_aws_event_bridge_source(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Create an Amazon EventBridge source returns "Amazon EventBridge source created." response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.AWSIntegrationApi(configuration);

const params: v2.AWSIntegrationApiCreateAWSEventBridgeSourceRequest = {
  body: {
    data: {
      attributes: {
        accountId: "123456789012",
        createEventBus: true,
        eventGeneratorName: "app-alerts",
        region: "us-east-1",
      },
      type: "event_bridge",
    },
  },
};

apiInstance
  .createAWSEventBridgeSource(params)
  .then((data: v2.AWSEventBridgeCreateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
