Updated on 2024-06-21 GMT+08:00

Elastic Cloud Server (ECS)

The Organizations service provides Service Control Policies (SCPs) to set access control policies.

SCPs do not actually grant any permissions to a principal. They only set the permissions boundary for the principal. When SCPs are attached to a member account or an organizational unit (OU), they do not directly grant permissions to that member account or OU. Instead, the SCPs just determine what permissions are available for that member account or the member accounts under that OU.

This section describes the elements used by Organizations SCPs. The elements include actions, resources, and conditions.

For details about how to use these elements to create a custom SCP, see Creating an SCP.

Actions

Actions are specific operations that are allowed or denied in an SCP.

  • The Access Level column describes how the action is classified (List, Read, or Write). This classification helps you understand the level of access that an action grants when you use it in an SCP.
  • The Resource Type column indicates whether the action supports resource-level permissions.
    • You can use a wildcard (*) to indicate all resource types. If this column is empty (-), the action does not support resource-level permissions, and you must specify all resources ("*") in your SCP statements.
    • If this column includes a resource type, you must specify the URN in the Resource element of your statements.
    • Required resources are marked with asterisks (*) in the table. If you specify a resource in a statement using this action, then it must be of this type.

    For details about the resource types defined by ECS, see Resources.

  • The Condition Key column contains keys that you can specify in the Condition element of an SCP statement.
    • If the Resource Type column has values for an action, the condition key takes effect only for the listed resource types.
    • If the Resource Type column is empty (-) for an action, the condition key takes effect for all resources that action supports.
    • If the Condition Key column is empty (-) for an action, the action does not support any condition keys.

    For details about the condition keys defined by ECS, see Conditions.

The following table lists the actions that you can define in SCP statements for ECS.

Table 1 Actions supported by ECS

Action

Description

Access Level

Resource Type (*: required)

Condition Key

ecs:cloudServers:createServers

Grants permission to create ECSs.

write

-

  • g:RequestTag/<tag-key>
  • g:EnterpriseProjectId
  • g:TagKeys
  • ecs:imageID
  • evs:Encrypted
  • cbr:VaultId

ecs:cloudServers:deleteServers

Grants permission to delete ECSs.

write

instance *

-

ecs:cloudServers:resize

Grants permission to modify ECS specifications.

write

instance *

-

ecs:cloudServers:attachSharedVolume

Grants permission to attach a specified shared EVS disk to multiple ECSs in a batch.

write

instance *

evs:Encrypted

ecs:cloudServers:showServer

Grants permission to query ECS details.

read

instance *

-

ecs:cloudServers:attach

Grants permission to attach disks to an ECS.

write

instance *

evs:Encrypted

ecs:cloudServers:listServerBlockDevices

Grants permission to query information about the disks attached to an ECS.

list

instance *

-

ecs:cloudServers:showServerBlockDevice

Grants permission to query information about a single disk attached to an ECS.

read

instance *

-

ecs:cloudServers:updateServerBlockDevice

Grants permission to modify information about a single disk attached to an ECS.

write

instance *

-

ecs:cloudServers:changeOS

Grants permission to change the ECS OS.

write

instance *

  • ecs:imageID
  • evs:Encrypted

ecs:cloudServers:detachVolume

Grants permission to detach disks from an ECS.

write

instance *

-

ecs:cloudServers:updateMetadata

Grants permission to update ECS metadata.

write

instance *

-

ecs:cloudServers:deleteMetadata

Grants permission to delete ECS metadata.

write

instance *

-

ecs:cloudServers:migrate

Grants permission to cold migrate ECSs.

write

instance *

-

ecs:cloudServers:listServerInterfaces

Grants permission to query NICs of an ECS.

list

instance *

-

ecs:cloudServers:showResetPasswordFlag

Grants permission to query whether one-click password reset is supported.

read

instance *

-

ecs:cloudServers:showServerPassword

Grants permission to get the password for logging in to an ECS.

read

instance *

-

ecs:cloudServers:deletePassword

Grants permission to delete the password for logging in to an ECS.

write

instance *

-

ecs:cloudServers:listServerVolumeAttachments

Grants permission to query disks attached to an ECS.

list

instance *

-

ecs:cloudServers:rebuild

Grants permission to reinstall the ECS OS.

write

instance *

evs:Encrypted

ecs:cloudServers:vnc

Grants permission to obtain the VNC login address.

read

instance *

-

ecs:cloudServers:updateServer

Grants permission to modify ECS information.

write

instance *

-

ecs:cloudServers:addNics

Grants permission to add NICs to an ECS in a batch.

write

instance *

-

ecs:cloudServerNics:delete

Grants permission to delete NICs from an ECS in a batch.

write

instance *

-

ecs:cloudServers:showServerTags

Grants permission to query ECS tags.

list

instance *

-

ecs:cloudServers:batchCreateServerTags

Grants permission to add tags to an ECS in a batch.

write

instance *

  • g:RequestTag/<tag-key>
  • g:TagKeys

ecs:cloudServers:batchDeleteServerTags

Grants permission to delete tags from an ECS in a batch.

write

instance *

  • g:RequestTag/<tag-key>
  • g:TagKeys

ecs:cloudServers:start

Grants permission to start ECSs in a batch.

write

instance *

-

ecs:cloudServers:stop

Grants permission to stop ECSs in a batch.

write

instance *

-

ecs:cloudServers:reboot

Grants permission to restart ECSs in a batch.

write

instance *

-

ecs:cloudServers:batchUpdateServersName

Grants permission to modify ECS information in a batch.

write

instance *

-

ecs:cloudServers:listServersDetails

Grants permission to query ECS details.

list

-

g:EnterpriseProjectId

ecs:cloudServerFlavors:get

Grants permission to query specifications and expansion details about ECSs.

read

-

-

ecs:cloudServerQuotas:get

Grants permission to query tenant quotas.

read

-

-

ecs:cloudServers:resetServerPwd

Grants permission to reset the password of an ECS.

write

instance *

-

ecs:cloudServers:listServerGroups

Grants permission to query ECS groups.

list

-

-

ecs:cloudServers:createServerGroup

Grants permission to create ECS groups.

write

-

-

ecs:cloudServers:showServerGroup

Grants permission to query ECS groups.

read

-

-

ecs:cloudServers:deleteServerGroup

Grants permission to delete ECS groups.

write

-

-

ecs:cloudServers:addServerGroupMember

Grants permission to add ECSs to an ECS group.

write

-

-

ecs:cloudServers:deleteServerGroupMember

Grants permission to delete ECSs from an ECS group.

write

-

-

ecs:cloudServers:listResizeFlavors

Grants permission to query the target ECS flavors to which a flavor can be changed.

list

-

-

ecs:cloudServers:listServerTags

Grants permission to query project tags.

list

-

-

Each API of ECS usually supports one or more actions. Table 2 lists the supported actions and dependencies.

Table 2 Actions and dependencies supported by ECS APIs

API

Action

Dependencies

POST /v1.1/{project_id}/cloudservers

ecs:cloudServers:createServers

  • eip:publicIps:create
  • eip:publicIps:associateInstance
  • iam:agencies:pass

POST /v1/{project_id}/cloudservers

ecs:cloudServers:createServers

  • eip:publicIps:create
  • eip:publicIps:associateInstance
  • iam:agencies:pass

POST /v1/{project_id}/cloudservers/delete

ecs:cloudServers:deleteServers

-

POST /v1.1/{project_id}/cloudservers/{server_id}/resize

ecs:cloudServers:resize

-

POST /v1/{project_id}/batchaction/attachvolumes/{volume_id}

ecs:cloudServers:attachSharedVolume

evs:volumes:use

GET /v1/{project_id}/cloudservers/{server_id}

ecs:cloudServers:showServer

-

POST /v1/{project_id}/cloudservers/{server_id}/attachvolume

ecs:cloudServers:attach

evs:volumes:use

GET /v1/{project_id}/cloudservers/{server_id}/block_device

ecs:cloudServers:listServerBlockDevices

-

GET /v1/{project_id}/cloudservers/{server_id}/block_device/{volume_id}

ecs:cloudServers:showServerBlockDevice

-

PUT /v1/{project_id}/cloudservers/{server_id}/block_device/{volume_id}

ecs:cloudServers:updateServerBlockDevice

-

POST /v1/{project_id}/cloudservers/{server_id}/changeos

ecs:cloudServers:changeOS

-

DELETE /v1/{project_id}/cloudservers/{server_id}/detachvolume/{volume_id}

ecs:cloudServers:detachVolume

-

POST /v1/{project_id}/cloudservers/{server_id}/metadata

ecs:cloudServers:updateMetadata

iam:agencies:pass

DELETE /v1/{project_id}/cloudservers/{server_id}/metadata/{key}

ecs:cloudServers:deleteMetadata

-

POST /v1/{project_id}/cloudservers/{server_id}/migrate

ecs:cloudServers:migrate

-

GET /v1/{project_id}/cloudservers/{server_id}/os-interface

ecs:cloudServers:listServerInterfaces

-

GET /v1/{project_id}/cloudservers/{server_id}/os-resetpwd-flag

ecs:cloudServers:showResetPasswordFlag

-

GET /v1/{project_id}/cloudservers/{server_id}/os-server-password

ecs:cloudServers:showServerPassword

-

DELETE /v1/{project_id}/cloudservers/{server_id}/os-server-password

ecs:cloudServers:deletePassword

-

GET /v1/{project_id}/cloudservers/{server_id}/os-volume_attachments

ecs:cloudServers:listServerVolumeAttachments

-

POST /v1/{project_id}/cloudservers/{server_id}/reinstallos

ecs:cloudServers:rebuild

-

POST /v2/{project_id}/cloudservers/{server_id}/reinstallos

ecs:cloudServers:rebuild

-

POST /v1/{project_id}/cloudservers/{server_id}/remote_console

ecs:cloudServers:vnc

-

POST /v1/{project_id}/cloudservers/{server_id}/resize

ecs:cloudServers:resize

-

GET /v1/{project_id}/cloudservers/detail?flavor={flavor}&name={name}&status={status}&limit={limit}&offset={offset}&not-tags={not-tags}&reservation_id={reservation_id}&enterprise_project_id={enterprise_project_id}&tags={tags}&ip={ip}

ecs:cloudServers:listServersDetails

-

PUT /v1/{project_id}/cloudservers/{server_id}

ecs:cloudServers:updateServer

-

POST /v1/{project_id}/cloudservers/{server_id}/nics

ecs:cloudServers:addNics

-

POST /v1/{project_id}/cloudservers/{server_id}/nics/delete

ecs:cloudServerNics:delete

-

GET /v1/{project_id}/cloudservers/{server_id}/tags

ecs:cloudServers:showServerTags

-

POST /v1/{project_id}/cloudservers/{server_id}/tags/action

ecs:cloudServers:batchCreateServerTags

-

POST /v1/{project_id}/cloudservers/{server_id}/tags/action

ecs:cloudServers:batchDeleteServerTags

-

POST /v1/{project_id}/cloudservers/action

ecs:cloudServers:start

-

POST /v1/{project_id}/cloudservers/action

ecs:cloudServers:stop

-

POST /v1/{project_id}/cloudservers/action

ecs:cloudServers:reboot

-

GET /v1/{project_id}/cloudservers/flavors?availability_zone={availability_zone}&flavor_id={flavor_id}&limit={limit}&marker={marker}

ecs:cloudServerFlavors:get

-

GET /v1/{project_id}/cloudservers/limits

ecs:cloudServerQuotas:get

-

PUT /v1/{project_id}/cloudservers/{server_id}/os-reset-password

ecs:cloudServers:resetServerPwd

-

GET /v1/{project_id}/cloudservers/os-server-groups?limit={limit}&marker={marker}

ecs:cloudServers:listServerGroups

-

POST /v1/{project_id}/cloudservers/os-server-groups

ecs:cloudServers:createServerGroup

-

GET /v1/{project_id}/cloudservers/os-server-groups/{server_group_id}

ecs:cloudServers:showServerGroup

-

DELETE /v1/{project_id}/cloudservers/os-server-groups/{server_group_id}

ecs:cloudServers:deleteServerGroup

-

POST /v1/{project_id}/cloudservers/os-server-groups/{server_group_id}/action

ecs:cloudServers:addServerGroupMember

-

POST /v1/{project_id}/cloudservers/os-server-groups/{server_group_id}/action

ecs:cloudServers:deleteServerGroupMember

-

GET /v1/{project_id}/cloudservers/resize_flavors?instance_uuid={instance_uuid}&source_flavor_id={source_flavor_id}&source_flavor_name={source_flavor_name}

ecs:cloudServers:listResizeFlavors

-

GET /v1/{project_id}/cloudservers/tags

ecs:cloudServers:listServerTags

-

POST /v2/{project_id}/cloudservers/{server_id}/changeos

ecs:cloudServers:changeOS

-

PUT /v1/{project_id}/cloudservers/server-name

ecs:cloudServers:batchUpdateServersName

-

POST /v1/{project_id}/cloudservers/actions/change-charge-mode

ChangeServerChargeMode

  • billing:order:pay
  • billing:subscription:renew

GET /v1/{project_id}/cloudservers/flavor-sell-policies?flavor_id={flavor_id}

ecs:cloudServerFlavors:get

-

GET /v1/{project_id}/cloudservers/{server_id}/autorecovery

ecs:cloudServers:getAutoRecovery

-

PUT /v1/{project_id}/cloudservers/{server_id}/autorecovery

ecs:cloudServers:setAutoRecovery

-

Resources

A resource type indicates the resources that an SCP applies to. If you specify a resource type for any action in Table 3, the resource URN must be specified in the SCP statements using that action, and the SCP applies only to resources of this type. If no resource type is specified, the Resource element is marked with an asterisk (*) and the SCP applies to all resources. You can also set condition keys in an SCP to define resource types.

The following table lists the resource types that you can define in SCP statements for ECS.

Table 3 Resource types supported by ECS

Resource Type

URN

instance

ecs:<region>:<account-id>:instance:<server-id>

Conditions

A Condition element lets you specify conditions for when an SCP is in effect. It contains condition keys and operators.

  • The condition key that you specify can be a global condition key or a service-specific condition key.
    • Global condition keys (with the g: prefix) apply to all actions. Cloud services do not need to provide user identity information. Instead, the system automatically obtains such information and authenticates users. For details, see Global Condition Keys.
    • Service-specific condition keys (with the abbreviation of a service name plus a colon as the prefix, for example, ecs:) only apply to operations of the ECS service. For details, see Table 4.
    • The number of values associated with a condition key in the request context of an API call makes the condition key single-valued or multivalued. Single-valued condition keys have at most one value in the request context of an API call. Multivalued condition keys can have multiple values in the request context of an API call. For example, a request can originate from at most one VPC endpoint, so g:SourceVpce is a single-valued condition key. You can tag resources and include multiple tag key-value pairs in a request, so g:TagKeys is a multivalued condition key.
  • A condition operator, condition key, and a condition value together constitute a complete condition statement. An SCP can be applied only when its request conditions are met. For supported condition operators, see Condition operators.

The following table lists the condition keys that you can define in SCPs for ECS. You can include these condition keys to specify conditions for when your SCP is in effect.

Table 4 Service-specific condition keys supported by ECS

Condition Key

Type

Single-valued/Multivalued

Description

ecs:imageID

string

Multivalued

Filters access based on the image ID specified in the request parameter.