- Newest
- Most votes
- Most comments
Hi,
You would need to use the parameter "cli-input-json" to input the json file to add the tag.
Below is sample command to add tag to the DB resource using the sample file - tags.json
aws rds add-tags-to-resource --resource-name arn:aws:rds:us-east-1:xxxxxxxxxxxx:db:mysampleDB --cli-input-json file://tags.json
$cat tags.json
{
"Tags": [
{
"Key": "Environment",
"Value": "Test"
},
{
"Key": "Project",
"Value": "Testing"
}
]
}
Reference - https://docs.aws.amazon.com/cli/latest/reference/rds/add-tags-to-resource.html
Hi,
Did you check the absence of tags by both AWS CLI and AWS console ?
Did you also try the so-called short-hand syntax document here: https://docs.aws.amazon.com/cli/latest/reference/rds/add-tags-to-resource.html
If they are really missing after all this trial, then, you should open a ticket to our Support via the AWS console of your account: you may well face a bug!
Best,
Didier
Hello.
Please change the contents of the "tags.json" file as follows.
[{ "Key": "domain-name", "Value": "some-domain" }, { "Key": "owner", "Value": "some-owner" }]
As described in the document below, the json for the "--tags" option is as follows.
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/add-tags-to-resource.html
[
{
"Key": "string",
"Value": "string"
}
...
]
Works great ! The --cli-input-json parameter makes the difference. The wrong one I've used it comes from the ec2 command..
Thanks!
answered 2 years ago
