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 raw bucket #408

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
53 changes: 53 additions & 0 deletions sdlf-dataset/src/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,59 @@ Resources:
- !Sub "${pDatasetName} Glue crawler"
- !Sub "${pTeamName} team ${pDatasetName} Glue crawler"

rRawGlueCrawler:
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 rGlueDataCatalog
Name: !If
- NotUseLegacyTeam
- !Sub sdlf-${pDatasetName}-crawler-raw
- !Sub sdlf-${pTeamName}-${pDatasetName}-raw-crawler
Targets:
S3Targets:
- Path: !If
- NotUseLegacyTeam
- !Sub s3://${pRawBucket}/${pDatasetName}
- !Sub s3://${pRawBucket}/${pTeamName}/${pDatasetName}

rRawGlueCrawlerLakeFormationPermissions:
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 rRawGlueDataCatalog

rRawGlueCrawlerSsm:
Type: AWS::SSM::Parameter
Properties:
Name: !If
- NotUseLegacyTeam
- !Sub /SDLF/Glue/${pDatasetName}/RawGlueCrawler
- !Sub /SDLF/Glue/${pTeamName}/${pDatasetName}/RawGlueCrawler
Type: String
Value: !Ref rRawGlueCrawler
Description: !If
- NotUseLegacyTeam
- !Sub "${pDatasetName} Raw Glue crawler"
- !Sub "${pTeamName} team ${pDatasetName} Raw Glue crawler"

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