All Products
Search
Document Center

API Gateway-EventBridge service-linked role

Last Updated: Apr 21, 2022

This topic describes the scenario of using the API Gateway-EventBridge service-linked role AliyunServiceRoleForApigatewayPutEventsToEventBridge and how to delete the service-linked role.

Background information

The API Gateway-EventBridge service-linked role AliyunServiceRoleForApigatewayPutEventsToEventBridge is a RAM role provided by API Gateway to upload events to your event bus.

Scenario

When you create a backend service of the EventBridge type, API Gateway prompts you to create the AliyunServiceRoleForApigatewayPutEventsToEventBridge service-linked role. When you create and call APIs that use the backend service, API Gateway uses this service-linked role to obtain the permissions to upload events to your event bus.

Role description

Role name: AliyunServiceRoleForApigatewayPutEventsToEventBridge Policy attached to the role: AliyunServiceRolePolicyForApigatewayPutEventsToEventBridge Policy document:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "eventbridge:PutEvents", 
      "Resource": "*"
    }
  ]
}

Delete the service-linked role

If you want to delete the AliyunServiceRoleForApigatewayPutEventsToEventBridge service-linked role, you must first delete the backend services and APIs that depend on the service-linked role. To delete the AliyunServiceRoleForApigatewayPutEventsToEventBridge service-linked role, perform the following steps:

  1. Log on to the API Gateway console. In the left-side navigation pane, choose Open API > Backend Services.

  2. Search for backend services of the EventBridge type and click Delete in the Actions column to delete these backend services.

  3. If you have used the backend services to create APIs, choose Open API > APIs in the left-side navigation pane and delete the APIs on the page that appears.

  4. Log on to the RAM console. In the left-side navigation pane, choose Identifies > Roles. Find the AliyunServiceRoleForApigatewayPutEventsToEventBridge role and click Delete in the Actions column.