Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

574
Views
Error al crear la función lambda a través de CLI usando gitlab CI (Error al analizar el parámetro '--zip-file': No se puede cargar el archivo de parámetros)

Estoy implementando secuencias de comandos del controlador aws como archivos zip en el depósito S3 . Ahora, quiero usar este archivo comprimido implementado en la función lambda. Estoy haciendo todo esto a través de gitlab CI.

Tengo el siguiente CI:

 image: ubuntu:18.04 variables: GIT_SUBMODULE_STRATEGY: recursive AWS_DEFAULT_REGION: eu-central-1 S3_BUCKET: $BUCKET_TRIAL stages: - deploy .before_script_template: &before_script_definition stage: deploy before_script: - apt-get -y update - apt-get -y install python3-pip python3.7 zip - python3.7 -m pip install --upgrade pip - python3.7 -V - pip3.7 install virtualenv .after_script_template: &after_script_definition after_script: # Upload package to S3 # Install AWS CLI - pip install awscli --upgrade # --user - export PATH=$PATH:~/.local/bin # Add to PATH # Configure AWS connection - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY - aws configure set default.region $AWS_DEFAULT_REGION - aws sts get-caller-identity --output text --query 'Account' - aws s3 cp ~/forlambda/archive.zip $BUCKET_TRIAL/${LAMBDA_NAME}-deployment.zip - aws lambda create-function --function-name "${LAMBDA_NAME}-2" --runtime python3.7 --role arn:aws:iam::xxxxxxxxxxxx:role/abc_scripts --handler ${HANDLER_SCRIPT_NAME}.${HANDLER_FUNCTION} --memory-size 1024 --zip-file "fileb://$BUCKET_TRIAL/${LAMBDA_NAME}-deployment.zip" my_job: variables: LAMBDA_NAME: my_lambda HANDLER_SCRIPT_NAME: my_aws_handler HANDLER_FUNCTION: my_handler_function <<: *before_script_definition script: # - move scripts around and install requirements and zip the file for lambda deployment <<: *after_script_definition

Para el CI, he agregado variables de entorno $BUCKET_TRIAL y tiene el formato s3://my-folder

Cuando se ejecuta el archivo CI, arroja el siguiente error al final:

Error al analizar el parámetro '--zip-file': No se puede cargar el archivo paramfile b://s3://my-folder/my_lambda-deployment.zip: [Errno 2] No existe tal archivo o directorio: 's3://my- carpeta/my_lambda-deployment.zip'

También intenté cambiar el --zip-file en la última línea de after_script como:

 - aws lambda create-function --function-name "${LAMBDA_NAME}-2" --runtime python3.7 --role arn:aws:iam::xxxxxxxxxxxx:role/abc_scripts --handler ${HANDLER_SCRIPT_NAME}.${HANDLER_FUNCTION} --memory-size 1024 --zip-file "fileb:///my-folder/${LAMBDA_NAME}-deployment.zip"

Pero sigue arrojando el mismo error.

¿Me estoy perdiendo de algo?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Basado en la discusión en el chat.

La solución fue usar

 --zip-file fileb:///root/forlambda/archive.zip

en vez de

 --zip-file "fileb://$BUCKET_TRIAL/${LAMBDA_NAME}-deployment.zip"

El motivo es que --zip-file requiere una ruta local a un paquete de implementación zip, en lugar de una ubicación remota en s3.

De documentos :

--zip-file (blob): la ruta al archivo zip del código que está cargando. Ejemplo: archivob://código.zip

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!