FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cf_sql_code_deploy/sql-deploy.yaml at master · Irtaza/cf_sql_code_deploy · GitHub
Irtaza
/
cf_sql_code_deploy
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cf_sql_code_deploy
/
sql-deploy.yaml
Copy path
More file actions
More file actions
Latest commit
History
History
History
114 lines (110 loc) · 3.79 KB
Breadcrumbs
cf_sql_code_deploy
/
sql-deploy.yaml
Copy path
File metadata and controls
114 lines (110 loc) · 3.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
AWSTemplateFormatVersion
:
'
2010-09-09
'
Description
:
Cloud formation template containing EMR launcher
Parameters
:
#
include "include/paramsfromregionroot.yaml"
client
:
Type
:
String
Description
:
Client
account
:
Type
:
String
Description
:
Account
TargetDB
:
Type
:
String
Description
:
The database that the sql code will run on
Default
:
Athena
CreateSqlS3Key
:
Description
:
S3 Key of the file that contains the Create DDL queries
Type
:
String
DeleteSqlS3Key
:
Description
:
S3 Key of the file that contains the Delete DDL queries
Type
:
String
Datasource
:
Description
:
Name of the datasource e.g dcm, facebook, twitter etc
Type
:
String
Mappings
:
#
include "include/mapping_envs.yaml"
#
include "include/mapping_regions.yaml"
Resources
:
LambdaRolePolicy
:
Type
:
AWS::IAM::Policy
Properties
:
PolicyName
:
LambdaRolePolicy
PolicyDocument
:
Version
:
'
2012-10-17
'
Statement
:
-
Action
:
-
logs:CreateLogGroup
-
logs:CreateLogStream
-
logs:PutLogEvents
-
logs:DescribeLogStreams
-
logs:DescribeLogGroups
-
iam:PassRole
-
s3:GetObject
-
s3:PutObject
-
s3:ListBucket
-
s3:GetBucketPolicy
-
athena:BatchGetNamedQuery
-
athena:BatchGetQueryExecution
-
athena:CancelQueryExecution
-
athena:DeleteNamedQuery
-
athena:GetCatalogs
-
athena:GetExecutionEngine
-
athena:GetExecutionEngines
-
athena:GetNamedQuery
-
athena:GetNamespace
-
athena:GetNamespaces
-
athena:GetQueryExecution
-
athena:GetQueryExecutions
-
athena:GetQueryResults
-
athena:GetTable
-
athena:GetTables
-
athena:ListNamedQueries
-
athena:ListQueryExecutions
-
athena:RunQuery
-
athena:StartQueryExecution
-
athena:StopQueryExecution
Resource
:
-
'
*
'
Effect
:
Allow
Roles
:
-
!Ref
'
LambdaRole
'
LambdaRole
:
Type
:
AWS::IAM::Role
Properties
:
AssumeRolePolicyDocument
:
Version
:
'
2012-10-17
'
Statement
:
-
Action
:
-
sts:AssumeRole
Effect
:
Allow
Principal
:
Service
:
-
lambda.amazonaws.com
SqlDeployLambda
:
DependsOn
:
LambdaRolePolicy
Type
:
AWS::Lambda::Function
Properties
:
FunctionName
:
!Join ['-',['sql-deploy', !Ref 'client', !Ref 'account', !Ref 'envname', !Ref 'microenv', !Ref 'Datasource']]
Handler
:
sql_deploy_custom_resource_lambda.lambda_handler
MemorySize
:
128
Code
:
S3Bucket
:
!Ref 'repobucket'
S3Key
:
repos/lambda/sql_deploy_custom_resource_lambda.zip
Runtime
:
python2.7
Role
:
!GetAtt [LambdaRole, Arn]
Timeout
:
300
SqlDeployLambdaAttach
:
Type
:
Custom::SqlDeployLambdaAttach
Properties
:
CreateSqlS3KeyProperty
:
!Ref 'CreateSqlS3Key'
DeleteSqlS3KeyProperty
:
!Ref 'DeleteSqlS3Key'
DDLBucketProperty
:
!Ref 'repobucket'
DataBucketProperty
:
!Join ['-', [dadl, !Ref 'AWS::Region', !Ref 'client', !Ref 'account', !Ref 'envname', !Ref 'microenv']]
AthenaSqlOutputUriProperty
:
!Join ['-', ['s3://aws-athena-query-results', !Ref 'AWS::AccountId', !Ref 'AWS::Region']]
ClientProperty
:
!Ref 'client'
AccountProperty
:
!Ref 'account'
EnvnameProperty
:
!Ref 'envname'
MicroenvProperty
:
!Ref 'microenv'
TargetDBProperty
:
!Ref 'TargetDB'
TargetDBJDBCUrlProperty
:
!Join ['.', ['jdbc:awsathena://athena', !Ref 'AWS::Region', 'amazonaws.com:443']]
ServiceToken
:
!GetAtt [SqlDeployLambda, Arn]
Back
|
FazBrowse Home
|
New Git URL