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:DescribeLicenseresource: "*"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 follows the "What You See Is What You Get" principle, and all privileges of the runtime role must be explicitly declared in package.yaml.var.cloudapp_id system variable is used to implement tag authorization.var.app_cos installation parameters are used to implement resource-level authorization.scopes.cloudAPI will remain effective.role.policy.scopes.cloudAPI. An example is as follows:scopes:cloudAPI:- cvm:DescribeInstances
role:policy:version: "2.0"statement:- action:- cvm:DescribeInstances- cloudapp:DescribeLicenseresource: "*"effect: allow
cloudapp:DescribeLicense interface is automatically added to the permission policy without explicit declaration. In the new version, the permissions of the runtime role only include explicitly declared interfaces. You need to explicitly declare role.policy in cloudapp:DescribeLicense, otherwise the application cannot integrate with License.scopes.cloudAPI field needs to be deleted.Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários