Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Enable an EventBridge rule using an Amazon SDK
The following code example shows how to enable an Amazon EventBridge rule.
- .NET
-
- Amazon SDK for .NET
-
Enable a rule by its rule name.
/// <summary>
/// Enable a particular rule on an event bus.
/// </summary>
/// <param name="ruleName">The name of the rule.</param>
/// <returns>True if successful.</returns>
public async Task<bool> EnableRuleByName(string ruleName)
{
var ruleResponse = await _amazonEventBridge.EnableRuleAsync(
new EnableRuleRequest()
{
Name = ruleName
});
return ruleResponse.HttpStatusCode == HttpStatusCode.OK;
}
For a complete list of Amazon SDK developer guides and code examples, see
Using EventBridge with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.