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
demandé il y a 9 mois521 vues
2 réponses
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.

répondu il y a 9 mois
  • 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
répondu il y a 9 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions