Amazon EventBridge
API Reference (API Version 2015-10-07)

DescribeRule

Describes the specified rule.

DescribeRule doesn't list the targets of a rule. To see the targets associated with a rule, use ListTargetsByRule.

Request Syntax

{ "EventBusName": "string", "Name": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

EventBusName

The event bus associated with the rule. If you omit this, the default event bus is used.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [/\.\-_A-Za-z0-9]+

Required: No

Name

The name of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [\.\-_A-Za-z0-9]+

Required: Yes

Response Syntax

{ "Arn": "string", "Description": "string", "EventBusName": "string", "EventPattern": "string", "ManagedBy": "string", "Name": "string", "RoleArn": "string", "ScheduleExpression": "string", "State": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Arn

The Amazon Resource Name (ARN) of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Description

The description of the rule.

Type: String

Length Constraints: Maximum length of 512.

EventBusName

The event bus associated with the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [/\.\-_A-Za-z0-9]+

EventPattern

The event pattern. For more information, see Event Patterns in the Amazon EventBridge User Guide.

Type: String

ManagedBy

If this is a managed rule, created by an AWS service on your behalf, this field displays the principal name of the AWS service that created the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Name

The name of the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [\.\-_A-Za-z0-9]+

RoleArn

The Amazon Resource Name (ARN) of the IAM role associated with the rule.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

ScheduleExpression

The scheduling expression: for example, "cron(0 20 * * ? *)" or "rate(5 minutes)".

Type: String

Length Constraints: Maximum length of 256.

State

Specifies whether the rule is enabled or disabled.

Type: String

Valid Values: ENABLED | DISABLED

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalException

This exception occurs due to unexpected causes.

HTTP Status Code: 500

ResourceNotFoundException

An entity that you specified doesn't exist.

HTTP Status Code: 400

Example

Describes a rule named "test"

The following is an example of a DescribeRule request and response.

Sample Request

POST / HTTP/1.1 Host: events.<region>.<domain> x-amz-Date: <Date> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Connection: Keep-Alive X-Amz-Target: AWSEvents.DescribeRule { "Name": "test" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: <RequestId> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Date: <Date> { "Name": "test", "EventPattern": "{\"source\":[\"aws.autoscaling\"],\"detail-type\":[\"EC2 Instance Launch Successful\",\"EC2 Instance Terminate Successful\",\"EC2 Instance Launch Unsuccessful\",\"EC2 Instance Terminate Unsuccessful\"]}", "State": "ENABLED", "Arn": "arn:aws:events:us-east-1:123456789012:rule/test", "Description": "Test rule for Auto Scaling events" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: