Ref:
https://docs.aws.amazon.com/cli/lates...
https://docs.aws.amazon.com/cli/lates...
Please find below .gitlab-ci.yml file
stages:
make-zip-file
create-s3-bucket-and-upload-zip-file
create-lambda-function
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
variables:
my_bucket: nodejs-app-deploy-lambda092
make-zip-file:
stage: make-zip-file
script:
echo "make zip"
mkdir bin/
zip -r9 node-js-app.zip index.js
cp node-js-app.zip bin/
ls
artifacts:
paths:
bin/
create-s3-bucket-and-upload-zip-file:
stage: create-s3-bucket-and-upload-zip-file
script:
aws s3 mb s3://$my_bucket
aws s3 ls
ls bin/
cd bin/
aws s3 cp node-js-app.zip s3://$my_bucket
needs:
job: make-zip-file
artifacts: true
create-lambda-function:
stage: create-lambda-function
script:
echo “Create lambda function”
echo $my_bucket
aws lambda create-function --function-name node-app --runtime nodejs20.x --handler index.handler --role arn:aws:iam::1845983:role/lambda --code S3Bucket=$my_bucket,S3Key=node-js-app.zip
En esta página del sitio puede ver el video en línea How To Deploy NodeJs Code Using AWS Lambda & S3 Bucket In GitLab(Simple Explanation) de Duración hora minuto segunda en buena calidad , que subió el usuario Devops Zplus 12 enero 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,144 veces y le gustó 23 a los espectadores. Disfruta viendo!