

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS Glue 크롤러 생성
<a name="configure-custom-reports-create-crawler"></a>

AWS Glue 는 Amazon S3 데이터에서 데이터베이스를 생성하고 Athena를 사용하여 해당 데이터베이스를 쿼리할 수 있는 완전 관리형 추출, 변환 및 로드(ETL) 서비스입니다. 이 데이터베이스를 AWS Glue 데이터 카탈로그라고도 합니다. AWS Glue 크롤러는 Amazon S3 데이터의 스키마를 자동으로 감지하고 해당 데이터베이스 및 테이블을 생성할 수 있습니다. WorkSpaces 애플리케이션은 필요한 AWS Glue 리소스를 생성하는 데 사용할 수 있는 CloudFormation 템플릿을 제공합니다.

**중요**  
다음 절차의 단계를 완료하면 AWS Glue 크롤러가 생성됩니다. 하지만 이 단계로 크롤러가 시작되지는 않습니다. 크롤러를 시작하려면 그 다음 절차의 단계를 수행해야 합니다. AWS Glue 크롤러에 대한 자세한 내용은 [크롤러 정의를 참조하세요](https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html).

**AWS Glue 크롤러를 생성하려면**

1. [https://console.aws.amazon.com/appstream2/home](https://console.aws.amazon.com/appstream2/home) WorkSpaces 애플리케이션 콘솔을 엽니다.

1. 사용 보고서를 구독한 AWS 리전을 선택합니다.

1. 탐색 창에서 **Usage Reports(사용 보고서)**를 선택하고 사용 보고서 로깅이 활성화되었는지 확인합니다.

1. **Report Details(보고서 세부 정보)** 탭에서 **분석** 옆 단락에 있는 **CloudFormation 템플릿** 링크를 선택합니다.

   링크를 선택하면 실행하기 전에 템플릿에 지정된 CloudFormation 스택의 파라미터를 검토할 수 있는 CloudFormation 콘솔이 열립니다. 템플릿은 실행 시 AWS Glue 크롤러와 여러 샘플 Athena 쿼리를 생성합니다.

1. **세부 정보 지정** 페이지의 **ScheduleExpression** 옆에서 크롤러를 실행할 빈도에 대해 기본값을 유지하거나 다른 cron 표현식 값을 지정합니다. 다른 기본값은 변경하지 마십시오. 완료했으면 **다음**을 선택합니다.

   기본적으로 크롤러는 매일 실행되도록 예약되지만 매주, 매월 또는 다른 빈도로 실행되도록 크롤러를 구성할 수 있습니다. cron 구문에 대한 자세한 내용은 [Cron 표현식](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions)을 참조하십시오.

1. **옵션** 페이지에서 기본값을 그대로 두고 **다음**을 선택합니다.

1. **검토 **페이지에서가 사용자 지정 이름으로 IAM 리소스를 생성할 CloudFormation 수 있음을 승인합니다. 옆의 확인란을 선택한 다음 **생성을** 선택합니다.

    CloudFormation 스택을 생성하고 실행하려면 충분한 AWS Glue 및 AWS Identity and Access Management (IAM) 권한이 있어야 합니다. 다음 권한이 없으면 Amazon Web Services 계정 관리자에게 해당 계정으로 이 단계를 수행하거나 다음의 권한을 부여해 달라고 요청하세요.

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Effect": "Allow",
               "Action": [
                   "athena:CreateNamedQuery",
                   "athena:BatchGetNamedQuery",
                   "athena:GetNamedQuery",
                   "athena:StartQueryExecution",
                   "athena:GetQueryResults",
                   "athena:GetQueryExecution",
                   "athena:ListNamedQueries",
                   "cloudformation:DescribeStacks",
                   "cloudformation:GetStackPolicy",
                   "cloudformation:DescribeStackEvents",
                   "cloudformation:CreateStack",
                   "cloudformation:GetTemplate",
                   "cloudformation:ListChangeSets",
                   "cloudformation:ListStackResources",
                   "iam:GetRole",
                   "iam:CreateRole",
                   "iam:GetRolePolicy",
                   "s3:GetBucketLocation",
                   "s3:ListBucketMultipartUploads",
                   "s3:ListBucket",
                   "s3:ListMultipartUploadParts",
                   "s3:PutObject",
                   "s3:GetObject",
                   "s3:AbortMultipartUpload"
               ],
               "Resource": [
                   "arn:aws:iam::*:role/AppStreamUsageReports-AppStreamUsageReportGlueRole*",
                   "arn:aws:cloudformation:*:*:stack/AppStreamUsageReports/*",
                   "arn:aws:athena:*:*:workgroup/primary",
                   "arn:aws:s3:::aws-athena-query-results-*"
               ]
           },
           {
               "Effect": "Allow",
               "Action": [
                   "iam:AttachRolePolicy",
                   "iam:PutRolePolicy",
                   "s3:GetObject",
                   "s3:ListBucket"
               ],
               "Resource": [
                   "arn:aws:s3:::appstream-logs-*",
                   "arn:aws:iam::*:role/AppStreamUsageReports-AppStreamUsageReportGlueRole*"
               ]
           },
           {
               "Effect": "Allow",
               "Action": [
                   "iam:PassRole"
               ],
               "Resource": [
                   "arn:aws:iam::*:role/AppStreamUsageReports-AppStreamUsageReportGlueRole*"
               ],
               "Condition": {
                   "StringEquals": {
                       "iam:PassedToService": "glue.amazonaws.com"
                   }
               }
           },
           {
               "Effect": "Allow",
               "Action": [
                   "cloudformation:GetTemplateSummary",
                   "glue:GetResourcePolicy",
                   "glue:GetCrawlers",
                   "glue:BatchGetCrawlers",
                   "glue:GetClassifiers",
                   "glue:CreateClassifier",
                   "glue:ListCrawlers",
                   "glue:GetTags",
                   "glue:GetCrawlerMetrics",
                   "glue:GetClassifier",
                   "tag:GetResources"
               ],
               "Resource": "*"
           },
           {
               "Effect": "Allow",
               "Action": "athena:RunQuery",
               "Resource": "arn:aws:athena:*:*:workgroup/primary"
           },
           {
               "Effect": "Allow",
               "Action": [
                   "glue:GetTables",
                   "glue:GetPartitions",
                   "glue:GetTable"
               ],
               "Resource": [
                   "arn:aws:glue:*:*:table/appstream-usage/*",
                   "arn:aws:glue:*:*:database/appstream-usage",
                   "arn:aws:glue:*:*:catalog"
               ]
           },
           {
               "Effect": "Allow",
               "Action": [
                   "glue:GetDatabase",
                   "glue:CreateDatabase",
                   "glue:GetDatabases"
               ],
               "Resource": [
                   "arn:aws:glue:*:*:database/appstream-usage",
                   "arn:aws:glue:*:*:catalog"
               ]
           },
           {
               "Effect": "Allow",
               "Action": [
                   "glue:GetCrawler",
                   "glue:StartCrawler",
                   "glue:CreateCrawler"
               ],
               "Resource": "arn:aws:glue:*:*:crawler/appstream-usage*"
           },
           {
               "Effect": "Allow",
               "Action": "glue:GetCatalogImportStatus",
               "Resource": "arn:aws:glue:*:*:catalog"
           }
       ]
   }
   ```

------