Skip to content

Commit

Permalink
Merge pull request #31 from FIAP-Tech-Chalenge/features
Browse files Browse the repository at this point in the history
adiciona variaveis com referencias no template
  • Loading branch information
Perkles authored May 5, 2024
2 parents e16d578 + b6c7d97 commit 3874e05
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ jobs:
with:
role-to-assume: arn:aws:iam::175081627259:role/tech-challenge-oicd-githubactions
aws-region: us-east-1
# Build inside Docker containers

- run: sam build
# Prevent prompts and failure when the stack is unchanged
- run: |
sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --resolve-s3 \
--parameter-overrides \
UserPoolId=${{ secrets.USERPOOLID }}, ClientId=${{ secrets.CLIENTID }}
UserPoolId=${{ secrets.USERPOOLID }} ClientId=${{ secrets.CLIENTID }}
35 changes: 13 additions & 22 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,35 @@ Transform: AWS::Serverless-2016-10-31
Description: >
tech-challenge-lambda
Função Lambda para autenticação de um usuário via CPF - FIAP Tech Challenge
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Função Lambda para autenticacao de um usuário via CPF - FIAP Tech Challenge
Globals:
Function:
Timeout: 3

Parameters:
UserPoolId:
Type: String
ClientId:
Type: String

Resources:
AuthenticationFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Type: AWS::Serverless::Function
Properties:
CodeUri: authenticate/
Handler: app.lambdaHandler
Runtime: nodejs18.x
# Role: !GetAtt AuthenticationFunctionRole.Arn
Architectures:
- x86_64
Events:
Authentication:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Type: Api
Properties:
Path: /authenticate
Method: post
Environment:
Variables:
UserPoolId: "default-userpool-id"
ClientId: "default-client-id"

# Outputs:
# # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# # Find out more about other implicit resources you can reference within SAM
# # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
# AuthenticatonApi:
# Description: "API Gateway endpoint URL for Prod stage for Hello World function"
# Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
# LabRoleFuncion:
# Description: "Hello World Lambda Function ARN"
# Value: !GetAtt LabRole.Arn
# LabRoleFuncionIamRole:
# Description: "Implicit IAM Role created for Hello World function"
# Value: !GetAtt LabRole.Arn
UserPoolId: !Ref UserPoolId
ClientId: !Ref ClientId

0 comments on commit 3874e05

Please sign in to comment.