Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add glue crawler for analytics bucket #409

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion sdlf-dataset/src/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ Resources:
- NotUseLegacyTeam
- !Sub sdlf-${pDatasetName}-glue-security-config # unfortunately AWS::Glue::SecurityConfiguration doesn't provide any return value
- !Sub "{{resolve:ssm:/SDLF/Glue/${pTeamName}/SecurityConfigurationId}}"
DatabaseName: !Ref rGlueDataCatalog
DatabaseName: !Ref rRawGlueDataCatalog
Name: !If
- NotUseLegacyTeam
- !Sub sdlf-${pDatasetName}-crawler-raw
Expand Down Expand Up @@ -563,6 +563,59 @@ Resources:
- !Sub "${pDatasetName} Raw Glue crawler"
- !Sub "${pTeamName} team ${pDatasetName} Raw Glue crawler"

rAnalyticsGlueCrawler:
Type: AWS::Glue::Crawler
Properties:
Role: !If
- NotUseLegacyTeam
- !GetAtt rDatalakeCrawlerRole.Arn
- !Sub "{{resolve:ssm:/SDLF/IAM/${pTeamName}/CrawlerRoleArn}}"
CrawlerSecurityConfiguration: !If
- NotUseLegacyTeam
- !Sub sdlf-${pDatasetName}-glue-security-config # unfortunately AWS::Glue::SecurityConfiguration doesn't provide any return value
- !Sub "{{resolve:ssm:/SDLF/Glue/${pTeamName}/SecurityConfigurationId}}"
DatabaseName: !Ref rAnalyticsGlueDataCatalog
Name: !If
- NotUseLegacyTeam
- !Sub sdlf-${pDatasetName}-crawler-analytics
- !Sub sdlf-${pTeamName}-${pDatasetName}-analytics-crawler
Targets:
S3Targets:
- Path: !If
- NotUseLegacyTeam
- !Sub s3://${pAnalyticsBucket}/${pDatasetName}
- !Sub s3://${pAnalyticsBucket}/${pTeamName}/${pDatasetName}

rAnalyticsGlueCrawlerLakeFormationPermissions:
Type: AWS::LakeFormation::Permissions
Properties:
DataLakePrincipal:
DataLakePrincipalIdentifier: !If
- NotUseLegacyTeam
- !GetAtt rDatalakeCrawlerRole.Arn
- !Sub "{{resolve:ssm:/SDLF/IAM/${pTeamName}/CrawlerRoleArn}}"
Permissions:
- CREATE_TABLE
- ALTER
- DROP
Resource:
DatabaseResource:
Name: !Ref rAnalyticsGlueDataCatalog

rAnalyticsGlueCrawlerSsm:
Type: AWS::SSM::Parameter
Properties:
Name: !If
- NotUseLegacyTeam
- !Sub /SDLF/Glue/${pDatasetName}/AnalyticsGlueCrawler
- !Sub /SDLF/Glue/${pTeamName}/${pDatasetName}/AnalyticsGlueCrawler
Type: String
Value: !Ref rAnalyticsGlueCrawler
Description: !If
- NotUseLegacyTeam
- !Sub "${pDatasetName} Analytics Glue crawler"
- !Sub "${pTeamName} team ${pDatasetName} Analytics Glue crawler"

rLakeFormationTag:
Type: AWS::LakeFormation::Tag
Condition: NotUseLegacyTeam
Expand Down
Loading