Tags module
Tags module is a helper to read the tags and get it in required formats.
System Tags
Managed services provisions these system tags automatically for a template and predefines their values. The tag keys are customizable so as to be compatible with other keys on the provider.
You can decide whether a system tag must be provisioned or not (enabled/disabled). The enable disable provision is available because the providers may or may not support a tag or they may limit the count of tags allowed. These system tags are available at CAM_terraform/cam-provider-terraform/stacks/stackjobs/Modules/camtags. If you want to include them in your template, set the source value relative to your path as follows:
module "camtags" {
source = "../Modules/camtags"
}
To use the tag in a Terraform resource, write your template so you can read, pass, or format them.
For example, AWS needs its tag as a map:
output "tagsAsMap" {
value = "${module.camtags.tagsmap}
}
This tags module has various outputs. It reads the tags that Managed services generates and converts it into a map format. For Deployments, set your tags in AWS and point your tags to this output value. Similarly, if you have a IBM Cloud, it takes tag in a list format with key value pairs. It formats the tags in a list and you can pass it to IBM Cloud.
User Tags
You can specify these tags at the time of provisioning. There are many ways a user tag can be designed, associated, and managed with a template.
Note: Consider the provider specific limitations when you name the tag or enter a key for it. For more information about IBM Cloud provider naming conventions, see Working with tags .
Tag Key Name can be set up / established at the following levels:
- Global - If you specify a user tag key here, it shows up whenever you request any template across all users / groups.
- Group - If you specify a user tag key here, it shows up whenever you request a template within a specific group.
- Template - If you specify user tag key here, it shows up whenever you request the specific template.
- Service - A tag key can be setup when you create a service in the Service Composer and it can be specific to service provisioning.
When a user specifies a tag key, they have an option of restricting the value types. The set of value types must be as follows:
- String - Any string possibly with a limit on the length and/or restricting certain characters.
- Integer - Only integers
- Number - Any number including long, decimal, float, and so on.
- Enumerated Value - A specific set of values with no ability to add new ones and the first one is set by default.
- Dynamic Value - Ability to specify a configuration or external API to retrieve the set of values allowed for this tag key dynamically.
For more information about using a template that has tags in a service, see Prerequisites for tags.