diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 4c53248..9a87786 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -42,5 +42,5 @@ jobs: - name: SAM Deploy working-directory: ./packages/api run: - yes | sam deploy --stack-name wakeup-fullstack-challenge-api --capabilities CAPABILITY_IAM + yes | sam deploy --stack-name wakeup-fullstack-challenge-api --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM diff --git a/packages/api/template.yaml b/packages/api/template.yaml index 5859ae4..2bef4b3 100644 --- a/packages/api/template.yaml +++ b/packages/api/template.yaml @@ -1,4 +1,4 @@ -AWSTemplateFormatVersion: "2010-09-09" +AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: Api @@ -9,18 +9,18 @@ Globals: Resources: ExecutionRole: Type: AWS::IAM::Role - Properties: + Properties: + RoleName: APIExecutionRole AssumeRolePolicyDocument: - Version: '2012-10-17' + Version: '2012-10-17' Statement: - Effect: Allow Principal: Service: 'lambda.amazonaws.com' Action: 'sts:AssumeRole' - ManagedPolicyArns: - -arn:aws:iam::aws:policy/DynamoDBCrudPolicy - RoleName: APIExecutionRole - + Roles: + - DynamoDBCrudPolicy + MyApi: Type: AWS::Serverless::Api Properties: @@ -94,7 +94,7 @@ Resources: Method: GET Path: /orders RestApiId: !Ref MyApi - + GetRestaurantsFunction: Type: AWS::Serverless::Function Properties: