Modifies the intra-group connectivity policy of a basic security group.
Operation description
-
Advanced security groups do not support modifications to the intra-group connectivity policy. The default policy is internal isolation.
-
You can call DescribeSecurityGroupAttribute to query the current intra-group connectivity policy of a security group.
-
When the intra-group connectivity policy of a security group is set to intra-group connectivity, other custom access rules are ignored, and all instances in custom security group are connected over the internal network by default.
-
When the intra-group connectivity policy of a security group is set to internal isolation, all instances in custom security group are disconnected over the internal network by default if no other access rules are added. However, you can customize security group rules to change the internal network status. For example, you can call AuthorizeSecurityGroup to enable network connectivity between two ECS instances in custom security group.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifySecurityGroupPolicy |
update |
*SecurityGroup
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| SecurityGroupId |
string |
Yes |
The ID of the security group. |
sg-bp67acfmxazb4ph**** |
| RegionId |
string |
Yes |
The region ID of the security group. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| InnerAccessPolicy |
string |
Yes |
The internal connectivity policy between ECS instances in the security group. Valid values:
Note
The value is case-insensitive. |
Drop |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but make sure that the token is unique among different requests. The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
123e4567-e89b-12d3-a456-426655440000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
Examples
Success response
JSON format
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParamter.RegionId | The RegionId should not be null. | |
| 400 | InvalidSecurityGroupId.Malformed | The SecurityGroupId is invalid. Only letters, numbers and underscores are supported. Maximum length is 100 characters. | The specified SecurityGroupId parameter is invalid. The value can be up to 100 characters in length and can contain only letters, digits, and underscores (_). |
| 400 | InvalidPolicy.Malformed | The Policy is invalid. Only 'Accept' and 'Drop' are supported. Ignore case. | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | You cannot modify security groups managed by cloud services. |
| 404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | The specified security group does not exist in this account. Check whether the security group ID is correct. |
| 404 | InvalidParameter.InnerAccessPolicy | The InnerAccessPolicy attribute of enterprise level security group can't be modified. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.