DescribeRule - Amazon EventBridge

DescribeRule

Describes the specified rule.

DescribeRule does not 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 name or ARN of 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 1600.

Pattern: (arn:aws[\w-]*:events:[a-z]{2}-[a-z]+-[\w-]+:[0-9]{12}:event-bus\/)?[/\.\-_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", "CreatedBy": "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.

CreatedBy

The account ID of the user that created the rule. If you use PutRule to put a rule on an event bus in another account, the other account is the owner of the rule, and the rule ARN includes the account ID for that account. However, the value for CreatedBy is the account ID as the account that created the rule in the other account.

Type: String

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

Description

The description of the rule.

Type: String

Length Constraints: Maximum length of 512.

EventBusName

The name of 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 Events and Event Patterns in the Amazon EventBridge User Guide .

Type: String

Length Constraints: Maximum length of 4096.

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 * * ? *)", "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 | ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS

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 does not exist.

HTTP Status Code: 400

Examples

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: