Skip to content

Commit cf20178

Browse files
committed
Fix SLS.yml
1 parent 2217161 commit cf20178

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

serverless.yml

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ provider:
2626
- dynamodb:Query
2727
- dynamodb:UpdateItem
2828
Resource:
29-
- "Fn::Join": ["", ["arn:aws:dynamodb:", {"Ref": "AWS::Region"}, ":", {"Ref": "AWS::AccountId"}, ":table/items*"]]
29+
- "Fn::Join":
30+
[
31+
"",
32+
[
33+
"arn:aws:dynamodb:",
34+
{ "Ref": "AWS::Region" },
35+
":",
36+
{ "Ref": "AWS::AccountId" },
37+
":table/items*",
38+
],
39+
]
3040

3141
package:
3242
individually: true
@@ -35,8 +45,8 @@ custom:
3545
customDomain:
3646
domainName: sls-api.603.nz
3747
stage: ${self:provider.stage}
38-
certificateArn: ${env:TF_VAR_acm_arn}
39-
hostedZoneId: ${env:TF_VAR_route53_zone_id}
48+
certificateArn: ${env:TF_VAR_acm_arn, ""}
49+
hostedZoneId: ${env:TF_VAR_route53_zone_id, ""}
4050
webpack:
4151
webpackConfig: ./webpack.config.ts
4252
packager: "yarn"
@@ -158,43 +168,43 @@ resources:
158168
Properties:
159169
TableName: "items"
160170
AttributeDefinitions:
161-
- AttributeName: "id"
162-
AttributeType: "S"
163-
- AttributeName: "userId"
164-
AttributeType: "S"
171+
- AttributeName: "id"
172+
AttributeType: "S"
173+
- AttributeName: "userId"
174+
AttributeType: "S"
165175
KeySchema:
166-
- AttributeName: "id"
167-
KeyType: "HASH"
168-
- AttributeName: "userId"
169-
KeyType: "RANGE"
176+
- AttributeName: "id"
177+
KeyType: "HASH"
178+
- AttributeName: "userId"
179+
KeyType: "RANGE"
170180
ProvisionedThroughput:
171181
ReadCapacityUnits: 1
172182
WriteCapacityUnits: 1
173183
GlobalSecondaryIndexes:
174-
- IndexName: "userId-index"
175-
KeySchema:
176-
- AttributeName: "userId"
177-
KeyType: "HASH"
178-
Projection:
179-
ProjectionType: "ALL"
180-
ProvisionedThroughput:
181-
ReadCapacityUnits: 1
182-
WriteCapacityUnits: 1
184+
- IndexName: "userId-index"
185+
KeySchema:
186+
- AttributeName: "userId"
187+
KeyType: "HASH"
188+
Projection:
189+
ProjectionType: "ALL"
190+
ProvisionedThroughput:
191+
ReadCapacityUnits: 1
192+
WriteCapacityUnits: 1
183193
GatewayResponseDefault4XX:
184-
Type: 'AWS::ApiGateway::GatewayResponse'
194+
Type: "AWS::ApiGateway::GatewayResponse"
185195
Properties:
186196
ResponseParameters:
187197
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
188198
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
189199
ResponseType: DEFAULT_4XX
190200
RestApiId:
191-
Ref: 'ApiGatewayRestApi'
201+
Ref: "ApiGatewayRestApi"
192202
GatewayResponseDefault5XX:
193-
Type: 'AWS::ApiGateway::GatewayResponse'
203+
Type: "AWS::ApiGateway::GatewayResponse"
194204
Properties:
195205
ResponseParameters:
196206
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
197207
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
198208
ResponseType: DEFAULT_5XX
199209
RestApiId:
200-
Ref: 'ApiGatewayRestApi'
210+
Ref: "ApiGatewayRestApi"

0 commit comments

Comments
 (0)