function createNameTag(resourceId, nameTag) {
    var deferred = Q.defer();
    var params = {
        Resources: [resourceId],
        Tags: [{Key: "Name", Value: nameTag}]
    };

    aws.ec2.createTags(params, function(err, data) {
        if (err) {
            deferred.reject(new Error("Could not tag resource '" + resourceId + "' with name '" + nameTag + "': " + err.message));
        } else {
            deferred.resolve();
        }
    });

    return deferred.promise;
}
// creates a "Name" Tag for a given AWS resource
creates a "Name" Tag for a given AWS resource
creates a " Name " Tag for a given AWS resource
function createNameTag(resourceId, nameTag) {
    var deferred = Q.defer();
    var params = {
        Resources: [resourceId],
        Tags: [{Key: "Name", Value: nameTag}]
    };
    aws.ec2.createTags(params, function(err, data) {
        if (err) {
            deferred.reject(new Error("Could not tag resource '" + resourceId + "' with name '" + nameTag + "': " + err.message));
        } else {
            deferred.resolve();
        }
    });
    return deferred.promise;
}
function createNameTag ( resourceId , nameTag ) { var deferred = Q . defer ( ) ; var params = { Resources : [ resourceId ] , Tags : [ { Key : "Name" , Value : nameTag } ] } ; aws . ec2 . createTags ( params , function ( err , data ) { if ( err ) { deferred . reject ( new Error ( "Could not tag resource '" + resourceId + "' with name '" + nameTag + "': " + err . message ) ) ; } else { deferred . resolve ( ) ; } } ) ; return deferred . promise ; }
creates a "Name" Tag for a given AWS resource
creates a " Name " Tag for a given AWS resource