Skip to content

Commit

Permalink
Switch from REST to either function URLs or HTTP API
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkins committed Jun 22, 2024
1 parent 84bcfff commit a262fc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"project_name": "Project Name",
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '').replace('-', '').replace('_', '') }}",
"arch": ["arm64", "x86_64"],
"function_url": "y",
"vpc": "n",
"_copy_without_render": [
".github/workflows/*.yml"
Expand Down
13 changes: 9 additions & 4 deletions {{cookiecutter.project_slug}}/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ provider:
stage: ${opt:stage, "production"}
region: eu-west-2
logRetentionInDays: 30
apiGateway:
description: "{{ cookiecutter.project_name }}"
{%- if cookiecutter.function_url != 'y' %}
httpApi:
shouldStartNameWithService: true
{%- endif %}
{%- if cookiecutter.vpc == 'y' %}
vpc:
securityGroupIds:
Expand All @@ -32,8 +34,11 @@ resources:
functions:
app:
description: "{{ cookiecutter.project_name }} - app"
{%- if cookiecutter.function_url == 'y' %}
url: true
{%- else %}
events:
- http: ANY /
- http: 'ANY /{proxy+}'
- httpApi: '*'
{%- endif %}
image:
uri: 253670703218.dkr.ecr.eu-west-2.amazonaws.com/${self:service}-${sls:stage}:latest

0 comments on commit a262fc2

Please sign in to comment.