-
Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy pathHelloEventBridge.cs
37 lines (30 loc) · 1.15 KB
/
HelloEventBridge.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// snippet-start:[EventBridge.dotnetv3.HelloEventBridge]
using Amazon.EventBridge;
using Amazon.EventBridge.Model;
namespace EventBridgeActions;
public static class HelloEventBridge
{
static async Task Main(string[] args)
{
var eventBridgeClient = new AmazonEventBridgeClient();
Console.WriteLine($"Hello Amazon EventBridge! Following are some of your EventBuses:");
Console.WriteLine();
// You can use await and any of the async methods to get a response.
// Let's get the first five event buses.
var response = await eventBridgeClient.ListEventBusesAsync(
new ListEventBusesRequest()
{
Limit = 5
});
foreach (var eventBus in response.EventBuses)
{
Console.WriteLine($"\tEventBus: {eventBus.Name}");
Console.WriteLine($"\tArn: {eventBus.Arn}");
Console.WriteLine($"\tPolicy: {eventBus.Policy}");
Console.WriteLine();
}
}
}
// snippet-end:[EventBridge.dotnetv3.HelloEventBridge]