

# Data Catalog와 S3 Tables 통합 활성화
<a name="enable-s3-tables-catalog-integration"></a>

Amazon S3 관리 콘솔이나 AWS CLI를 사용하여 AWS Glue Data Catalog와 S3 Tables 통합을 활성화할 수 있습니다. 콘솔을 사용하여 통합을 활성화하면 AWS는 AWS 계정 및 리전의 모든 S3 테이블 버킷을 자동으로 검색하고 탑재하는 `s3tablescatalog`라는 페더레이션 카탈로그를 생성합니다.

## Amazon S3 관리 콘솔을 사용하여 S3 Tables 통합 활성화
<a name="enable-s3-tables-console"></a>

1. [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/)에서 S3 콘솔을 엽니다.

1. 왼쪽 탐색 창에서 **테이블 버킷**을 선택합니다.

1. **테이블 버킷 생성**을 선택합니다.

1. **테이블 버킷 이름**을 입력하고 **통합 활성화** 확인란이 선택되어 있는지 확인합니다.

1. **테이블 버킷 생성**을 선택합니다.

Amazon S3는 해당 리전에서 테이블 버킷을 자동으로 통합합니다. 어떤 리전에서든 테이블 버킷을 처음 통합할 때 Amazon S3는 해당 리전의 Data Catalog에 `s3tablescatalog`를 생성합니다.

카탈로그가 생성된 후 계정과 리전의 모든 S3 테이블 버킷이 하위 카탈로그로 자동 탑재됩니다. Data Catalog에서 카탈로그로 이동하여 데이터베이스(네임스페이스)와 테이블을 볼 수 있습니다.

## AWS CLI를 사용하여 S3 Tables 통합 활성화
<a name="enable-s3-tables-cli"></a>

`s3tablescatalog` 명령을 사용하여 `glue create-catalog` 카탈로그를 생성합니다.

```
aws glue create-catalog \
  --name "s3tablescatalog" \
  --catalog-input '{
    "Description": "Federated catalog for S3 Tables",
    "FederatedCatalog": {
      "Identifier": "arn:aws:s3tables:region:account-id:bucket/*",
      "ConnectionName": "aws:s3tables"
    },
    "CreateDatabaseDefaultPermissions": [{
      "Principal": {
        "DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"
      },
      "Permissions": ["ALL"]
    }],
    "CreateTableDefaultPermissions": [{
      "Principal": {
        "DataLakePrincipalIdentifier": "IAM_ALLOWED_PRINCIPALS"
      },
      "Permissions": ["ALL"]
    }]
  }'
```

*region*을 AWS 리전으로 바꾸고 *account-id*를 AWS 계정 ID로 바꿉니다.

## 통합 확인
<a name="verify-s3-tables-integration"></a>

카탈로그를 생성한 후 하위 카탈로그를 나열하여 S3 테이블 버킷이 탑재되었는지 확인할 수 있습니다.

```
aws glue get-catalogs \
  --parent-catalog-id s3tablescatalog
```