Skip to content

Commit 5666289

Browse files
authored
Create resources via EB extensions. Update to supported platform. (#18)
* adding ebextension for ddb tables and sns topic fixing ref for sns email adding env vars setting invalid email for subscription to fail removing resources from CFN template and moving them to ebextension adding sns topic name for IAM role permission * Remove unused sns subscription
1 parent edda947 commit 5666289

File tree

4 files changed

+86
-96
lines changed

4 files changed

+86
-96
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Resources:
2+
UserTable:
3+
Type: AWS::DynamoDB::Table
4+
Properties:
5+
TableName: scorekeep-user
6+
KeySchema:
7+
HashKeyElement: {AttributeName: id, AttributeType: S}
8+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
9+
SessionTable:
10+
Type: AWS::DynamoDB::Table
11+
Properties:
12+
TableName: scorekeep-session
13+
KeySchema:
14+
HashKeyElement: {AttributeName: id, AttributeType: S}
15+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
16+
GameTable:
17+
Type: AWS::DynamoDB::Table
18+
Properties:
19+
TableName: scorekeep-game
20+
AttributeDefinitions:
21+
- AttributeName: "id"
22+
AttributeType: "S"
23+
- AttributeName: "session"
24+
AttributeType: "S"
25+
KeySchema:
26+
- AttributeName: "id"
27+
KeyType: "HASH"
28+
GlobalSecondaryIndexes:
29+
- IndexName: "session-index"
30+
KeySchema:
31+
- AttributeName: "session"
32+
KeyType: "HASH"
33+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
34+
Projection: { ProjectionType: ALL }
35+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
36+
MoveTable:
37+
Type: AWS::DynamoDB::Table
38+
Properties:
39+
TableName: scorekeep-move
40+
AttributeDefinitions:
41+
- AttributeName: "id"
42+
AttributeType: "S"
43+
- AttributeName: "game"
44+
AttributeType: "S"
45+
KeySchema:
46+
- AttributeName: "id"
47+
KeyType: "HASH"
48+
GlobalSecondaryIndexes:
49+
- IndexName: "game-index"
50+
KeySchema:
51+
- AttributeName: "game"
52+
KeyType: "HASH"
53+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
54+
Projection: { ProjectionType: ALL }
55+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
56+
StateTable:
57+
Type: AWS::DynamoDB::Table
58+
Properties:
59+
TableName: scorekeep-state
60+
AttributeDefinitions:
61+
- AttributeName: "id"
62+
AttributeType: "S"
63+
- AttributeName: "game"
64+
AttributeType: "S"
65+
KeySchema:
66+
- AttributeName: "id"
67+
KeyType: "HASH"
68+
GlobalSecondaryIndexes:
69+
- IndexName: "game-index"
70+
KeySchema:
71+
- AttributeName: "game"
72+
KeyType: "HASH"
73+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
74+
Projection: { ProjectionType: ALL }
75+
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}

.ebextensions/env.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
option_settings:
2+
aws:elasticbeanstalk:application:environment:
3+
AWS_REGION: '`{"Ref" : "AWS::Region"}`'
4+
NOTIFICATION_TOPIC: '`{"Ref" : "NotificationTopic"}`'
5+
NOTIFICATION_EMAIL: UPDATE_ME

.ebextensions/sns-topic.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Resources:
2+
NotificationTopic:
3+
Type: AWS::SNS::Topic
4+
Properties:
5+
TopicName: scorekeep-sns-topic

template.yml

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,10 @@ Resources:
2121
ApplicationName: !Ref application
2222
EnvironmentName: BETA
2323
OptionSettings:
24-
- Namespace: aws:elasticbeanstalk:application:environment
25-
OptionName: AWS_REGION
26-
Value: !Ref AWS::Region
27-
- Namespace: aws:elasticbeanstalk:application:environment
28-
OptionName: NOTIFICATION_TOPIC
29-
Value: !Ref notificationTopic
30-
- Namespace: aws:elasticbeanstalk:application:environment
31-
OptionName: NOTIFICATION_EMAIL
32-
Value: !Ref emailAddress
33-
- Namespace: aws:elasticbeanstalk:application:environment
34-
OptionName: USER_TABLE
35-
Value: !Ref userTable
36-
- Namespace: aws:elasticbeanstalk:application:environment
37-
OptionName: SESSION_TABLE
38-
Value: !Ref sessionTable
39-
- Namespace: aws:elasticbeanstalk:application:environment
40-
OptionName: GAME_TABLE
41-
Value: !Ref gameTable
42-
- Namespace: aws:elasticbeanstalk:application:environment
43-
OptionName: MOVE_TABLE
44-
Value: !Ref moveTable
45-
- Namespace: aws:elasticbeanstalk:application:environment
46-
OptionName: STATE_TABLE
47-
Value: !Ref stateTable
4824
- Namespace: aws:autoscaling:launchconfiguration
4925
OptionName: IamInstanceProfile
5026
Value: !Ref instanceProfile
51-
PlatformArn: arn:aws:elasticbeanstalk:::platform/Java 8 running on 64bit Amazon Linux
27+
PlatformArn: arn:aws:elasticbeanstalk:::platform/Corretto 8 running on 64bit Amazon Linux 2
5228
VersionLabel: !Ref version
5329
instanceProfile:
5430
Type: AWS::IAM::InstanceProfile
@@ -99,77 +75,6 @@ Resources:
9975
Effect: Allow
10076
Resource: '*'
10177
Path: /
102-
notificationTopic:
103-
Type: AWS::SNS::Topic
104-
userTable:
105-
Type: AWS::DynamoDB::Table
106-
Properties:
107-
KeySchema:
108-
HashKeyElement: {AttributeName: id, AttributeType: S}
109-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
110-
sessionTable:
111-
Type: AWS::DynamoDB::Table
112-
Properties:
113-
KeySchema:
114-
HashKeyElement: {AttributeName: id, AttributeType: S}
115-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
116-
gameTable:
117-
Type: AWS::DynamoDB::Table
118-
Properties:
119-
AttributeDefinitions:
120-
- AttributeName: "id"
121-
AttributeType: "S"
122-
- AttributeName: "session"
123-
AttributeType: "S"
124-
KeySchema:
125-
- AttributeName: "id"
126-
KeyType: "HASH"
127-
GlobalSecondaryIndexes:
128-
- IndexName: "session-index"
129-
KeySchema:
130-
- AttributeName: "session"
131-
KeyType: "HASH"
132-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
133-
Projection: { ProjectionType: ALL }
134-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
135-
moveTable:
136-
Type: AWS::DynamoDB::Table
137-
Properties:
138-
AttributeDefinitions:
139-
- AttributeName: "id"
140-
AttributeType: "S"
141-
- AttributeName: "game"
142-
AttributeType: "S"
143-
KeySchema:
144-
- AttributeName: "id"
145-
KeyType: "HASH"
146-
GlobalSecondaryIndexes:
147-
- IndexName: "game-index"
148-
KeySchema:
149-
- AttributeName: "game"
150-
KeyType: "HASH"
151-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
152-
Projection: { ProjectionType: ALL }
153-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
154-
stateTable:
155-
Type: AWS::DynamoDB::Table
156-
Properties:
157-
AttributeDefinitions:
158-
- AttributeName: "id"
159-
AttributeType: "S"
160-
- AttributeName: "game"
161-
AttributeType: "S"
162-
KeySchema:
163-
- AttributeName: "id"
164-
KeyType: "HASH"
165-
GlobalSecondaryIndexes:
166-
- IndexName: "game-index"
167-
KeySchema:
168-
- AttributeName: "game"
169-
KeyType: "HASH"
170-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
171-
Projection: { ProjectionType: ALL }
172-
ProvisionedThroughput: {ReadCapacityUnits: 2, WriteCapacityUnits: 2}
17378
Outputs:
17479
endpoint:
17580
Description: Website URL

0 commit comments

Comments
 (0)