UNPKG

serverless-tag-resources

Version:

Datamart: Tag all AWS resources with dual legacy + datamart:* tag support

17 lines (12 loc) 552 B
"use strict"; const { RDSClient, AddTagsToResourceCommand } = require("@aws-sdk/client-rds"); const { getClient } = require("../aws-clients"); async function tagRDSCluster(config, resource, tags, partition, region) { const client = getClient(RDSClient, config); const accountId = resource.StackId.split(":")[4]; const arn = `arn:${partition}:rds:${region}:${accountId}:cluster:${resource.PhysicalResourceId}`; await client.send( new AddTagsToResourceCommand({ ResourceName: arn, Tags: tags }) ); } module.exports = { tagRDSCluster };