Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Using tags to control access to account connection resources

Focus mode
Using tags to control access to account connection resources - Amazon CodeCatalyst

Tags can be attached to the resource or passed in the request to services that support tagging. Resources in policies can have tags, and some actions in policies can include tags. Tagging condition keys include the aws:RequestTag and aws:ResourceTag condition keys. When you create an IAM policy, you can use tag condition keys to control the following:

  • Which users can perform actions on a connection resource, based on tags that it already has.

  • Which tags can be passed in an action's request.

  • Whether specific tag keys can be used in a request.

The following examples demonstrate how to specify tag conditions in policies for CodeCatalyst account connections users. For more information about condition keys, see Policy condition keys in IAM.

Example 1: Allow actions based on tags in the request

The following policy grants users permission to approve account connections.

To do that, it allows the AcceptConnection and TagResource actions if the request specifies a tag named Project with the value ProjectA. (The aws:RequestTag condition key is used to control which tags can be passed in an IAM request.) The aws:TagKeys condition ensures tag key case sensitivity.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codecatalyst:AcceptConnection", "codecatalyst:TagResource" ], "Resource": "*", "Condition": { "StringEquals": { "aws:RequestTag/Project": "ProjectA" }, "ForAllValues:StringEquals": { "aws:TagKeys": ["Project"] } } } ] }

Example 2: Allow actions based on resource tags

The following policy grants users permission to perform actions on, and get information about, account connection resources.

To do that, it allows specific actions if the connection has a tag named Project with the value ProjectA. (The aws:ResourceTag condition key is used to control which tags can be passed in an IAM request.)

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codecatalyst:GetConnection", "codecatalyst:DeleteConnection", "codecatalyst:AssociateIamRoleToConnection", "codecatalyst:DisassociateIamRoleFromConnection", "codecatalyst:ListIamRolesForConnection", "codecatalyst:PutBillingAuthorization" ], "Resource": "*", "Condition": { "StringEquals": { "aws:ResourceTag/Project": "ProjectA" } } } ] }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.