aws-cli

My AWS CLI didn't work with sudo

时光怂恿深爱的人放手 提交于 2020-02-02 11:20:20
问题 I have shell script that uses aws cli , my script will be executed with sudo (Ex: sudo ./test.sh ) But I got the message: Unable to locate credentials. You can configure credentials by running "aws configure". Actually, I did config for both sudo aws configure and aws configure What did I do wrong? Please help. Thanks! 回答1: You might have to run sudo with -E to preserve the environment variables set by aws cli. sudo -E ./test.sh 回答2: AWS CLI configured your credentials in $HOME/.aws

How to copy a file with spaces in its file name from one bucket to the other using AWS CLI (Dos)

感情迁移 提交于 2020-01-24 02:17:08
问题 I am trying to copy a file by the same My CV 2017.pdf from one AWS bucket to the other using the AWS command line. But I am getting error doing that. I tried using My\ Cv\ 2017.pdf and 'My CV 2017.pdf' , both did not work. 回答1: Use double quotes. For example: aws s3 cp "s3://source-bucket/My CV 2017.pdf" "s3://destination-bucket/My CV 2017.pdf" 来源: https://stackoverflow.com/questions/46997354/how-to-copy-a-file-with-spaces-in-its-file-name-from-one-bucket-to-the-other-usi

How to run aws configure in a travis deploy script?

佐手、 提交于 2020-01-21 04:07:10
问题 I am trying to get travis-ci to run a custom deploy script that uses awscli to push a deployment up to my staging server. In my .travis.yml file I have this: before_deploy: - 'curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"' - 'unzip awscli-bundle.zip' - './awscli-bundle/install -b ~/bin/aws' - 'export PATH=~/bin:$PATH' - 'aws configure' And I have set up the following environment variables: AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION with their

How to manage Service Quotas (also referred to as limits in AWS Account) using AWS CLI commands

旧时模样 提交于 2020-01-19 04:10:28
问题 How can I manage my Service Quotas (also referred to as limits in AWS Account) using AWS CLI commands 回答1: You simply search for a quota and put in your desired value to submit a quota increase request via Console or via AWS CLI . You can find answers to your most of the queries with exmaples here on one of below links : [+] Dev.to https://dev.to/dineshrathee12/manage-my-service-quotas-also-referred-to-as-limits-in-aws-account-using-aws-cli-commands-5cg2 [+] GitHub: https://github.com

AWS CLI to find out list of active reserved instances

橙三吉。 提交于 2020-01-17 14:02:52
问题 I am trying to find out list of reserved instances that are active. aws ec2 describe-reserved-instances --filters "Name=instance-state-State,Values=active" --query 'Reservations[].Instances[].Tags[?Key==`Name`].Value[]' The above command does not work, and I think the Name field is not right. Any help? Thanks 回答1: Here's another take on it. Put the search for State == `active` into the query statement. The output includes labels as well. By the way, changing from single-quotes around the

AWS CLI to find out list of active reserved instances

断了今生、忘了曾经 提交于 2020-01-17 14:00:08
问题 I am trying to find out list of reserved instances that are active. aws ec2 describe-reserved-instances --filters "Name=instance-state-State,Values=active" --query 'Reservations[].Instances[].Tags[?Key==`Name`].Value[]' The above command does not work, and I think the Name field is not right. Any help? Thanks 回答1: Here's another take on it. Put the search for State == `active` into the query statement. The output includes labels as well. By the way, changing from single-quotes around the

Using JMESPath and aws ec2 describe instances to output multiple tag values

牧云@^-^@ 提交于 2020-01-17 07:04:42
问题 I'm trying to output multiple tags from an ec2 instances description. The tag values that I want are Name and aws:autoscaling:groupName. "Tags": [ { "Value": "somename", "Key": "Name" }, { "Value": "some-asg-name", "Key": "aws:autoscaling:groupName" }, { "Value": "somethingelse", "Key": "project" } ], Here's what I have so far: aws ec2 describe-instances --instance-ids i-12345678 --query 'Reservations[].Instances[].[Tags[? contains(`["aws:autoscaling:groupName","Name"]`, Key)] | [0].Value,[1]

Copy Elastic Beanstalk Configuration across accounts

我怕爱的太早我们不能终老 提交于 2020-01-17 04:59:28
问题 If i use the eb-cli eb config save to save the configuration of my current environment it works to start a new one using eb create . But if i want to create the same environment with a different AWS account obviously lines like the following make no sence: aws:ec2:vpc: Subnets: subnet-2d9a3c56 VPCId: vpc-1dff4c74 So how can i build the same elastic beanstalk environment within multiple accounts? Is there any way to tell AWS? Maybe an "Account Agnostic" config-save? 回答1: It would not be

“The AWS Access Key Id you provided does not exist in our records.” when trying to use AWS CLI

随声附和 提交于 2020-01-14 10:24:09
问题 I'm trying to access my S3 Bucket through the cli. I have everything setup up such as having a credentials file where I'm doing this cli work, making sure my environment variables for $AWS_SECRET_ACCESS_KEY and $AWS_ACCESS_KEY_ID have the right things in it, and manually setting them using aws configure . credentials contains the following information, all blanked out that is: [sts] aws_access_key_id = ASIAXXXXXXXXXXXXXXXX aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXX aws_security_token =

Create api-gateway lambda integration using aws-cli

北战南征 提交于 2020-01-14 09:36:06
问题 i need to create an api gateway using aws client. i suucessfully create and integrate with my aws-lambda function using web console. But iam confused with aws-client. These are the steps i followed. create api gateway and integrate with my sample lambda function using web console. Deploy created api and export as json file. Create new api gateway using exported json file using aws-cli. command like this. aws apigateway import-rest-api --body file://tmpfile.json --region us-east-1; But it