

# Modifying integrations with Amazon S3 Tables

**Important**  
This is preview documentation for the Aurora PostgreSQL integration with Amazon S3 Tables. Before using this capability, review the Betas and Previews terms in the [AWS Service Terms](https://aws.amazon.com/service-terms/).

You can change the name, description, data rules, and tags of an Aurora PostgreSQL integration with Amazon S3 Tables without recreating the integration. You can make changes in the Amazon RDS console or with the AWS CLI.

You can also use the [`ModifyIntegration`](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyIntegration.html) operation of the Amazon RDS API.

With the `modify-integration` command, you can change the integration name, the description, and the data rules. You can make these changes only when the integration's status is `active`. You can change tags with the `add-tags-to-resource` and `remove-tags-from-resource` commands, or on the console **Modify** page.

You cannot change the source DB cluster, the target table bucket, the target prefix, or the AWS Key Management Service (AWS KMS) key that encrypts the integration. You set them when you create the integration, and they cannot be changed afterward. The target prefix is stored in the data rules (`TargetPrefix`), but even when you change the data rules, the prefix must stay the same. For details, see [Data rules for integrations with Amazon S3 Tables](s3tables-integration.data-rules.md).

To resync the data of a table without changing the integration, see [Resyncing integrations with Amazon S3 Tables](s3tables-integration.resyncing.md).

**Topics**
+ [Changing data rules](#s3tables-integration.modifying.data-rules)
+ [Changing the name, description, or tags](#s3tables-integration.modifying.other)

## Changing data rules
<a name="s3tables-integration.modifying.data-rules"></a>

Changing the data rules changes which databases, schemas, tables, and columns replicate. A modify request must carry the existing `TargetPrefix` unchanged. For the data rules syntax, see [Data rules for integrations with Amazon S3 Tables](s3tables-integration.data-rules.md).

When you change the data rules, the integration performs a full resync of all tables in scope, not just the tables affected by the change. Replication stops, Aurora runs a new full export of the source DB cluster, and every table in scope is resynced into the table bucket. This differs from a partial resync, which resyncs only the tables that you name.

The change has the following effects on tables and columns that leave the scope:
+ If the change removes a table from scope, its target table stays in the bucket with the data it had, and it no longer receives changes. If you no longer need the table, delete it in Amazon S3 Tables.
+ If the change removes a column, the column is dropped from the current schema of the target table. Earlier Apache Iceberg snapshots still contain it until they expire.

**Important**  
If you exclude a column, for example because it holds sensitive data, the column stays readable in earlier snapshots. To also remove the column from earlier snapshots, first apply the data rules change that excludes the column. Then delete the target table in Amazon S3 Tables and resync that table so the integration recreates it without the excluded column. For instructions, see [Resyncing tables manually](s3tables-integration.resyncing.md#s3tables-integration.resyncing.manual).

**To change data rules in the console**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Integrations**, and then choose your integration.

1. Choose **Modify**.

1. Under **Data rules**, edit the rules. Use the **Visual** editor to choose a template and set the databases, schemas, and tables for each rule, or choose **JSON** to edit the rules directly. The target prefix is shown but cannot be changed. You can change the databases, schemas, and tables that a rule matches, add a rule with **Add rule**, or change the **Properties** of a rule.

1. Choose **Continue**.

1. Review the change, and then choose **Save changes**.

To change data rules with the AWS CLI, use the [modify-integration](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-integration.html) command, and pass the complete data rules JSON to `--data-rules`.

**Important**  
The new rules replace all of the existing rules. Include every rule that you want to keep, including the rule that sets the existing `TargetPrefix`.

The integration applies rules in order, and a later rule overrides an earlier rule for the same objects. For example, a later rule with `"IncludeColumns": ["*"]` adds back columns that an earlier rule excluded. So when you add an include rule for a database, schema, or table, put it before any rule that excludes sensitive columns from that object. Otherwise, the include rule adds the excluded columns back. For more information, see [How the integration applies rules](s3tables-integration.data-rules.md#s3tables-integration.data-rules.syntax.order).

The following example replaces the data rules so that only the {{orders}} table replicates, without its {{card\_number}} column:

**Example**  
For Linux, macOS, or Unix:  

```
aws rds modify-integration \
  --integration-identifier arn:aws:rds:{{us-east-1}}:{{111122223333}}:integration:{{5b9f3d2e-1111-2222-3333-444455556666}} \
  --data-rules '[{"Database":"*","Schema":"*","Table":"*","Properties":{"TargetPrefix":"{{my_prefix}}","ExcludeColumns":["*"]}},{"Database":"{{sales}}","Schema":"public","Table":"{{orders}}","Properties":{"IncludeColumns":["*"]}},{"Database":"{{sales}}","Schema":"public","Table":"{{orders}}","Properties":{"ExcludeColumns":["{{card_number}}"]}}]'
```
For Windows:  
Save the JSON inside the single quotes in the preceding example to a file named `data-rules.json` in the current directory.  

```
aws rds modify-integration ^
  --integration-identifier arn:aws:rds:{{us-east-1}}:{{111122223333}}:integration:{{5b9f3d2e-1111-2222-3333-444455556666}} ^
  --data-rules file://data-rules.json
```

While Aurora applies the change, the integration has a status of `modifying`. To confirm the change, view the integration and check the data rules in the response. For instructions, see [Viewing an integration](s3tables-integration.monitoring.md#s3tables-integration.monitoring.viewing).

## Changing the name, description, or tags
<a name="s3tables-integration.modifying.other"></a>

To change the name or description with the AWS CLI, use the `modify-integration` command with `--integration-name` or `--description`. The following example renames an integration:

**Example**  
For Linux, macOS, or Unix:  

```
aws rds modify-integration \
  --integration-identifier arn:aws:rds:{{us-east-1}}:{{111122223333}}:integration:{{5b9f3d2e-1111-2222-3333-444455556666}} \
  --integration-name {{my-renamed-integration}}
```
For Windows:  

```
aws rds modify-integration ^
  --integration-identifier arn:aws:rds:{{us-east-1}}:{{111122223333}}:integration:{{5b9f3d2e-1111-2222-3333-444455556666}} ^
  --integration-name {{my-renamed-integration}}
```

To confirm a new name, run `describe-integrations` and check the `IntegrationName` value in the response.

To change tags with the AWS CLI, use the [add-tags-to-resource](https://docs.aws.amazon.com/cli/latest/reference/rds/add-tags-to-resource.html) and [remove-tags-from-resource](https://docs.aws.amazon.com/cli/latest/reference/rds/remove-tags-from-resource.html) commands with the integration's Amazon Resource Name (ARN).

**To change the name or tags in the console**

1. Open the integration, as in steps 1 and 2 of the data rules procedure.

1. Choose **Modify**.

1. For **Integration identifier**, enter the new name.

1. Under **Tags**, add or remove tags.

1. Choose **Continue**, and then choose **Save changes**.

On the **Modify** page, the **Source database**, **Destination**, and **Encryption** sections are read-only, because you cannot change the source DB cluster, target table bucket, or AWS KMS key after you create the integration.

To confirm the change, view the integration as described in [Viewing an integration](s3tables-integration.monitoring.md#s3tables-integration.monitoring.viewing).