Skip to main content

tag policy

Manage tag policies

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

create

ecctl tag policy create [flags]

Create tag policy

  • Kind: mutation · Risk: medium
  • Dry run: supported via --dry-run.
APIWhen calledPurpose
CreatePolicyEvery time the command runs.Perform the resource operation.
ParameterTypeRequiredDescription
--contentstringtag policy document JSON or @file
--namestringtag policy name
--regionstringAlibaba Cloud region
--descriptionstringtag policy description
--user-typestringtag policy mode

update

ecctl tag policy update <id> [flags]

Update tag policy

  • Kind: mutation · Risk: medium
  • Dry run: supported via --dry-run.
APIWhen calledPurpose
ModifyPolicyEvery time the command runs.Perform the resource operation.
GetPolicyWhen --no-wait is not specified and --dry-run is not specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--contentstringtag policy document JSON or @file
--descriptionstringtag policy description
--namestringtag policy name

delete

ecctl tag policy delete <id> [flags]

Delete tag policy

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

get

ecctl tag policy get <id> [flags]

Get tag policy

  • Kind: read · Risk: low
APIWhen calledPurpose
GetPolicyEvery time the command runs.Read the resource view.
GetPolicyEnableStatusWhen --with-status is specified.Read the resource view.
GetEffectivePolicyWhen --with-effective is specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--fieldsstringcomma-separated resource fields to include
--open-typestringenablement type for policy status
--tag-keysarraytag keys for effective policy query
--targetstringtarget node ID
--target-typestringtarget node type
--user-typestringtag policy mode
--with-effectivebooleaninclude effective policy for the target
--with-statusbooleaninclude tag policy enable status

list

ecctl tag policy list [<ids>...] [flags]

List tag policies

  • Kind: read · Risk: low
APIWhen calledPurpose
ListPoliciesWhen --target is not specified and --target-type is not specified and --targets-for-policy is not specified.Read the resource view.
ListPoliciesForTargetWhen --target is specified or --target-type is specified.Read the resource view.
ListTargetsForPolicyWhen --targets-for-policy is specified.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
--targetstringtarget node ID
--target-typestringtarget node type
--targets-for-policystringpolicy ID whose attached targets should be listed

attach

ecctl tag policy attach <id> [flags]

Attach tag policy to a target

  • Kind: mutation · Risk: medium
  • Synchronous: waits for present (waiter attached_after_attach, timeout 300s); use --no-wait to skip.
APIWhen calledPurpose
AttachPolicyEvery time the command runs.Perform the resource operation.
ListPoliciesForTargetWhen --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
ListPoliciesForTargetWhen --no-wait is not specified.Return the final resource view. (cached; no additional request)
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--targetstringtarget node ID
--target-typestringtarget node type

detach

ecctl tag policy detach <id> [flags]

Detach tag policy from a target

  • Kind: mutation · Risk: medium
  • Synchronous: waits for absent (waiter detached_after_detach, timeout 300s); use --no-wait to skip.
APIWhen calledPurpose
DetachPolicyEvery time the command runs.Perform the resource operation.
ListPoliciesForTargetWhen --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
ListPoliciesForTargetWhen --no-wait is not specified.Return the final resource view. (cached; no additional request)
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--targetstringtarget node ID
--target-typestringtarget node type