Syntax to add tags in aws eks create-cluster command

0

Hello, Can you provide me the syntax for adding tags for creating eks clusters.

aws eks create-cluster --name $cluster_name --role-arn $role --resources-vpc-config subnetIds=$private_subnet1,$private_subnet1 --tags Tags=[{Key=Name,Value=test1},{Key=Owner,Value=dddd},{Key=Project,Value=yyy},{Key=Environment,Value=Dev},{Key=Scheduling,Value=Automatic},{Key=Department,Value=bbb},{Key=kubernetes.io/cluster/aaa,Value=shared}]"

Kalai
已提问 9 个月前506 查看次数
2 回答
0

The CLI documentation is a little confusing on this flag and maybe even wrong. This is what looks like passing multiple tags through cli --tags flag:

--tags Key=Tag1,Value=Value1 Key=Tag2,Value=Value2

Separate key,values with comma and one tag from another with space.

Let me know if this helps you! Have a nice day.

已回答 9 个月前
  • Nope, it is not working, getting the below error.

    bash-3.2$ aws eks create-cluster --name <<name>> --role-arn <<role_arn>> --resources-vpc-config subnetIds=<<id1>>,<<id2>> --tags Key=Name,Value=test1 Key=Owner,Value=<<value>>

    Unknown options: Key=Owner

0

Hi,

For AWS EKS- i would recommend using eksctl tool [1], . It is a command line tool for working with EKS clusters that automates many individual tasks. It will create cloud formation template and deploy cluster as per the options you specify

The eksctl tag command is used to manage tags on EKS clusters and other resources created by eksctl.

The basic syntax for the eksctl tag command is: eksctl tag --cluster=<clusterName> --resource=<resourceType> --tags <key=value,key=value>

example

eksctl tag --cluster=my-cluster --resource=cluster --tags team=dev,env=test

eksctl tag --cluster=my-cluster --resource=nodegroup --tags dept=finance

Reference: [1] - https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html & https://eksctl.io/

Thanks

AWS
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则