forked from splunk/splunk-aws-project-trumpet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
no_auto_hec_conf_website_template.json
156 lines (155 loc) · 5.77 KB
/
no_auto_hec_conf_website_template.json
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"AWSTemplateFormatVersion": "2010-09-09",
"Mappings": {
"BucketMap": {
"us-east-1": { "BucketName": "trumpet-splunk-prod-us-east-1" },
"us-east-2": { "BucketName": "trumpet-splunk-prod-us-east-2" },
"us-west-1": { "BucketName": "trumpet-splunk-prod-us-west-1" },
"us-west-2": { "BucketName": "trumpet-splunk-prod-us-west-2" },
"ca-central-1": { "BucketName": "trumpet-splunk-prod-ca-central-1" },
"eu-central-1" : { "BucketName": "trumpet-splunk-prod-eu-central-1" },
"eu-west-1": { "BucketName": "trumpet-splunk-prod-eu-west-1" },
"eu-west-2": { "BucketName": "trumpet-splunk-prod-eu-west-2" },
"eu-west-3": { "BucketName": "trumpet-splunk-prod-eu-west-3" },
"ap-northeast-1": { "BucketName": "trumpet-splunk-prod-ap-northeast-1" },
"ap-northeast-2": { "BucketName": "trumpet-splunk-prod-ap-northeast-2" },
"ap-southeast-1": { "BucketName": "trumpet-splunk-prod-ap-southeast-1" },
"ap-southeast-2": { "BucketName": "trumpet-splunk-prod-ap-southeast-2" },
"ap-south-1": { "BucketName": "trumpet-splunk-prod-ap-south-1" },
"sa-east-1": { "BucketName": "trumpet-splunk-prod-sa-east-1" }
}
},
"Resources": {
"CustomFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Fn::FindInMap": [
"BucketMap",
{
"Ref": "AWS::Region"
},
"BucketName"
]
},
"S3Key": "index.zip"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"LambdaExecutionRole",
"Arn"
]
},
"Runtime": "python2.7",
"Timeout": "30",
"Environment": {
"Variables": {
"AutoHEC": "false"
}
}
}
},
"LambdaExecutionRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"Service": ["lambda.amazonaws.com"]},
"Action": ["sts:AssumeRole"]
}]
},
"Path": "/",
"Policies": [{
"PolicyName": "root",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:*"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:DeleteObject",
"s3:DeleteBucket"
],
"Resource": "*"
}
]
}
}]
}
},
"CustomResource": {
"Type": "Custom::CustomResource",
"Properties": {
"ServiceToken": { "Fn::GetAtt" : ["CustomFunction", "Arn"] },
"S3Bucket": { "Ref": "S3Bucket" }
}
},
"S3Bucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"AccessControl": "PublicRead",
"WebsiteConfiguration": {
"IndexDocument": "index.html",
"ErrorDocument": "error.html"
}
},
"DeletionPolicy": "Retain"
},
"BucketPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"PolicyDocument": {
"Id": "MyPolicy",
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "S3Bucket"
},
"/*"
]
]
}
}
]
},
"Bucket": {
"Ref": "S3Bucket"
}
}
}
},
"Outputs": {
"WebsiteURL": {
"Value": {
"Fn::GetAtt": [
"S3Bucket",
"WebsiteURL"
]
},
"Description": "URL for website hosted on S3"
}
}
}