amazon-web-services

AWS Glue: Rename_field() does not work after relationalize

白昼怎懂夜的黑 提交于 2021-02-10 14:58:42
问题 I got a job that needs to perform the following task Relationalize the data Rename the field names that contains the '.'s so that it can be imported into PostgreSQL as normal looking field name. Here is the code import sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from awsglue.context import GlueContext from awsglue.job import Job ## @params: [JOB_NAME] args = getResolvedOptions(sys.argv, ['JOB_NAME']) sc =

aws Download Content in Yaml

南笙酒味 提交于 2021-02-10 14:40:30
问题 Trying to format my yaml to download a script in S3 bucket to run in SSM. I've tried many different formats, but all examples seem to be JSON formatted - action: aws:downloadContent name: downloadContent inputs: sourceType: "S3" sourceInfo: path: https://bucket-name.s3.amazonaws.com/scripts/script.ps1 destinationPath: "C:\\Windows\\Temp" Fails with the following message: standardError": "invalid format in plugin properties map[destinationPath:C:\\Windows\\Temp sourceInfo:map[path:https:/

aws Download Content in Yaml

霸气de小男生 提交于 2021-02-10 14:37:03
问题 Trying to format my yaml to download a script in S3 bucket to run in SSM. I've tried many different formats, but all examples seem to be JSON formatted - action: aws:downloadContent name: downloadContent inputs: sourceType: "S3" sourceInfo: path: https://bucket-name.s3.amazonaws.com/scripts/script.ps1 destinationPath: "C:\\Windows\\Temp" Fails with the following message: standardError": "invalid format in plugin properties map[destinationPath:C:\\Windows\\Temp sourceInfo:map[path:https:/

sam package is reducing the size of my template

余生颓废 提交于 2021-02-10 14:36:42
问题 I have a SAM template that I am using to building 4 lambda functions integrated with API gateways. AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: An AWS Serverless Specification template describing your function. #To avoide 'stage' being created when deploying the Api gateway. Globals: Api: OpenApiVersion: 3.0.1 Resources: # api gateway model for all user methods ApiGatewayApi: Type: AWS::Serverless::Api Properties: Name: loadeo_user StageName:

AWS: Delete Permanently S3 objects less than 30 days using 'Lifecycle Rule'

感情迁移 提交于 2021-02-10 14:30:58
问题 Is there a way to configure on S3 Lifecycle to delete object less than 30 days (say I want to delete in 5 days Permanently without moving to any other Storage class like glacier? Or should I go by other alternative like Lambda ? I believe, S3 'Lifecycle Rule' allows storage class only more than 30 days. 回答1: You can use expiration action: Define when objects expire. Amazon S3 deletes expired objects on your behalf. You can set expiration time to 5 days or 1 day, or what suits you. For example

AWS: Delete Permanently S3 objects less than 30 days using 'Lifecycle Rule'

若如初见. 提交于 2021-02-10 14:29:22
问题 Is there a way to configure on S3 Lifecycle to delete object less than 30 days (say I want to delete in 5 days Permanently without moving to any other Storage class like glacier? Or should I go by other alternative like Lambda ? I believe, S3 'Lifecycle Rule' allows storage class only more than 30 days. 回答1: You can use expiration action: Define when objects expire. Amazon S3 deletes expired objects on your behalf. You can set expiration time to 5 days or 1 day, or what suits you. For example

Dynamo db export to csv

大兔子大兔子 提交于 2021-02-10 14:24:23
问题 I have a serverless project, I'm trying to export Dynamo DB tables into single csv, and then upload it to S3. All npm modules i checked export single table. Is there a way to export multiple table data into one single csv? 回答1: The AWS CLI can be used to download data from Dynamo DB: aws dynamodb scan --table-name my-table --select ALL_ATTRIBUTES --page-size 500 --max-items 100000 The --page-size is important, there is a limit of 1M (megabyte) for every query result. 回答2: To export as a CSV,

How to create a codepipeline to build jar file from java code stored at github and deploy it to lambda function?

[亡魂溺海] 提交于 2021-02-10 14:11:14
问题 I want to build a codepipeline that will get the code(java) from github build a jar file and deploy it to aws lamda(or store the jar in a specific S3 bucket). I only want to use tools provided by AWS platform only. If I am using only Codebuild I am able to build jar from the github code and store it to S3(https://docs.aws.amazon.com/codebuild/latest/userguide/getting-started.html) and I am using a deployer lamda function to deploy the code to my service lamda. Whenever there is any change in

How to create a codepipeline to build jar file from java code stored at github and deploy it to lambda function?

强颜欢笑 提交于 2021-02-10 14:06:29
问题 I want to build a codepipeline that will get the code(java) from github build a jar file and deploy it to aws lamda(or store the jar in a specific S3 bucket). I only want to use tools provided by AWS platform only. If I am using only Codebuild I am able to build jar from the github code and store it to S3(https://docs.aws.amazon.com/codebuild/latest/userguide/getting-started.html) and I am using a deployer lamda function to deploy the code to my service lamda. Whenever there is any change in

ENOSPC error on AWS Lambda

南笙酒味 提交于 2021-02-10 13:24:38
问题 Sorry for this loaded question. I. TL;DR: The /tmp directory on AWS Lambda keeps filling up when it shouldn't and gives me ENOSPC error on subsequent request. II. The TL version: I have a microservice built with Node JS (0.10x) on AWS Lambda that does 2 things: Given a list of urls, it goes to relevant sources (S3, Cloudfront, thumbor, etc.) and download the physical files into the /tmp directory After downloading all of these files, it will compress them into a tar ball and upload to S3.