This guide describes how to create and manage tags on parameters in Google Cloud Parameter Manager. You can use tags to group related parameters and store metadata about those resources based on their tags.
About tags
A tag is a key-value pair that you can attach to a resource within Google Cloud. You can use tags to conditionally allow or deny policies based on whether a resource has a specific tag. For example, you can conditionally grant Identity and Access Management (IAM) roles based on whether a resource has a specific tag. For more information, see the Tags overview.
Tags are attached to resources by creating a tag binding resource that links the value to the Google Cloud resource.
Required permissions
To get the permissions that you need to manage tags, ask your administrator to grant you the following IAM roles:
- Tag Viewer
(
roles/resourcemanager.tagViewer) on the resources the tags are attached to - View and manage tags at the organization level:
Organization Viewer
(
roles/resourcemanager.organizationViewer) on the organization - Create, update, and delete tag definitions:
Tag Administrator
(
roles/resourcemanager.tagAdmin) on the resource you're creating, updating, or deleting tags for - Attach and remove tags from resources:
Tag User
(
roles/resourcemanager.tagUser) on the tag value and the resources that you're attaching the tag value to or removing it from
To attach tags to Parameter Manager parameters, you need the
Parameter Manager Admin role (roles/parametermanager.admin)
or a custom role containing the following permissions:
parametermanager.googleapis.com/parameters.createTagBindingparametermanager.googleapis.com/parameters.deleteTagBindingparametermanager.googleapis.com/parameters.listTagBindingsparametermanager.googleapis.com/parameters.listEffectiveTags
For more information about granting roles, see Manage access to projects, folders, and organizations. You might also be able to get the required permissions through custom roles or other predefined roles.
Create tag keys and values
Before you can attach a tag, you need to create a tag key and configure its value. For more information, see create a tag key and add tag values.
Add tags during resource creation
You can add tags when you create parameters. Doing so lets you provide essential metadata for your resources and allows for better organization, cost tracking, and automated policy application.
Global parameters
Regional parameters
Add tags to existing resources
To add a tag to existing parameters, follow these steps:
Global parameters
Regional parameters
List tags attached to resources
You can view a list of tag bindings directly attached to or inherited by the parameter.
Global parameters
Regional parameters
Detach tags from resources
You can detach tags that have been directly attached to a parameter. Inherited tags can be overridden by attaching a tag with the same key and a different value, but they can't be detached.
Global parameters
Regional parameters
Delete tag keys and values
When removing a tag key or value definition, ensure that the tag is detached from all parameters. You must delete existing tag attachments, called tag bindings, before deleting the tag definition itself. For more information, see Deleting tags.
IAM conditions and tags
You can use tags and IAM conditions to conditionally grant role bindings to users in your hierarchy. Changing or deleting the tag attached to a resource can remove user access to that resource if an IAM policy with conditional role bindings has been applied. For more information, see IAM conditions and tags.
What's next
- See the other services that support tags.
- See Tags and access control to learn how to use tags with IAM.