Skip to content

Commit

Permalink
Added DB prefix to example template (#270)
Browse files Browse the repository at this point in the history
* Added DB prefix to example template

* description clarification
  • Loading branch information
dogversioning authored Aug 29, 2023
1 parent 00fb212 commit 03cd057
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions docs/setup/cumulus-aws-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Parameters:
BucketPrefix:
Type: 'String'
Description: 'Prefix for Cumulus bucket names (they will look like {BucketPrefix}-{purpose}-{AWS::AccountId}-{AWS::Region})'
DatabasePrefix:
Type: 'String'
Description: 'Prefix for Athena-related AWS resources (they will look like {DatabasePrefix}-{service related suffix}. It can be left as default unless you need to run multiple instances of this stack.'
Default: 'cumulus-deid'
EtlSubdir:
Type: 'String'
Description: 'Subdirectory on the Cumulus ETL output bucket where files will be placed. This should match the path you give when running Cumulus ETL. Using a subdirectory is recommended to allow for test runs of Cumulus ETL in different subdirectories and general future-proofing.'
Expand Down Expand Up @@ -116,7 +120,7 @@ Resources:
S3Encryptions:
- KmsKeyArn: !Ref KMSMasterKeyID
S3EncryptionMode: SSE-KMS
Name: cumulus-deid-kms
Name: !Sub "${DatabasePrefix}-kms"

CrawlerRole:
Type: AWS::IAM::Role
Expand Down Expand Up @@ -148,12 +152,17 @@ Resources:
Properties:
CatalogId: !Ref AWS::AccountId
DatabaseInput:
Name: cumulus_deid_db # use underscores for ease of SQL (hyphens are reserved)
Name:
Fn::Join: # replace hyphens with underscores for ease of SQL (hyphens are reserved)
- '_'
- Fn::Split:
- '-'
- !Sub "${DatabasePrefix}_db"

GlueCrawler:
Type: AWS::Glue::Crawler
Properties:
Name: cumulus-deid-crawler
Name: !Sub "${DatabasePrefix}-crawler"
DatabaseName: !Ref GlueDB
Role: !GetAtt CrawlerRole.Arn
CrawlerSecurityConfiguration: !Ref GlueSecurity
Expand Down Expand Up @@ -222,7 +231,7 @@ Resources:
AthenaWorkGroup:
Type: AWS::Athena::WorkGroup
Properties:
Name: cumulus-deid
Name: !Sub "${DatabasePrefix}"
State: ENABLED
WorkGroupConfiguration:
EnforceWorkGroupConfiguration: True
Expand Down

0 comments on commit 03cd057

Please sign in to comment.