'Is there any way to tag all resources through serverless?
I am adding tags using serverless and my service also using other resources e.g. kinesis. Is there any way to add tags in kinesis through serverless?
Solution 1:[1]
You can use a serverless plugin (serverless-plugin-resource-tagging). it will tag your Lambda function, Dynamo Tables, Bucket, Stream, API Gateway, and CloudFront resources. The way it works is you have to provide stacksTags having your tags inside under the Provider section of serverless.
provider:
stackTags:
STACK: "${self:service}"
PRODUCT: "Product Name"
COPYRIGHT: "Copyright"
Solution 2:[2]
You can add tags to all resources that are created using serverless.
In serverless.yml, add the following under provider section -
provider:
name: aws
runtime: {your runtime}
region: {your region}
stackTags: ${file(config/tags.yml):tags}
tags: ${file(config/tags.yml):tags}
Note -
1. tags - will add tags information to all functions.
2. stackTags - will add tags information to all other resources generated by CloudFormation template.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Auto geek |
Solution 2 |