-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate_provision.yml
126 lines (118 loc) · 3.36 KB
/
template_provision.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
DomainName:
Type: String
GitHubRepoPath:
Type: String
Resources:
ReviewsTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: reviews
AttributeDefinitions:
- AttributeName: username
AttributeType: S
- AttributeName: api_info
AttributeType: S
- AttributeName: latest_watch_date
AttributeType: S
- AttributeName: ep_progress
AttributeType: N
- AttributeName: special_progress
AttributeType: N
- AttributeName: rating
AttributeType: N
- AttributeName: state
AttributeType: S
- AttributeName: backlog_date
AttributeType: S
KeySchema:
- AttributeName: username
KeyType: HASH
- AttributeName: api_info
KeyType: RANGE
BillingMode:
PAY_PER_REQUEST
GlobalSecondaryIndexes:
- IndexName: api_info
KeySchema:
- AttributeName: api_info
KeyType: HASH
Projection:
ProjectionType: ALL
- IndexName: backlog_date
KeySchema:
- AttributeName: username
KeyType: HASH
- AttributeName: backlog_date
KeyType: RANGE
Projection:
ProjectionType: ALL
LocalSecondaryIndexes:
- IndexName: latest_watch_date
KeySchema:
- AttributeName: username
KeyType: HASH
- AttributeName: latest_watch_date
KeyType: RANGE
Projection:
ProjectionType: ALL
- IndexName: ep_progress
KeySchema:
- AttributeName: username
KeyType: HASH
- AttributeName: ep_progress
KeyType: RANGE
Projection:
ProjectionType: ALL
- IndexName: special_progress
KeySchema:
- AttributeName: username
KeyType: HASH
- AttributeName: special_progress
KeyType: RANGE
Projection:
ProjectionType: ALL
- IndexName: rating
KeySchema:
- AttributeName: username
KeyType: HASH
- AttributeName: rating
KeyType: RANGE
Projection:
ProjectionType: ALL
- IndexName: state
KeySchema:
- AttributeName: username
KeyType: HASH
- AttributeName: state
KeyType: RANGE
Projection:
ProjectionType: ALL
# HostedZone:
# Type: AWS::Route53::HostedZone
# Properties:
# Name: !Ref DomainName
GithubOidc:
Type: AWS::IAM::OIDCProvider
Properties:
Url: https://token.actions.githubusercontent.com
ClientIdList:
- sts.amazonaws.com
ThumbprintList:
- 6938fd4d98bab03faadb97b34396831e3780aea1
GitHubRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Action: sts:AssumeRoleWithWebIdentity
Principal:
Federated:
- !Ref GithubOidc
Condition:
StringLike:
token.actions.githubusercontent.com:sub: !Sub repo:${GitHubRepoPath}:*