Skip to content

Commit 56ba219

Browse files
authored
allow lf in data exports (#287)
1 parent 2bf178d commit 56ba219

File tree

1 file changed

+72
-1
lines changed

1 file changed

+72
-1
lines changed

data-exports/deploy/data-exports-aggregation.yaml

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ Metadata:
4343
default: "Enable Split Cost Allocation Data (SCAD) in CUR 2.0"
4444
TimeGranularity:
4545
default: "CUR 2.0 Granularity. Do not change."
46-
46+
LakeFormationEnabled:
47+
default: "I have LakeFormation permission model in place for this account & my CFN deployment credentials have administrative rights on LakeFormation"
4748

4849
Parameters:
4950

@@ -102,6 +103,11 @@ Parameters:
102103
Description: Changing of this parameter will require redeployment of this Stack, purging of data in Destination and then additional Backfill request. HOURLY is a recommended option unless your AWS invoice is more then $50M (in this case contact your TAM when installing).
103104
Default: "HOURLY"
104105
AllowedValues: ["HOURLY", "DAILY", "MONTHLY"]
106+
LakeFormationEnabled:
107+
Type: String
108+
Description: Choose 'yes' if Lake Formation permission model is in place for the account. If you are not sure, leave it as 'no'. You need to install cid-lakeformation-prerequisite.yaml first.
109+
Default: "no"
110+
AllowedValues: ["yes", "no"]
105111

106112
Conditions:
107113
EmptySourceAccountIds: !Equals [ !Ref SourceAccountIds, '']
@@ -142,6 +148,11 @@ Conditions:
142148
DeployAnyExportViaLambda: !Or [!Condition DeployCUR2ViaLambda, !Condition DeployFOCUSViaLambda, !Condition DeployCOHViaLambda]
143149
DeployAnyTable: !Or [!Condition DeployFOCUSTable, !Condition DeployCUR2Table, !Condition DeployCOHTable]
144150

151+
NeedLakeFormationEnabledDB: !And [ !Equals [ !Ref LakeFormationEnabled, "yes"], !Condition DeployAnyTable]
152+
NeedLakeFormationEnabledCOH: !And [!Condition NeedLakeFormationEnabledDB, !Condition ManageCOH]
153+
NeedLakeFormationEnabledCUR2: !And [!Condition NeedLakeFormationEnabledDB, !Condition ManageCUR2]
154+
NeedLakeFormationEnabledFOCUS: !And [!Condition NeedLakeFormationEnabledDB, !Condition ManageFOCUS]
155+
145156
Mappings:
146157
DataExports:
147158
#Mappings for storing values for different Data Exports tables
@@ -1294,6 +1305,66 @@ Resources:
12941305
}
12951306
12961307
1308+
LakeFormationTagsForDatabase:
1309+
Type: AWS::LakeFormation::TagAssociation
1310+
Condition: NeedLakeFormationEnabledDB
1311+
Properties:
1312+
Resource:
1313+
Database:
1314+
CatalogId: !Ref "AWS::AccountId"
1315+
Name: !Ref CIDDatabase
1316+
LFTags:
1317+
- TagKey: !ImportValue cid-LakeFormation-TagKey # you need to install cid-lakeformation-prerequisite.yaml
1318+
TagValues:
1319+
- !ImportValue cid-LakeFormation-TagValue
1320+
CatalogId: !Ref "AWS::AccountId"
1321+
1322+
LakeFormationTagsForCUR2:
1323+
Type: AWS::LakeFormation::TagAssociation
1324+
Condition: NeedLakeFormationEnabledCUR2
1325+
Properties:
1326+
Resource:
1327+
Table:
1328+
CatalogId: !Ref "AWS::AccountId"
1329+
DatabaseName: !Ref CIDDatabase
1330+
Name: !Ref CURTable
1331+
LFTags:
1332+
- TagKey: !ImportValue cid-LakeFormation-TagKey # you need to install cid-lakeformation-prerequisite.yaml
1333+
TagValues:
1334+
- !ImportValue cid-LakeFormation-TagValue
1335+
CatalogId: !Ref "AWS::AccountId"
1336+
1337+
LakeFormationTagsForCOH:
1338+
Type: AWS::LakeFormation::TagAssociation
1339+
Condition: NeedLakeFormationEnabledCOH
1340+
Properties:
1341+
Resource:
1342+
Table:
1343+
CatalogId: !Ref "AWS::AccountId"
1344+
DatabaseName: !Ref CIDDatabase
1345+
Name: !Ref COHTable
1346+
LFTags:
1347+
- TagKey: !ImportValue cid-LakeFormation-TagKey # you need to install cid-lakeformation-prerequisite.yaml
1348+
TagValues:
1349+
- !ImportValue cid-LakeFormation-TagValue
1350+
CatalogId: !Ref "AWS::AccountId"
1351+
1352+
LakeFormationTagsForFOCUS:
1353+
Type: AWS::LakeFormation::TagAssociation
1354+
Condition: NeedLakeFormationEnabledFOCUS
1355+
Properties:
1356+
Resource:
1357+
Table:
1358+
CatalogId: !Ref "AWS::AccountId"
1359+
DatabaseName: !Ref CIDDatabase
1360+
Name: !Ref FOCUSTable
1361+
LFTags:
1362+
- TagKey: !ImportValue cid-LakeFormation-TagKey # you need to install cid-lakeformation-prerequisite.yaml
1363+
TagValues:
1364+
- !ImportValue cid-LakeFormation-TagValue
1365+
CatalogId: !Ref "AWS::AccountId"
1366+
1367+
12971368
###########################################################################
12981369
# Generic Resources
12991370
###########################################################################

0 commit comments

Comments
 (0)