Service-linked role for forwarding data to the cloud-native database PolarDB for MySQL

Updated at:

This topic describes the service-linked role, AliyunServiceRoleForIoTRuleenginePolarDB, for forwarding data from IoT Platform to the cloud-native database PolarDB for MySQL. It also covers how to delete this role.

Background information

For more information about service-linked roles (SLRs), see Service-linked roles.

Role and permissions

IoT Platform can forward data reported by devices to a specific data table in a PolarDB for MySQL cluster. To do this, IoT Platform requires access permissions for the cloud-native database PolarDB for MySQL.

IoT Platform supports the automatic creation of SLRs. When you configure data forwarding to the cloud-native database PolarDB for MySQL, you can create the SLR by granting authorization. For more information, see Forward data to the cloud-native database PolarDB for MySQL.

  • Role name: AliyunServiceRoleForIoTRuleenginePolarDB

  • Permission policy: AliyunServiceRolePolicyForIoTRuleenginePolarDB

  • Permission policy description: Grants IoT Platform permissions to access resources in the cloud-native database PolarDB for MySQL to configure data destinations and forward data.

  • Policy content:

    For more information about the elements of a permission policy, see Basic elements of a permission policy.

    {
    	"Version": "1",
    	"Statement": [{
    			"Action": [
    				"polardb:DescribeDBClusters",
    				"polardb:DescribeDatabases",
    				"polardb:DescribeAccounts",
    				"polardb:DescribeDBClusterAttribute",
    				"polardb:DescribeDBClusterEndpoints",
    				"polardb:ModifyDBClusterAccessWhitelist",
    				"vpc:DescribeVSwitchAttributes",
    				"vpc:DescribeVSwitches",
    				"ecs:CreateNetworkInterface",
    				"ecs:DeleteNetworkInterface",
    				"ecs:DescribeNetworkInterfaces",
    				"ecs:CreateNetworkInterfacePermission",
    				"ecs:DescribeNetworkInterfacePermissions",
    				"ecs:AttachNetworkInterface",
    				"ecs:DetachNetworkInterface",
    				"ecs:CreateSecurityGroup",
    				"ecs:DeleteSecurityGroup",
    				"ecs:DescribeSecurityGroupAttribute",
    				"ecs:AuthorizeSecurityGroupEgress",
    				"ecs:TagResources",
    				"ecs:ListTagResources"
    			],
    			"Resource": "*",
    			"Effect": "Allow"
    		},
    		{
    			"Action": "ram:DeleteServiceLinkedRole",
    			"Resource": "*",
    			"Effect": "Allow",
    			"Condition": {
    				"StringEquals": {
    					"ram:ServiceName": "ruleengine-polardb.iot.aliyuncs.com"
    				}
    			}
    		}
    	]
    }

Delete the role

You can delete the AliyunServiceRoleForIoTRuleenginePolarDB role if you no longer need it.

  1. In the IoT Platform data forwarding service, delete each data destination that is configured to forward data to the cloud-native database PolarDB for MySQL.

  2. To delete the service-linked role, see Delete a service-linked role.