Skip to content

Instantly share code, notes, and snippets.

@Francisco-Castillo
Last active May 29, 2022 01:57
Show Gist options
  • Save Francisco-Castillo/af2455180d08c5b5d96a15d2153fa82a to your computer and use it in GitHub Desktop.
Save Francisco-Castillo/af2455180d08c5b5d96a15d2153fa82a to your computer and use it in GitHub Desktop.
Crear bucket s3 y funcion lambda desde AWS CLI
aws --endpoint-url=http://localhost:4566 secretsmanager create-secret --name testSecret --secret-string 'secret'
aws s3 mb s3://nombre_bucket --profile default
aws lambda create-function \
--function-name lambda-test \
--runtime java8 \
--role arn:aws:iam::<account_id>:role/lambda_iam_role_test \
--handler paquete.ClasePrincipal::handleRequest \
--code S3Bucket=nombre_bucket,S3Key=nombre_archivo.jar \
--timeout 15 \
--memory-size 512 \
--profile default
aws iam create-policy \
--policy-name lambda_iam_policy_test \
--policy-document file://ubicacion_archivo.txt \
--profile default
aws iam create-role \
--role-name lambda_iam_role_test \
--assume-role-policy-document file://ubicacion_de_archivo.txt \
--profile default
aws --endpoint http://localhost:4566 secretsmanager \
get-secret-value \
--secret-id nombreSecreto
aws s3 cp target/archivo_java.jar s3://nombre_bucket/nuevo_nombre_archivo.jar --profile default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment