

# Tagging software supply chain resources

**Note**  
AWS Continuum for software supply chain is in preview release and is subject to change.

You can tag the customer managed policy and the policy exceptions that you create in AWS Continuum for software supply chain. A tag is a key-value pair that you attach to an AWS resource. You can add tags when you create one of these resources, and you can add or remove tags afterward. Only policies and policy exceptions are taggable. You can't tag the service-managed malicious-package baseline.

Tags help you organize your resources and control access to them. To restrict access to policies and exceptions by tag with attribute-based access control (ABAC), see [Restrict supply chain access by tag](security_iam_id-based-policy-examples.md#security_iam_id-based-policy-examples-sc-tags). To create the resources that you tag, see [Managing supply chain policies](sc-policies.md) and [Managing policy exceptions](sc-policy-exceptions.md).

## Tagging at create time
<a name="sc-tagging-create"></a>

You can add tags when you create a policy or a policy exception with the AWS Command Line Interface (AWS CLI). Pass the `--tags` option to the `create-supply-chain-policy` or `create-supply-chain-policy-exception` command. These commands call the `CreateSupplyChainPolicy` and `CreateSupplyChainPolicyException` operations. Continuum for software supply chain attaches the tags to the resource as it creates it. In each AWS CLI command, replace {{region}} with an AWS Region where Continuum for software supply chain is available, such as `us-east-1`.

To tag a policy as you create it, run the following command. The output includes the tags:

```bash
PROMPT> aws continuum create-supply-chain-policy \
    --region {{region}} \
    --policy file://policy.json \
    --tags key1=value1,key2=value2
{
  "id": "{{policy-id}}",
  "arn": "{{policy-arn}}",
  "policy": {
    ...
  },
  "createdAt": "{{timestamp}}",
  "updatedAt": "{{timestamp}}",
  "tags": {
    "key1": "value1",
    "key2": "value2"
  }
}
```

**Note**  
If you receive errors when you run AWS CLI commands, see [Troubleshooting errors for the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-troubleshooting.html) in the *AWS CLI User Guide*. Also, make sure that you're using the most recent AWS CLI version.

To tag a policy exception as you create it, run the following command. The output includes the tags:

```bash
PROMPT> aws continuum create-supply-chain-policy-exception \
    --region {{region}} \
    --exception file://exception.json \
    --tags key1=value1,key2=value2
{
  "id": "{{exception-id}}",
  "arn": "{{exception-arn}}",
  "exception": {
    ...
  },
  "status": "ACTIVE",
  "createdAt": "{{timestamp}}",
  "updatedAt": "{{timestamp}}",
  "tags": {
    "key1": "value1",
    "key2": "value2"
  }
}
```

Tagging at create time needs no separate `continuum:TagResource` permission. The create action authorizes the tags through the `aws:RequestTag/{{tag-key}}` and `aws:TagKeys` condition keys. For the permissions that control access to Continuum for software supply chain, see [Identity and access management for AWS Continuum](security-iam.md).

For the contents of `policy.json` and `exception.json`, see [Creating a policy](sc-policies.md#sc-policies-creating) and [Creating an exception](sc-policy-exceptions.md#sc-policy-exceptions-creating).

## Adding and removing tags
<a name="sc-tagging-managing"></a>

After you create a policy or an exception, you can change its tags with the following AWS CLI commands. Each command takes the resource's ARN.

To add or replace tags on a policy or exception, use the `tag-resource` command, which calls the `TagResource` operation. The command produces no output.

```bash
PROMPT> aws continuum tag-resource \
    --region {{region}} \
    --resource-arn {{resource-arn}} \
    --tags key1=value1,key2=value2
```

To remove tags from a policy or exception, use the `untag-resource` command, which calls the `UntagResource` operation. The command produces no output.

```bash
PROMPT> aws continuum untag-resource \
    --region {{region}} \
    --resource-arn {{resource-arn}} \
    --tag-keys key1 key2
```

To list the tags on a policy or exception, use the `list-tags-for-resource` command, which calls the `ListTagsForResource` operation:

```bash
PROMPT> aws continuum list-tags-for-resource \
    --region {{region}} \
    --resource-arn {{resource-arn}}
{
  "tags": {
    "key1": "value1",
    "key2": "value2"
  }
}
```

The Resource Groups Tagging API doesn't support tagging Continuum for software supply chain policies and exceptions during the preview.

Continuum for software supply chain records the `TagResource`, `UntagResource`, and `ListTagsForResource` operations as CloudTrail management events, with the event source `continuum.amazonaws.com`. For more information, see [Logging AWS Continuum API calls using AWS CloudTrail](logging-using-cloudtrail.md).

## Tag quotas
<a name="sc-tagging-limits"></a>

Tags on Continuum for software supply chain policies and exceptions have the following quotas:
+ Up to 50 tags for each resource.
+ A tag key from 1 to 128 characters.
+ A tag value from 0 to 256 characters.

For more information about quotas, see [AWS Continuum quotas](quotas.md).