Guria / aws-js-practitioner

https://aws-js-practitioner-dev.guria.dev/
1 stars 0 forks source link

task6.2: update `importFileParser` to send products to sqs #31

Closed Guria closed 2 years ago

Guria commented 2 years ago

:heavy_check_mark: Update the importFileParser lambda function to send each CSV record into SQS. :heavy_check_mark: It is no longer log entries to CloudWatch.

Middify for non http handlers now use appropriate middlewares to log inputs, outputs and errors.

github-actions[bot] commented 2 years ago

Build output

Deploying to stage task6-2 api-gateway › waiting fe-distribution › waiting fixtures › waiting products-api › waiting products-import › waiting shop-frontend-app › waiting api-gateway › deploying fe-distribution › deploying fe-distribution › Running "serverless deploy --stage task6-2 --param ResourcePrefix=ajp-task6-2" api-gateway › Running "serverless deploy --stage task6-2 --param ResourcePrefix=ajp-task6-2" fe-distribution › Deploying ajp-fe-distribution to stage task6-2 (us-east-1) api-gateway › Deploying ajp-api-gateway to stage task6-2 (us-east-1) api-gateway › ✔ Service deployed to stack ajp-api-gateway-task6-2 (67s) api-gateway › Running "serverless info --verbose --stage task6-2 --param ResourcePrefix=ajp-task6-2" api-gateway › service: ajp-api-gateway api-gateway › stage: task6-2 api-gateway › region: us-east-1 api-gateway › stack: ajp-api-gateway-task6-2 api-gateway › api-gateway › Stack Outputs: api-gateway › ApiGatewayRestApiId: 33nmxliaa1 api-gateway › ApiGatewayRestApiEndpoint: https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2 api-gateway › ApiGatewayRestApiRootResourceId: fw5vkg6vb6 api-gateway › ServerlessDeploymentBucketName: ajp-api-gateway-task6-2-serverlessdeploymentbucke-sex4wb8qdeoi api-gateway › deployed fe-distribution › ✔ Service deployed to stack ajp-fe-distribution-task6-2 (351s) fe-distribution › Running "serverless info --verbose --stage task6-2 --param ResourcePrefix=ajp-task6-2" fe-distribution › service: ajp-fe-distribution fe-distribution › stage: task6-2 fe-distribution › region: us-east-1 fe-distribution › stack: ajp-fe-distribution-task6-2 fe-distribution › fe-distribution › Stack Outputs: fe-distribution › WebAppCustomDomain: ajp-task6-2.guria.dev fe-distribution › WebAppDistributionDomain: dnmwg39sy1c4k.cloudfront.net fe-distribution › WebAppDistributionId: E2G3ZG3LA2STOB fe-distribution › WebAppS3BucketName: ajp-task6-2-s3 fe-distribution › ServerlessDeploymentBucketName: ajp-fe-distribution-task-serverlessdeploymentbuck-1gsk0r7uzrux4 fe-distribution › deployed fixtures › deploying fixtures › Running "serverless deploy --stage task6-2 --param ResourcePrefix=ajp-task6-2 --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev" fixtures › Deploying ajp-fixtures to stage task6-2 (us-east-1) fixtures › ✔ Service deployed to stack ajp-fixtures-task6-2 (83s) fixtures › Running "serverless info --verbose --stage task6-2 --param ResourcePrefix=ajp-task6-2 --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev" fixtures › service: ajp-fixtures fixtures › stage: task6-2 fixtures › region: us-east-1 fixtures › stack: ajp-fixtures-task6-2 fixtures › fixtures › Stack Outputs: fixtures › FixturesS3BucketName: ajp-task6-2-fixtures fixtures › ServerlessDeploymentBucketName: ajp-fixtures-task6-2-serverlessdeploymentbucket-sr9k7z0hv5pg fixtures › deployed products-api › deploying products-api › Running "serverless deploy --stage task6-2 --param ResourcePrefix=ajp-task6-2 --param FixturesS3BucketName=ajp-task6-2-fixtures --param ApiGatewayRestApiId=33nmxliaa1 --param ApiGatewayRestApiRootResourceId=fw5vkg6vb6 --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev" products-api › Deploying ajp-products-api to stage task6-2 (us-east-1) products-api › ✔ Service deployed to stack ajp-products-api-task6-2 (307s) products-api › endpoints: products-api › GET - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/products products-api › GET - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/products/{productId} products-api › POST - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/products products-api › functions: products-api › getProductsList: ajp-products-api-task6-2-getProductsList (198 kB) products-api › getProductById: ajp-products-api-task6-2-getProductById (198 kB) products-api › createProduct: ajp-products-api-task6-2-createProduct (199 kB) products-api › catalogBatchProcess: ajp-products-api-task6-2-catalogBatchProcess (198 kB) products-api › 1 deprecation found: run 'serverless doctor' for more details products-api › Running "serverless info --verbose --stage task6-2 --param ResourcePrefix=ajp-task6-2 --param FixturesS3BucketName=ajp-task6-2-fixtures --param ApiGatewayRestApiId=33nmxliaa1 --param ApiGatewayRestApiRootResourceId=fw5vkg6vb6 --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev" products-api › service: ajp-products-api products-api › stage: task6-2 products-api › region: us-east-1 products-api › stack: ajp-products-api-task6-2 products-api › endpoints: products-api › GET - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/products products-api › GET - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/products/{productId} products-api › POST - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/products products-api › functions: products-api › getProductsList: ajp-products-api-task6-2-getProductsList products-api › getProductById: ajp-products-api-task6-2-getProductById products-api › createProduct: ajp-products-api-task6-2-createProduct products-api › catalogBatchProcess: ajp-products-api-task6-2-catalogBatchProcess products-api › Stack Outputs: products-api › GetProductByIdLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:ajp-products-api-task6-2-getProductById:3 products-api › GetProductsListLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:ajp-products-api-task6-2-getProductsList:3 products-api › ImportedProductsQueueUrl: https://sqs.us-east-1.amazonaws.com/609136581632/ajp-task6-2-imported-products products-api › ImportedProductsQueue: arn:aws:sqs:us-east-1:609136581632:ajp-task6-2-imported-products products-api › CreateProductLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:ajp-products-api-task6-2-createProduct:5 products-api › CatalogBatchProcessLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:ajp-products-api-task6-2-catalogBatchProcess:3 products-api › ServiceEndpoint: https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2 products-api › ServerlessDeploymentBucketName: ajp-products-api-task6-2-serverlessdeploymentbuck-vvpkdtvblnom products-api › 1 deprecation found: run 'serverless doctor' for more details products-api › deployed products-import › deploying products-import › Running "serverless deploy --stage task6-2 --param ResourcePrefix=ajp-task6-2 --param FixturesS3BucketName=ajp-task6-2-fixtures --param ApiGatewayRestApiId=33nmxliaa1 --param ApiGatewayRestApiRootResourceId=fw5vkg6vb6 --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev --param ImportedProductsQueue=arn:aws:sqs:us-east-1:609136581632:ajp-task6-2-imported-products --param ImportedProductsQueueUrl=https://sqs.us-east-1.amazonaws.com/609136581632/ajp-task6-2-imported-products" products-import › Deploying ajp-products-import to stage task6-2 (us-east-1) products-import › ✔ Service deployed to stack ajp-products-import-task6-2 (121s) products-import › endpoint: GET - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/import products-import › functions: products-import › importProductsFile: ajp-products-import-task6-2-importProductsFile (195 kB) products-import › importFileParser: ajp-products-import-task6-2-importFileParser (191 kB) products-import › 1 deprecation found: run 'serverless doctor' for more details products-import › Running "serverless info --verbose --stage task6-2 --param ResourcePrefix=ajp-task6-2 --param FixturesS3BucketName=ajp-task6-2-fixtures --param ApiGatewayRestApiId=33nmxliaa1 --param ApiGatewayRestApiRootResourceId=fw5vkg6vb6 --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev --param ImportedProductsQueue=arn:aws:sqs:us-east-1:609136581632:ajp-task6-2-imported-products --param ImportedProductsQueueUrl=https://sqs.us-east-1.amazonaws.com/609136581632/ajp-task6-2-imported-products" products-import › service: ajp-products-import products-import › stage: task6-2 products-import › region: us-east-1 products-import › stack: ajp-products-import-task6-2 products-import › endpoint: GET - https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2/import products-import › functions: products-import › importProductsFile: ajp-products-import-task6-2-importProductsFile products-import › importFileParser: ajp-products-import-task6-2-importFileParser products-import › products-import › Stack Outputs: products-import › ImportProductsFileLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:ajp-products-import-task6-2-importProductsFile:3 products-import › ImportFileParserLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:609136581632:function:ajp-products-import-task6-2-importFileParser:3 products-import › ServiceEndpoint: https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2 products-import › ServerlessDeploymentBucketName: ajp-products-import-task-serverlessdeploymentbuck-g6p69kis7w3l products-import › 1 deprecation found: run 'serverless doctor' for more details products-import › deployed shop-frontend-app › deploying shop-frontend-app › Running "serverless deploy --stage task6-2 --param ApiGatewayRestApiId=33nmxliaa1 --param ProductsApiServiceEndpoint=https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2 --param WebAppS3BucketName=ajp-task6-2-s3 --param WebAppDistributionId=E2G3ZG3LA2STOB --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev" shop-frontend-app › Deploying ajp-shop-frontend to stage task6-2 (us-east-1) shop-frontend-app › Running command: echo "CONFIG = {BASE_URL: \"https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2\"}" > public/config.js shop-frontend-app › npm run build shop-frontend-app › SWAGGER_DIST_PATH=$(node -e 'console.log(require("swagger-ui-dist").getAbsoluteFSPath())') shop-frontend-app › cp -r $SWAGGER_DIST_PATH/ dist/swagger shop-frontend-app › sed -i 's/url: "."/url: "swagger.json"/g' dist/swagger/swagger-initializer.js shop-frontend-app › aws apigateway get-export --parameters extensions='apigateway' --rest-api-id 33nmxliaa1 --stage-name task6-2 --export-type swagger dist/swagger/swagger.json shop-frontend-app › > @guria.dev/aws-js-practitioner-shop-frontend@1.0.0 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/react.afe5f750.js 198.67 KiB / gzip: 60.67 KiB shop-frontend-app › dist/assets/index.6ac9b7ab.js 215.96 KiB / gzip: 65.56 KiB shop-frontend-app › { shop-frontend-app › "contentType": "application/octet-stream", shop-frontend-app › "contentDisposition": "attachment; filename=\"swagger_2022-10-31T21:49:57Z.json\"" shop-frontend-app › } shop-frontend-app › DistributionId: E2G3ZG3LA2STOB shop-frontend-app › CloudfrontInvalidate: Invalidation started shop-frontend-app › Web App deployed to Cloudfront and available at following addresses: shop-frontend-app › https://dnmwg39sy1c4k.cloudfront.net shop-frontend-app › https://ajp-task6-2.guria.dev shop-frontend-app › Swagger Schema available at: shop-frontend-app › https://ajp-task6-2.guria.dev/swagger/swagger.json shop-frontend-app › Swagger UI available at: shop-frontend-app › * https://ajp-task6-2.guria.dev/swagger/index.html shop-frontend-app › ✔ Service deployed to stack ajp-shop-frontend-task6-2 (93s) shop-frontend-app › Running "serverless info --verbose --stage task6-2 --param ApiGatewayRestApiId=33nmxliaa1 --param ProductsApiServiceEndpoint=https://33nmxliaa1.execute-api.us-east-1.amazonaws.com/task6-2 --param WebAppS3BucketName=ajp-task6-2-s3 --param WebAppDistributionId=E2G3ZG3LA2STOB --param WebAppDistributionDomain=dnmwg39sy1c4k.cloudfront.net --param WebAppCustomDomain=ajp-task6-2.guria.dev" shop-frontend-app › service: ajp-shop-frontend shop-frontend-app › stage: task6-2 shop-frontend-app › region: us-east-1 shop-frontend-app › stack: ajp-shop-frontend-task6-2 shop-frontend-app › shop-frontend-app › Stack Outputs: shop-frontend-app › ServerlessDeploymentBucketName: ajp-shop-frontend-task6-serverlessdeploymentbuck-187g8h0i0vjrz shop-frontend-app › deployed

github-actions[bot] commented 2 years ago

Deployment removed