Updating Mandatory Tags for AWS provider in Cloud Platform namespace resources
Overview
This guide explains how to update the mandatory tags for the Terraform AWS provider managed resources in your Cloud Platform environment. This is essential for compliance and resource management of AWS resources.
Prerequisites
Before you begin, ensure you have the following:
- Access to the Cloud Platform namespace where the resources are located.
- Latest version of the Cloud Platform CLI installed.
Steps to Update Mandatory AWS Tags
Running the cloud-platform CLI command to update tags:
Use the following command to update the mandatory AWS tags for your namespace resources:
cloud-platform environment namespace-tags --namespaces namespace1,namespace2 --repo-path /path/to/cloud-platform-environmentsReplace
namespace1with the actual namespace you want to update, and/path/to/cloud-platform-environmentswith the path to your Cloud Platform environments repository.Verify the Update:
After running the command, verify that the tags have been updated correctly by checking the resources in your cloud-platform-environments repository.
Before Update:
provider "aws" { region = "eu-west-2" }After Update:
provider "aws" { default_tags { tags = { business-unit = var.business_unit application = var.application is-production = var.is_production owner = var.team_name namespace = var.namespace service-area = var.service_area } } region = "eu-west-2" }The service-area tag may not be included in your
variables.tffile, you will need to add this manually. Please follow this guidance on naming conventions: Service Area Tag Naming ConventionsIf there are other tags already present, the script should add the mandatory tags without removing the existing ones. But please ensure they are preserved along with the new mandatory tags.
Commit and Push Changes:
Once the tags have been updated successfully, commit, push and create a pull request for the changes for review.