-
Notifications
You must be signed in to change notification settings - Fork 2
/
test-stack.yml
273 lines (238 loc) · 6.95 KB
/
test-stack.yml
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
# Parameters:
# DefaultVpcId:
# Type: String
# DefaultSubnetId:
# Type: String
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
EmptyBucket:
Type: AWS::S3::Bucket
Properties:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
S3AccessPoint:
Type: AWS::S3::AccessPoint
Properties:
Bucket: !Ref Bucket
Name: autofill-delete-test-ap
Queue:
Type: AWS::SQS::Queue
Topic:
Type: AWS::SNS::Topic
IAMUser:
Type: AWS::IAM::User
Properties:
UserName: autofill-delete-test-user
IAMGroup:
Type: AWS::IAM::Group
Properties:
GroupName: autofill-delete-test-group
IAMAccessKey:
Type: AWS::IAM::AccessKey
Properties:
UserName: !Ref IAMUser
Status: Inactive
IAMRole:
Type: AWS::IAM::Role
Properties:
RoleName: autofill-delete-test-role
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: sts:AssumeRole
Principal:
AWS: !Ref AWS::AccountId
IAMPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
ManagedPolicyName: autofill-delete-test-policy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: sts:AssumeRole
Resource: "*"
DynamoGlobalTable:
Type: AWS::DynamoDB::GlobalTable
Properties:
TableName: autofill-delete-test-globaltable
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: GSI
KeySchema:
- AttributeName: id
KeyType: HASH
Projection:
ProjectionType: ALL
Replicas:
- Region: eu-west-3
- Region: eu-west-2
BillingMode: PAY_PER_REQUEST
StreamSpecification:
StreamViewType: NEW_AND_OLD_IMAGES
Lambda:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs14.x
Handler: index.handler
InlineCode: autofill-delete-test-lambda
EventRule:
Type: AWS::Events::Rule
Properties:
Name: autofill-delete-test-eventrule
EventBusName: default
EventPattern:
source:
- autofill-delete-test-rule
State: "DISABLED"
EventArchive:
Type: AWS::Events::Archive
Properties:
ArchiveName: autofill-delete-test-archive
SourceArn: !Sub arn:${AWS::Partition}:events:${AWS::Region}:${AWS::AccountId}:event-bus/default
EventConnection:
Type: AWS::Events::Connection
Properties:
Name: autofill-delete-test-connection
AuthorizationType: API_KEY
AuthParameters:
ApiKeyAuthParameters:
ApiKeyName: autofill-delete-test-apikey
ApiKeyValue: autofill-delete-test-value
EventApiDestination:
Type: AWS::Events::ApiDestination
Properties:
Name: autofill-delete-test-apidestination
ConnectionArn: !GetAtt EventConnection.Arn
HttpMethod: GET
InvocationEndpoint: https://example.com
EventBridgeGlobalEndpointHealthCheck:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://global-endpoint-downloads.s3.amazonaws.com/global-endpoint-healthcheck.yaml
EventBridgeGlobalEndpoint:
Type: AWS::Events::Endpoint
Properties:
Name: autofill-delete-test-globalendpoint
EventBuses:
- EventBusArn: !Sub arn:${AWS::Partition}:events:eu-west-3:${AWS::AccountId}:event-bus/default
- EventBusArn: !Sub arn:${AWS::Partition}:events:eu-west-2:${AWS::AccountId}:event-bus/default
ReplicationConfig:
State: DISABLED
RoutingConfig:
FailoverConfig:
Primary:
HealthCheck: !Sub arn:${AWS::Partition}:route53:::healthcheck/${EventBridgeGlobalEndpointHealthCheck.Outputs.HealthCheckId}
Secondary:
Route: eu-west-2
EventSchemaRegistry:
Type: AWS::EventSchemas::Registry
Properties:
RegistryName: autofill-delete-test-registry
EventSchemaSchema:
Type: AWS::EventSchemas::Schema
Properties:
RegistryName: !GetAtt EventSchemaRegistry.RegistryName
SchemaName: autofill-delete-test-schema@schema
Type: OpenApi3
Content: '{"openapi":"3.0.0","info":{"version": "1.0.0","title":""},"paths": {}}'
UserPool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: autofill-delete-test-pool
LambdaConfig:
CustomMessage: !GetAtt Lambda.Arn
UserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
ClientName: autofill-delete-test-client
UserPoolId: !Ref UserPool
UserPoolDomain:
Type: AWS::Cognito::UserPoolDomain
Properties:
Domain: autofill-delete-test-domain
UserPoolId: !Ref UserPool
UserPoolIdentityProvider:
Type: AWS::Cognito::UserPoolIdentityProvider
Properties:
UserPoolId: !Ref UserPool
ProviderName: LoginWithAmazon
ProviderType: LoginWithAmazon
ProviderDetails:
client_id: autofill-delete
client_secret: autofill-delete
authorize_scopes: autofill-delete
AttributeMapping:
username: user_id
UserPoolGroup:
Type: AWS::Cognito::UserPoolGroup
Properties:
GroupName: autofill-delete-test-group
UserPoolId: !Ref UserPool
UserPoolUser:
Type: AWS::Cognito::UserPoolUser
Properties:
MessageAction: SUPPRESS
Username: autofill-delete-test-user
UserPoolId: !Ref UserPool
ApiGateway:
Type: AWS::ApiGateway::RestApi
Properties:
Name: autofill-delete-test-api
# VpcFlowLog:
# Type: AWS::EC2::FlowLog
# Properties:
# LogDestinationType: s3
# LogDestination: !GetAtt Bucket.Arn
# ResourceId: !Ref DefaultVpcId
# ResourceType: VPC
# TrafficType: ALL
# VpcEgressOnlyIG:
# Type: AWS::EC2::EgressOnlyInternetGateway
# Properties:
# VpcId: !Ref DefaultVpcId
# VpcEndpoint:
# Type: AWS::EC2::VPCEndpoint
# Properties:
# ServiceName: !Sub com.amazonaws.${AWS::Region}.s3
# VpcEndpointType: Gateway
# VpcId: !Ref DefaultVpcId
# NatGateway:
# Type: AWS::EC2::NatGateway
# Properties:
# ConnectivityType: private
# SubnetId: !Ref DefaultSubnetId
AthenaWorkGroup:
Type: AWS::Athena::WorkGroup
Properties:
Name: autofill-delete-test-workgroup
AthenaDataCatalog:
Type: AWS::Athena::DataCatalog
Properties:
Name: autofill-delete-test-catalog
Type: HIVE
Parameters:
metadata-function: !GetAtt Lambda.Arn
Outputs:
UserPoolId:
Value: !Ref UserPool
Bucket:
Value: !Ref Bucket