aws-cli

How to access run-property of AWS Glue workflow in Glue job?

风流意气都作罢 提交于 2021-01-28 11:15:02
问题 I have been working with AWS Glue workflow for orchestrating batch jobs. we need to pass push-down-predicate in order to limit the processing for batch job. When we run Glue jobs alone, we can pass push down predicates as a command line argument at run time (i.e. aws glue start-job-run --job-name foo.scala --arguments --arg1-text ${arg1}..). But when we use glue workflow to execute Glue jobs, it is bit unclear. When we orchestrate Batch jobs using AWS Glue workflows, we can add run properties

On AWS, run an AWS CLI command daily

好久不见. 提交于 2021-01-28 10:51:39
问题 I have an AWS CLI invocation (in this case, to launch a configured EMR cluster to do some steps and then shut down) but I'm not sure how to go about running it daily. I guess one way to do it is an EC2 micro instance running a cron job, or an ECS task in a micro that launches the command, but that all seems like it might be overkill. It looks like there's also a way to do it in Lambda, but rom what I can tell it'd be kludgy. This doesn't have to be a good long-term solution, something that's

On AWS, run an AWS CLI command daily

戏子无情 提交于 2021-01-28 10:49:55
问题 I have an AWS CLI invocation (in this case, to launch a configured EMR cluster to do some steps and then shut down) but I'm not sure how to go about running it daily. I guess one way to do it is an EC2 micro instance running a cron job, or an ECS task in a micro that launches the command, but that all seems like it might be overkill. It looks like there's also a way to do it in Lambda, but rom what I can tell it'd be kludgy. This doesn't have to be a good long-term solution, something that's

aws-cli dynamodb create table with multiple secondary index

做~自己de王妃 提交于 2021-01-28 09:40:31
问题 I am trying to create a dynamodb table with 2 local secondary indexes. I did the following and only the latter index(index-2) applied. What's the correct way of doing this? aws dynamodb create-table \ --table-name test_table_name \ --attribute-definitions \ AttributeName=type,AttributeType=S \ ... --key-schema \ AttributeName=type,KeyType=HASH \ AttributeName=id,KeyType=RANGE \ --provisioned-throughput \ ReadCapacityUnits=5,WriteCapacityUnits=5 \ --local-secondary-indexes \ 'IndexName=index-1

Describe Dynamodb Table at Local Installation using endpoint URL?

蓝咒 提交于 2021-01-28 08:01:10
问题 I have Installed DynamoDB Local Instance on my machine, I want to Describe DynamoDB Tables which are created at this Local Instance of DynamoDB, How can I achieve this ? 回答1: You Need to have installed awscli on your machine. Steps to install awscli : Click Here After Installing, Run below command to Describe DynamoDb Table : aws dynamodb describe-table --table-name tableName --endpoint-url http://localhost:8000 Note : Here --endpoint-url is Optional & Used for Local DynamoDB Installation

Way to run aws cli across multiple accounts

时光怂恿深爱的人放手 提交于 2021-01-28 07:13:35
问题 I am trying to find out all EC2 instances in 10 different accounts which are running non-amazon AMI images. Following CLI command gives me the list of all AMI's: aws ec2 describe-instances --output text --query 'Reservations[*].Instances[*].[ImageId]' | sort | uniq -c I think I can modify this further to get all non-amazon AMI's but is there a way to run this across 10 different accounts in one call? 回答1: is there a way to run this across 10 different accounts in one call? No, that's not

How to get all security groups through AWS CLI of an EC2 to show in a table

核能气质少年 提交于 2021-01-28 05:06:32
问题 I am trying to show all instances along with attached security groups, block device name and their deleteontermination status. I need to show this data in table format but I am continuously getting the below error. Kindly help me to understand what I am missing here. PR-MacBook-Pro:~ pr$ aws ec2 describe-instances --output table --query 'Reservations[*].Instances[*].[InstanceId,SecurityGroups[].GroupName,Placement.AvailabilityZone,BlockDeviceMappings[].DeviceName, BlockDeviceMappings[].Ebs

How to save output of AWS CLI in a variable?

倖福魔咒の 提交于 2021-01-28 04:24:17
问题 I want to save output of an AWS CLI in a variable and use that variable in another AWS CLI, what I did is as follows: taskarn= aws ecs list-tasks --cluster mycluster --service-name "myService" --region "eu-west-1" --output text | grep "arn" | tr -d '"' echo $taskarn; //empty aws ecs stop-task --cluster mycluster --task $taskarn --region "eu-west-1" when I echo $taskarn, it is empty. Any help would be appreciated. 回答1: I used the following command and it works fine: taskarn=$(aws ecs list

could not connect to aws services using aws-cli

假如想象 提交于 2021-01-27 17:53:42
问题 I am new to aws, I am trying to use aws-cli to connect aws as I am confortable with commandline, and want to use to write the script to automate the process. However I am getting error as below: _ attempt_number, caught_exception) File "/usr/local/lib/python2.7/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception raise caught_exception EndpointConnectionError: Could not connect to the endpoint URL: "https://ec2.ap-southeast-1a.amazonaws.com/" 2017-07-08 20:30:52,763 -

looking for s3cmd download command for a certain date

给你一囗甜甜゛ 提交于 2021-01-27 17:36:11
问题 I am trying to figure out on what the s3cmd command would be to download files from bucket by date, so for example i have a bucket named "test" and in that bucket there are different files from different dates. I am trying to get the files that were uploaded yesterday. what would the command be? 回答1: There is no single command that will allow you to do that. You have to write a script some thing like this. Or use a SDK that allows you to do this. Below script is a sample script that will get