Skip to content

Commit 2f4e455

Browse files
author
Dabit
committed
updated to new backend
1 parent 6ac9520 commit 2f4e455

35 files changed

+2118
-4267
lines changed

.DS_Store

6 KB
Binary file not shown.

amplify/.DS_Store

6 KB
Binary file not shown.

amplify/backend/api/blogamplified/schema.graphql

Lines changed: 0 additions & 40 deletions
This file was deleted.

amplify/backend/api/blogamplified/parameters.json renamed to amplify/backend/api/jamstackcms/parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"AppSyncApiName": "blogamplified",
2+
"AppSyncApiName": "jamstackcms",
33
"DynamoDBBillingMode": "PAY_PER_REQUEST",
44
"DynamoDBEnableServerSideEncryption": "false",
55
"AuthCognitoUserPoolId": {
66
"Fn::GetAtt": [
7-
"authblogamplifiedc9ee2ce6",
7+
"authjamstackcmsc9ee2ce6",
88
"Outputs.UserPoolId"
99
]
1010
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
type Post @model
2+
@auth (
3+
rules: [
4+
{ allow: groups, groups: ["Admin"], operations: [create, update, delete] },
5+
{ allow: private, operations: [read] },
6+
{ allow: public, operations: [read] }
7+
]
8+
) {
9+
id: ID!
10+
title: String!
11+
description: String
12+
content: String!
13+
cover_image: String
14+
createdAt: String
15+
published: Boolean
16+
previewEnabled: Boolean
17+
categories: [String]
18+
author: User @connection
19+
}
20+
21+
type Comment @model @auth(
22+
rules: [
23+
{ allow: groups, groups: ["Admin"], operations: [create, update, delete] },
24+
{ allow: owner, ownerField: "createdBy", operations: [create, update, delete] }
25+
]
26+
) {
27+
id: ID!
28+
message: String!
29+
createdBy: String
30+
createdAt: String
31+
}
32+
33+
type Settings @model @auth(rules: [
34+
{ allow: groups, groups: ["Admin"] },
35+
{ allow: groups, groupsField: "adminGroups"},
36+
{ allow: public, operations: [read] },
37+
]) {
38+
id: ID!
39+
categories: [String]
40+
adminGroups: [String]
41+
theme: String
42+
border: String
43+
borderWidth: Int
44+
description: String
45+
}
46+
47+
type Preview @model
48+
@auth (
49+
rules: [
50+
{ allow: groups, groups: ["Admin"] },
51+
{ allow: private, operations: [read] }
52+
]
53+
) {
54+
id: ID!
55+
title: String!
56+
description: String
57+
content: String!
58+
cover_image: String
59+
createdAt: String
60+
categories: [String]
61+
}
62+
63+
type Page @model(subscriptions: null)
64+
@auth (
65+
rules: [
66+
{ allow: groups, groups: ["Admin"] },
67+
{ allow: private, operations: [read] },
68+
{ allow: public, operations: [read] }
69+
]
70+
)
71+
{
72+
id: ID!
73+
name: String!
74+
slug: String!
75+
content: String!
76+
components: String
77+
published: Boolean
78+
}
79+
80+
type User @model
81+
@auth(rules: [
82+
{ allow: owner },
83+
{ allow: groups, groups: ["Admin"]},
84+
{ allow: public, operations: [read] }
85+
])
86+
{
87+
id: ID!
88+
name: String
89+
username: String
90+
avatarUrl: String
91+
}

amplify/backend/auth/blogamplifiedc9ee2ce6/blogamplifiedc9ee2ce6-cloudformation-template.yml renamed to amplify/backend/auth/jamstackcmsc9ee2ce6/jamstackcmsc9ee2ce6-cloudformation-template.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Parameters:
1111

1212

1313

14-
functionblogamplifiedc9ee2ce6PostConfirmationArn:
14+
functionjamstackcmsc9ee2ce6PostConfirmationArn:
1515
Type: String
16-
Default: functionblogamplifiedc9ee2ce6PostConfirmationArn
16+
Default: functionjamstackcmsc9ee2ce6PostConfirmationArn
1717

18-
functionblogamplifiedc9ee2ce6PostConfirmationName:
18+
functionjamstackcmsc9ee2ce6PostConfirmationName:
1919
Type: String
20-
Default: functionblogamplifiedc9ee2ce6PostConfirmationName
20+
Default: functionjamstackcmsc9ee2ce6PostConfirmationName
2121

2222

2323

@@ -124,7 +124,7 @@ Resources:
124124
# Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process
125125
Type: AWS::IAM::Role
126126
Properties:
127-
RoleName: !If [ShouldNotCreateEnvResources, 'blogamc9ee2ce6_sns-role', !Join ['',['blogamc9ee2ce6_sns-role', '-', !Ref env]]]
127+
RoleName: !If [ShouldNotCreateEnvResources, 'jamcmsc9ee2ce6_sns-role', !Join ['',['jamcmsc9ee2ce6_sns-role', '-', !Ref env]]]
128128
AssumeRolePolicyDocument:
129129
Version: "2012-10-17"
130130
Statement:
@@ -136,10 +136,10 @@ Resources:
136136
- "sts:AssumeRole"
137137
Condition:
138138
StringEquals:
139-
sts:ExternalId: blogamc9ee2ce6_role_external_id
139+
sts:ExternalId: jamcmsc9ee2ce6_role_external_id
140140
Policies:
141141
-
142-
PolicyName: blogamc9ee2ce6-sns-policy
142+
PolicyName: jamcmsc9ee2ce6-sns-policy
143143
PolicyDocument:
144144
Version: "2012-10-17"
145145
Statement:
@@ -172,7 +172,7 @@ Resources:
172172

173173

174174

175-
PostConfirmation: !Ref functionblogamplifiedc9ee2ce6PostConfirmationArn
175+
PostConfirmation: !Ref functionjamstackcmsc9ee2ce6PostConfirmationArn
176176

177177

178178

@@ -198,7 +198,7 @@ Resources:
198198
SmsVerificationMessage: !Ref smsVerificationMessage
199199
SmsConfiguration:
200200
SnsCallerArn: !GetAtt SNSRole.Arn
201-
ExternalId: blogamc9ee2ce6_role_external_id
201+
ExternalId: jamcmsc9ee2ce6_role_external_id
202202

203203

204204

@@ -212,7 +212,7 @@ Resources:
212212
Properties:
213213
Action: "lambda:invokeFunction"
214214
Principal: "cognito-idp.amazonaws.com"
215-
FunctionName: !Ref functionblogamplifiedc9ee2ce6PostConfirmationName
215+
FunctionName: !Ref functionjamstackcmsc9ee2ce6PostConfirmationName
216216
SourceArn: !GetAtt UserPool.Arn
217217

218218

@@ -222,10 +222,10 @@ Resources:
222222
# Updating lambda role with permissions to Cognito
223223

224224

225-
blogamplifiedc9ee2ce6PostConfirmationAddToGroupCognito:
225+
jamstackcmsc9ee2ce6PostConfirmationAddToGroupCognito:
226226
Type: AWS::IAM::Policy
227227
Properties:
228-
PolicyName: blogamplifiedc9ee2ce6PostConfirmationAddToGroupCognito
228+
PolicyName: jamstackcmsc9ee2ce6PostConfirmationAddToGroupCognito
229229
PolicyDocument:
230230
Version: '2012-10-17'
231231
Statement:
@@ -250,7 +250,7 @@ Resources:
250250

251251

252252
Roles:
253-
- !Join ['',["blogamplifiedc9ee2ce6PostConfirmation", '-', !Ref env]]
253+
- !Join ['',["jamstackcmsc9ee2ce6PostConfirmation", '-', !Ref env]]
254254

255255

256256

@@ -259,7 +259,7 @@ Resources:
259259
# Depends on UserPool for ID reference
260260
Type: "AWS::Cognito::UserPoolClient"
261261
Properties:
262-
ClientName: blogamc9ee2ce6_app_clientWeb
262+
ClientName: jamcmsc9ee2ce6_app_clientWeb
263263

264264
RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
265265
UserPoolId: !Ref UserPool
@@ -269,7 +269,7 @@ Resources:
269269
# Depends on UserPool for ID reference
270270
Type: "AWS::Cognito::UserPoolClient"
271271
Properties:
272-
ClientName: blogamc9ee2ce6_app_client
272+
ClientName: jamcmsc9ee2ce6_app_client
273273

274274
GenerateSecret: !Ref userpoolClientGenerateSecret
275275
RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
@@ -334,7 +334,7 @@ Resources:
334334
# Marked as depending on UserPoolClientRole for easier to understand CFN sequencing
335335
Type: 'AWS::IAM::Policy'
336336
Properties:
337-
PolicyName: blogamc9ee2ce6_userpoolclient_lambda_iam_policy
337+
PolicyName: jamcmsc9ee2ce6_userpoolclient_lambda_iam_policy
338338
Roles:
339339
- !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
340340
PolicyDocument:
@@ -351,7 +351,7 @@ Resources:
351351
# Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
352352
Type: 'AWS::IAM::Policy'
353353
Properties:
354-
PolicyName: blogamc9ee2ce6_userpoolclient_lambda_log_policy
354+
PolicyName: jamcmsc9ee2ce6_userpoolclient_lambda_log_policy
355355
Roles:
356356
- !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
357357
PolicyDocument:
@@ -391,7 +391,7 @@ Resources:
391391
# Always created
392392
Type: AWS::Cognito::IdentityPool
393393
Properties:
394-
IdentityPoolName: !If [ShouldNotCreateEnvResources, 'blogamplifiedc9ee2ce6_identitypool_c9ee2ce6', !Join ['',['blogamplifiedc9ee2ce6_identitypool_c9ee2ce6', '__', !Ref env]]]
394+
IdentityPoolName: !If [ShouldNotCreateEnvResources, 'jamstackcmsc9ee2ce6_identitypool_c9ee2ce6', !Join ['',['jamstackcmsc9ee2ce6_identitypool_c9ee2ce6', '__', !Ref env]]]
395395

396396
CognitoIdentityProviders:
397397
- ClientId: !Ref UserPoolClient

amplify/backend/auth/blogamplifiedc9ee2ce6/parameters.json renamed to amplify/backend/auth/jamstackcmsc9ee2ce6/parameters.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"identityPoolName": "blogamplifiedc9ee2ce6_identitypool_c9ee2ce6",
2+
"identityPoolName": "jamstackcmsc9ee2ce6_identitypool_c9ee2ce6",
33
"allowUnauthenticatedIdentities": true,
4-
"resourceNameTruncated": "blogamc9ee2ce6",
5-
"userPoolName": "blogamplifiedc9ee2ce6_userpool_c9ee2ce6",
4+
"resourceNameTruncated": "jamcmsc9ee2ce6",
5+
"userPoolName": "jamstackcmsc9ee2ce6_userpool_c9ee2ce6",
66
"autoVerifiedAttributes": [
77
"email"
88
],
@@ -28,9 +28,9 @@
2828
"userpoolClientReadAttributes": [
2929
"email"
3030
],
31-
"userpoolClientLambdaRole": "blogamc9ee2ce6_userpoolclient_lambda_role",
31+
"userpoolClientLambdaRole": "jamcmsc9ee2ce6_userpoolclient_lambda_role",
3232
"userpoolClientSetAttributes": false,
33-
"resourceName": "blogamplifiedc9ee2ce6",
33+
"resourceName": "jamstackcmsc9ee2ce6",
3434
"authSelections": "identityPoolAndUserPool",
3535
"authRoleArn": {
3636
"Fn::GetAtt": [
@@ -48,7 +48,7 @@
4848
"dependsOn": [
4949
{
5050
"category": "function",
51-
"resourceName": "blogamplifiedc9ee2ce6PostConfirmation",
51+
"resourceName": "jamstackcmsc9ee2ce6PostConfirmation",
5252
"triggerProvider": "Cognito",
5353
"attributes": [
5454
"Arn",

0 commit comments

Comments
 (0)