양식 연결
참고
AWS Glue의 비즈니스 컨텍스트와 시맨틱 검색은 미리 보기로 제공되며 변경될 수 있습니다.
재사용 가능한 정형 스키마 템플릿인 양식 유형을 정의하여 메타데이터를 표준화할 수 있습니다. 그런 다음 이러한 양식의 인스턴스를 자산에 연결하여 스키마를 채울 수 있습니다.
양식 유형 정의
양식 유형은 Smithy IDL 구문을 사용하여 스키마를 정의합니다. 이름은 대문자로 시작해야 합니다.
structure DataResidency { region: String complianceFramework: String retentionDays: Integer }
양식 유형을 생성하려면
PutFormType을 사용하여 양식 유형을 생성하거나 업데이트합니다.
aws glue put-form-type \ --name DataResidency \ --schema 'structure DataResidency { region: String complianceFramework: String retentionDays: Integer }'
출력 예시:
{ "Id": "DataResidency", "Name": "DataResidency" }
양식 유형을 검색하려면
aws glue get-form-type --identifier DataResidency
자산에 양식 연결
자산에 양식을 연결하려면
스키마를 준수하는 자산 식별자, 연결 이름, 양식 유형 ID 및 JSON 콘텐츠와 함께 PutAttachment를 사용합니다.
aws glue put-attachment \ --asset-identifierasset-id\ --attachment-name residencyInfo \ --form-type-id DataResidency \ --content '{"region":"us-east-1","complianceFramework":"SOC2","retentionDays":730}'
자산의 양식 및 연결을 보려면
GetAsset을 사용하여 자산과 해당 양식 및 연결을 검색합니다.
다음 명령은 자산을 검색합니다.
aws glue get-asset --asset-identifierasset-id
열에 양식을 연결하려면
자산의 단일 열에 양식을 연결할 수 있습니다.
각 열은 열 이름이 항목 식별자인 columns 반복 가능한 양식의 단일 항목입니다.
다음 명령은 특정 열에 양식을 연결합니다.
aws glue put-attachment \ --asset-identifierasset-id\ --iterable-form-name columns \ --item-identifier region \ --attachment-name sensitivity \ --form-type-id DataClassification \ --content '{"classification":"PII","sensitivity":"HIGH"}'
양식을 연결한 후 SearchAssets를 사용하여 양식의 검색 가능한 필드로 자산을 검색합니다.
열 메타데이터 검색
자산의 열을 나열하려면
aws glue list-iterable-forms \ --asset-identifierasset-id\ --iterable-form-name columns \ --max-results 20
특정 열과 해당 양식을 검색하려면
BatchGetIterableForms를 사용하여 단일 요청으로 열과 연결된 양식을 검색합니다.
aws glue batch-get-iterable-forms \ --asset-identifierasset-id\ --iterable-form-name columns \ --item-identifiers region email
연결 및 양식 유형 삭제
첨부 파일을 삭제하는 방법
aws glue delete-attachment \ --asset-identifierasset-id\ --attachment-name residencyInfo
특정 열에서 연결을 삭제하려면
단일 열에 연결된 양식을 제거하려면 다음 명령을 실행합니다. 반복 가능한 양식 이름, 항목 식별자 및 연결 이름을 전달합니다.
aws glue delete-attachment \ --asset-identifierasset-id\ --iterable-form-name columns \ --item-identifier region \ --attachment-name sensitivity
양식 유형을 삭제하려면
자산 유형에서 여전히 참조하는 양식 유형은 삭제할 수 없습니다.
aws glue delete-form-type --identifier DataResidency
양식 유형 나열
aws glue list-form-types --max-results 20
출력 예시:
{ "Items": [ {"Id": "DataResidency", "Name": "DataResidency"}, {"Id": "DataClassification", "Name": "DataClassification"} ] }