I am trying to test the automation of tagging and untagging of resources in AWS. This is very easy to do with the apis but i want to be able to do the same with aws-sdk-mock but i am having trouble understanding the documentation of aws-sdk-mock as to how this would work.
I have the following code in which i am trying to assign a tag with key = 'ABC:DEF'
and value = 'v1:TestLambda:dev:web:Test:None'
to sample rds instance named 'sample-instance
'
const AWS = require('aws-sdk');
const AWSMock = require('aws-sdk-mock');
var rdsparams = {
ResourceName: 'arn:aws:rds:us-east-1:{account-id}:db:sample-instance',
/* required */
Tags: [ /* required */
{
Key: 'ABC:DEF',
Value: 'v1:TestLambda:dev:web:Test:None'
},
/* more items */
]
};
AWSMock.mock('RDS', 'addTagsToResource', function (params, callback){
callback(null, "successfully added tag to resource");
});
I would like to assign the tag to the rds instance. Is this the correct way of doing this because i get no output on the command line?