Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task3.2: create lambda function for product item #14

Merged
merged 1 commit into from
Oct 17, 2022
Merged

task3.2: create lambda function for product item #14

merged 1 commit into from
Oct 17, 2022

Conversation

Guria
Copy link
Owner

@Guria Guria commented Oct 17, 2022

✔️ Create a lambda function called getProductsById in Product Service which will be triggered by the HTTP GET method.
✔️ The requested URL should be /products/{productId}
✔️ The response from the lambda should be 1 searched product from an array of products (mock data should be used).

Extra effort:

  • This endpoint is integrated with Frontend app. New route and components set is created
  • Business logic moved from handler code to a service class

✔️ Create a lambda function called `getProductsById` in Product Service which will be triggered by the HTTP GET method.
✔️ The requested URL should be `/products/{productId}`
✔️ The response from the lambda should be 1 searched product from an array of products (mock data should be used).

Extra effort:
* This endpoint is integrated with Frontend app. New route and components set is created
* Business logic moved from handler code to a service class
@github-actions
Copy link

Build output

Deploying to stage task3-2
api-gw › waiting
products-api › waiting
shop-frontend-app › waiting
api-gw › deploying
api-gw › Running "serverless deploy --stage task3-2"
api-gw › Deploying aws-js-practitioner-api to stage task3-2 (us-east-1)
api-gw › ✔ Service deployed to stack aws-js-practitioner-api-task3-2 (67s)
api-gw › Running "serverless info --verbose --stage task3-2"
api-gw › service: aws-js-practitioner-api
api-gw › stage: task3-2
api-gw › region: us-east-1
api-gw › stack: aws-js-practitioner-api-task3-2
api-gw ›
api-gw › Stack Outputs:
api-gw › apiGatewayRestApiId: zabaem78r9
api-gw › apiGatewayRestApiRootResourceId: nfv9sigcod
api-gw › ServerlessDeploymentBucketName: aws-js-practitioner-api-serverlessdeploymentbuck-1ht8rlwq2x81w
api-gw › deployed
products-api › deploying
products-api › Running "serverless deploy --stage task3-2 --param apiGatewayRestApiId=zabaem78r9 --param apiGatewayRestApiRootResourceId=nfv9sigcod"
products-api › Deploying products-api to stage task3-2 (us-east-1)
products-api › ✔ Service deployed to stack products-api-task3-2 (126s)
products-api › endpoints:
products-api › GET - https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2/products
products-api › GET - https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2/products/{productId}
products-api › functions:
products-api › getProductsList: products-api-task3-2-getProductsList (139 kB)
products-api › getProductById: products-api-task3-2-getProductById (139 kB)
products-api › Running "serverless info --verbose --stage task3-2 --param apiGatewayRestApiId=zabaem78r9 --param apiGatewayRestApiRootResourceId=nfv9sigcod"
products-api › service: products-api
products-api › stage: task3-2
products-api › region: us-east-1
products-api › stack: products-api-task3-2
products-api › endpoints:
products-api › GET - https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2/products
products-api › GET - https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2/products/{productId}
products-api › functions:
products-api › getProductsList: products-api-task3-2-getProductsList
products-api › getProductById: products-api-task3-2-getProductById
products-api ›
products-api › Stack Outputs:
products-api › GetProductByIdLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:products-api-task3-2-getProductById:1
products-api › GetProductsListLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:products-api-task3-2-getProductsList:1
products-api › ServiceEndpoint: https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2
products-api › ServerlessDeploymentBucketName: products-api-task3-2-serverlessdeploymentbucket-cx3g38wxjx7c
products-api › deployed
shop-frontend-app › deploying
shop-frontend-app › Running "serverless deploy --stage task3-2 --param productsApiServiceEndpoint=https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2"
shop-frontend-app › Deploying aws-js-practitioner-shop-frontend to stage task3-2 (us-east-1)
shop-frontend-app › Running command: echo "CONFIG = {BASE_URL: "https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2\"}" > public/config.js
shop-frontend-app › npm run build
shop-frontend-app › > @guria.dev/[email protected] build
shop-frontend-app › > tsc && vite build
shop-frontend-app › vite v3.1.8 building for production...
shop-frontend-app › transforming...
shop-frontend-app › ✓ 1768 modules transformed.
shop-frontend-app › rendering chunks...
shop-frontend-app › dist/index.html 0.57 KiB
shop-frontend-app › dist/assets/dehydrated.eb01c8e5.js 0.58 KiB / gzip: 0.33 KiB
shop-frontend-app › dist/assets/libs.03b6e541.js 114.11 KiB / gzip: 37.69 KiB
shop-frontend-app › dist/assets/index.152adbd3.js 215.89 KiB / gzip: 65.49 KiB
shop-frontend-app › dist/assets/react.afe5f750.js 198.67 KiB / gzip: 60.67 KiB
shop-frontend-app › DistributionIdKey: WebAppDistributionIdOutput
shop-frontend-app › CloudfrontInvalidate: Invalidation started
shop-frontend-app › Web App deployed to Cloudfront and available at following addresses:
shop-frontend-app › * https://djbt19ugm2lj2.cloudfront.net
shop-frontend-app › * https://aws-js-practitioner-shop-frontend-task3-2.guria.dev
shop-frontend-app › ✔ Service deployed to stack aws-js-practitioner-shop-frontend-task3-2 (343s)
shop-frontend-app › Running "serverless info --verbose --stage task3-2 --param productsApiServiceEndpoint=https://zabaem78r9.execute-api.us-east-1.amazonaws.com/task3-2"
shop-frontend-app › service: aws-js-practitioner-shop-frontend
shop-frontend-app › stage: task3-2
shop-frontend-app › region: us-east-1
shop-frontend-app › stack: aws-js-practitioner-shop-frontend-task3-2
shop-frontend-app ›
shop-frontend-app › Stack Outputs:
shop-frontend-app › WebAppDistributionIdOutput: E278WOUAFPSOVL
shop-frontend-app › WebAppDistributionOutput: djbt19ugm2lj2.cloudfront.net
shop-frontend-app › ServerlessDeploymentBucketName: aws-js-practitioner-shop-serverlessdeploymentbuck-eqgj0o9ff8iw
shop-frontend-app › WebAppCustomDomainOutput: aws-js-practitioner-shop-frontend-task3-2.guria.dev
shop-frontend-app › deployed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task 3. First API with AWS API Gateway and AWS Lambda
1 participant