Skip to content

Commit

Permalink
dynamo permissions
Browse files Browse the repository at this point in the history
Prod in path
  • Loading branch information
wbornor committed Jan 1, 2024
1 parent ddf6a4b commit 8735b87
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def my_schema():
"version": DOCS_VERSION,
"description": "REST Interface for Splaysh",
"servers": [
{"url": "https://merymlbcs3.execute-api.us-east-1.amazonaws.com/Prod"}
{"url": "https://merymlbcs3.execute-api.us-east-1.amazonaws.com/Prod", "description": "Dev environment"}
],
"license": {
"name": "Apache 2.0",
Expand Down
2 changes: 1 addition & 1 deletion app/routers/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self, items_domain: ItemsDomain) -> None:

@property
def router(self):
api_router = APIRouter(prefix='/items', tags=['items'])
api_router = APIRouter(prefix='/Prod/items', tags=['items'])

@api_router.get('/', summary='List the latest items')
def index_route() -> list[ItemModel]:
Expand Down
15 changes: 15 additions & 0 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ Resources:
Method: ANY
FunctionUrlConfig:
AuthType: NONE
Policies:
- Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: '*'
- Statement:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
Resource: 'splayshdb.*.items'

Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
Expand Down

0 comments on commit 8735b87

Please sign in to comment.