This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read json from s3 in lambda | |
s3_client = boto3.client('s3') | |
resp = s3_client.get_object( | |
Bucket='<BUCKETNAME>', | |
Key='<FILENAME>.json', | |
) | |
content = resp['Body'] # botocore.response.StreamingBody | |
json_obj = json.load(content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# azure blob on win | |
$ACC_NAME = "" | |
$CONTAINER_NAME = "" | |
# last files | |
az storage blob list --account-name $ACC_NAME -c $CONTAINER_NAME| jq -r '.[].name'| tail | |
# just cat last one | |
az storage blob download --account-name $ACC_NAME -c $CONTAINER_NAME -n $(az storage blob list --account-name $ACC_NAME -c $CONTAINER_NAME| jq -r '.[].name'| tail -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build,tag,push,deploy image to lambda on win ps7 | |
$FUNC_NAME = "" | |
$ACC_ID = "" | |
$ECR_REPO_NAME = "" | |
$IMG = "" | |
$IMG_URI = "$($ACC_ID).dkr.ecr.eu-central-1.amazonaws.com/$($ECR_REPO_NAME):latest" | |
docker build --platform linux/amd64 -t $IMG . && docker tag $IMG $IMG_URI && docker push $IMG_URI && aws lambda update-function-code --function-name $FUNC_NAME --image-uri $IMG_URI |