Skip to main content

ecs sg

Manage security group resources

Run ecctl ecs sg <action> -h for usage, or ecctl schema ecs.sg.<action> --full for the complete, agent-readable spec of every parameter and behavior.

create

ecctl ecs sg create [flags]

Create security group

  • Kind: mutation · Risk: medium
  • Idempotent via ClientToken.
APIWhen calledPurpose
CreateSecurityGroupEvery time the command runs.Perform the resource operation.
DescribeSecurityGroupAttributeEvery time the command runs.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--vpcstringVPC ID
--descriptionstringsecurity group description
--namestringsecurity group name
--resource-groupstringresource group ID
--tagkey_valuetag assignment key=value
--typestringsecurity group type (default: normal)

update

ecctl ecs sg update <id> [flags]

Update security group

  • Kind: mutation · Risk: medium
APIWhen calledPurpose
ModifySecurityGroupAttributeWhen --name is specified or --description is specified.Perform the resource operation.
ModifySecurityGroupPolicyWhen --inner-access-policy is specified.Perform the resource operation.
ModifySecurityGroupRuleWhen (--rule-id is specified or --protocol is specified or --port is specified or --cidr is specified or --policy is specified or --priority is specified) and --direction does not equal egress.Perform the resource operation.
ModifySecurityGroupEgressRuleWhen --direction equals egress and (--rule-id is specified or --protocol is specified or --port is specified or --cidr is specified or --policy is specified or --priority is specified).Perform the resource operation.
DescribeSecurityGroupAttributeWhen --no-wait is not specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--cidrcidrrule IPv4 CIDR block
--descriptionstringsecurity group description
--directionstringrule direction
--inner-access-policystringinternal access policy
--namestringsecurity group name
--policystringrule policy
--portstringrule port or port range
--priorityintegerrule priority
--protocolstringrule protocol
--rule-idstringsecurity group rule ID

delete

ecctl ecs sg delete <id> [flags]

Delete security group

  • Kind: mutation · Risk: high
APIWhen calledPurpose
DeleteSecurityGroupEvery time the command runs.Perform the resource operation.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region

get

ecctl ecs sg get <id> [flags]

Get security group

  • Kind: read · Risk: low
APIWhen calledPurpose
DescribeSecurityGroupAttributeEvery time the command runs.Read the resource view.
DescribeSecurityGroupReferencesWhen --with-references is specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--fieldsstringcomma-separated resource fields to include
--with-referencesbooleaninclude security group references

list

ecctl ecs sg list [<ids>...] [flags]

List security groups

  • Kind: read · Risk: low
APIWhen calledPurpose
DescribeSecurityGroupsEvery time the command runs.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--fieldsstringcomma-separated resource fields to include
--filterkey_valuefilter expression key=value
--limitintegermaximum resources to return (default: 100)
--next-tokenstringtoken for the next result page

authorize

ecctl ecs sg authorize <id> [flags]

Authorize security group rules

  • Kind: mutation · Risk: medium
  • Idempotent via ClientToken.
APIWhen calledPurpose
AuthorizeSecurityGroupWhen --direction does not equal egress.Perform the resource operation.
AuthorizeSecurityGroupEgressWhen --direction equals egress.Perform the resource operation.
DescribeSecurityGroupAttributeEvery time the command runs.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--cidrcidrrule IPv4 CIDR block
--directionstringrule direction (default: ingress)
--policystringrule policy (default: accept)
--portstringrule port or port range
--priorityintegerrule priority (default: 1)
--protocolstringrule protocol
--rulestringsecurity group rule, for example ingress:tcp:80:0.0.0.0/0 or tcp:80@0.0.0.0/0

revoke

ecctl ecs sg revoke <id> [flags]

Revoke security group rules

  • Kind: mutation · Risk: medium
  • Idempotent via ClientToken.
APIWhen calledPurpose
RevokeSecurityGroupWhen --direction does not equal egress.Perform the resource operation.
RevokeSecurityGroupEgressWhen --direction equals egress.Perform the resource operation.
DescribeSecurityGroupAttributeEvery time the command runs.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--directionstringrule direction (default: ingress)
--rulestringsecurity group rule, for example ingress:tcp:80:0.0.0.0/0 or tcp:80@0.0.0.0/0
--rule-idstringsecurity group rule ID