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:
Log on to the API Gateway console. In the left-side navigation pane, choose OpenAPI > Backend Services.
Search for backend services of the EventBridge type and click Delete in the Actions column to delete these backend services.
If you have used the backend services to create APIs, choose OpenAPI > APIs in the left-side navigation pane and delete the APIs on the page that appears.
Log on to the RAM console. In the left-side navigation pane, choose
Identifies > Roles
. Find theAliyunServiceRoleForApigatewayPutEventsToEventBridge
role and click Delete in the Actions column.