Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit918c623

Browse files
committed
Implementando api key
1 parentc0a5deb commit918c623

6 files changed

+183
-48
lines changed
681 Bytes
Binary file not shown.

‎.serverless/api-python-hello.zip

-685 Bytes
Binary file not shown.

‎.serverless/cloudformation-template-update-stack.json

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"HelloLogGroup": {
6060
"Type":"AWS::Logs::LogGroup",
6161
"Properties": {
62-
"LogGroupName":"/aws/lambda/api-python-hello-dev-hello"
62+
"LogGroupName":"/aws/lambda/api-python-hello-world-dev-hello"
6363
}
6464
},
6565
"IamRoleLambdaExecution": {
@@ -87,7 +87,7 @@
8787
"Fn::Join": [
8888
"-",
8989
[
90-
"api-python-hello",
90+
"api-python-hello-world",
9191
"dev",
9292
"lambda"
9393
]
@@ -104,7 +104,7 @@
104104
],
105105
"Resource": [
106106
{
107-
"Fn::Sub":"arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/api-python-hello-dev*:*"
107+
"Fn::Sub":"arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/api-python-hello-world-dev*:*"
108108
}
109109
]
110110
},
@@ -115,7 +115,7 @@
115115
],
116116
"Resource": [
117117
{
118-
"Fn::Sub":"arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/api-python-hello-dev*:*:*"
118+
"Fn::Sub":"arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/api-python-hello-world-dev*:*:*"
119119
}
120120
]
121121
}
@@ -128,7 +128,7 @@
128128
"Fn::Join": [
129129
"-",
130130
[
131-
"api-python-hello",
131+
"api-python-hello-world",
132132
"dev",
133133
{
134134
"Ref":"AWS::Region"
@@ -146,9 +146,9 @@
146146
"S3Bucket": {
147147
"Ref":"ServerlessDeploymentBucket"
148148
},
149-
"S3Key":"serverless/api-python-hello/dev/1606248586685-2020-11-24T20:09:46.685Z/api-python-hello.zip"
149+
"S3Key":"serverless/api-python-hello-world/dev/1606250373036-2020-11-24T20:39:33.036Z/api-python-hello-world.zip"
150150
},
151-
"FunctionName":"api-python-hello-dev-hello",
151+
"FunctionName":"api-python-hello-world-dev-hello",
152152
"Handler":"src/item.hello_world",
153153
"MemorySize":256,
154154
"Role": {
@@ -164,20 +164,20 @@
164164
"HelloLogGroup"
165165
]
166166
},
167-
"HelloLambdaVersionbrsv1dQsuJy0Qja74BCKLyJQemjSjLFJQUVpAoyg": {
167+
"HelloLambdaVersion17IOIygMGs2nmaA3r9vypDFb4y68JKXVJYQxmT6sU": {
168168
"Type":"AWS::Lambda::Version",
169169
"DeletionPolicy":"Retain",
170170
"Properties": {
171171
"FunctionName": {
172172
"Ref":"HelloLambdaFunction"
173173
},
174-
"CodeSha256":"sEHE9M3amoN0VMstD+yFUwGrZobD2+TTpuCXXlWajJM="
174+
"CodeSha256":"xUV5Bo8pL1R46jPSEfLDg6FHEMl6K0YNrTxoeX2D2BE="
175175
}
176176
},
177177
"ApiGatewayRestApi": {
178178
"Type":"AWS::ApiGateway::RestApi",
179179
"Properties": {
180-
"Name":"dev-api-python-hello",
180+
"Name":"dev-api-python-hello-world",
181181
"EndpointConfiguration": {
182182
"Types": [
183183
"EDGE"
@@ -213,30 +213,30 @@
213213
}
214214
}
215215
},
216-
"ApiGatewayResourceApiPythonHello": {
216+
"ApiGatewayResourceApiPythonHelloDashworld": {
217217
"Type":"AWS::ApiGateway::Resource",
218218
"Properties": {
219219
"ParentId": {
220220
"Ref":"ApiGatewayResourceApiPython"
221221
},
222-
"PathPart":"hello",
222+
"PathPart":"hello-world",
223223
"RestApiId": {
224224
"Ref":"ApiGatewayRestApi"
225225
}
226226
}
227227
},
228-
"ApiGatewayMethodApiPythonHelloGet": {
228+
"ApiGatewayMethodApiPythonHelloDashworldGet": {
229229
"Type":"AWS::ApiGateway::Method",
230230
"Properties": {
231231
"HttpMethod":"GET",
232232
"RequestParameters": {},
233233
"ResourceId": {
234-
"Ref":"ApiGatewayResourceApiPythonHello"
234+
"Ref":"ApiGatewayResourceApiPythonHelloDashworld"
235235
},
236236
"RestApiId": {
237237
"Ref":"ApiGatewayRestApi"
238238
},
239-
"ApiKeyRequired":false,
239+
"ApiKeyRequired":true,
240240
"AuthorizationType":"NONE",
241241
"Integration": {
242242
"IntegrationHttpMethod":"POST",
@@ -375,7 +375,7 @@
375375
]
376376
}
377377
},
378-
"ApiGatewayDeployment1606248585073": {
378+
"ApiGatewayDeployment1606250371399": {
379379
"Type":"AWS::ApiGateway::Deployment",
380380
"Properties": {
381381
"RestApiId": {
@@ -384,9 +384,53 @@
384384
"StageName":"dev"
385385
},
386386
"DependsOn": [
387-
"ApiGatewayMethodApiPythonHelloGet"
387+
"ApiGatewayMethodApiPythonHelloDashworldGet"
388388
]
389389
},
390+
"ApiGatewayApiKey1": {
391+
"Type":"AWS::ApiGateway::ApiKey",
392+
"Properties": {
393+
"Enabled":true,
394+
"Name":"myKey",
395+
"StageKeys": [
396+
{
397+
"RestApiId": {
398+
"Ref":"ApiGatewayRestApi"
399+
},
400+
"StageName":"dev"
401+
}
402+
]
403+
},
404+
"DependsOn":"ApiGatewayDeployment1606250371399"
405+
},
406+
"ApiGatewayUsagePlan": {
407+
"Type":"AWS::ApiGateway::UsagePlan",
408+
"DependsOn":"ApiGatewayDeployment1606250371399",
409+
"Properties": {
410+
"ApiStages": [
411+
{
412+
"ApiId": {
413+
"Ref":"ApiGatewayRestApi"
414+
},
415+
"Stage":"dev"
416+
}
417+
],
418+
"Description":"Usage plan for api-python-hello-world dev stage",
419+
"UsagePlanName":"api-python-hello-world-dev"
420+
}
421+
},
422+
"ApiGatewayUsagePlanKey1": {
423+
"Type":"AWS::ApiGateway::UsagePlanKey",
424+
"Properties": {
425+
"KeyId": {
426+
"Ref":"ApiGatewayApiKey1"
427+
},
428+
"KeyType":"API_KEY",
429+
"UsagePlanId": {
430+
"Ref":"ApiGatewayUsagePlan"
431+
}
432+
}
433+
},
390434
"HelloLambdaPermissionApiGateway": {
391435
"Type":"AWS::Lambda::Permission",
392436
"Properties": {
@@ -434,7 +478,7 @@
434478
"HelloLambdaFunctionQualifiedArn": {
435479
"Description":"Current Lambda function version",
436480
"Value": {
437-
"Ref":"HelloLambdaVersionbrsv1dQsuJy0Qja74BCKLyJQemjSjLFJQUVpAoyg"
481+
"Ref":"HelloLambdaVersion17IOIygMGs2nmaA3r9vypDFb4y68JKXVJYQxmT6sU"
438482
}
439483
},
440484
"ServiceEndpoint": {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp