package.yaml file, and you can control the application's permission scope.package.yaml file through role.policy. The syntax is consistent with the CAM permission policy. For details, see CAM Permission Policy Syntax Structure. The following is an example:args:- name: app_coslabel: select bucketwidget: cos-bucket-selectrole:policy:version: "2.0"statement:# Permission 1: support LICENSE verification- action:- cloudapp:VerifyLicenseresource: "*"effect: allow# Permission 2: Support restarting CVM under the application instance tag- action:- cvm:RebootInstancesresource: "*"condition:"for_any_value:string_equal":"qcs:tag":- "CloudappId&${var.cloudapp_id}"effect: "allow"# Permission 3: Support access to the selected COS storage bucket during installation- action:- "cos:*"resource:- "qcs::cos:${var.app_cos.region}:uid/${var.app_cos.app_id}:${var.app_cos.bucket}/*"- "qcs::cos:${var.app_cos.region}:uid/${var.app_cos.app_id}:${var.app_cos.bucket}/"effect: allow
role.policy following the WYSIWYG principle. All privileges that a runtime role has need to be explicitly declared in package.yaml.var.cloudapp_id system variable is used to implement tag authorization.var.app_cos installation parameter is used to achieve resource-level authorization.scopes.cloudAPI will still take effect.role.policy.scopes.cloudAPI. An example is as follows:scopes:cloudAPI:- cvm:DescribeInstances
role:policy:version: "2.0"statement:- action:- cvm:DescribeInstances- cloudapp:VerifyLicenseresource: "*"effect: allow
cloudapp:VerifyLicense API to the permission policy by default without the need to explicitly declare it. In the new version, the permissions of the runtime role contain only explicitly declared APIs. You need to explicitly declare role.policy the cloudapp:VerifyLicense, otherwise the application will be unable to integrate with License.scopes.cloudAPI field needs to be deleted.Feedback