aws-cli

aws cli s3 bucket remove object with date condition

久未见 提交于 2019-12-05 21:30:05
how do i remove aws cli s3 bucket remove object with date condition recursively i am using this command for listing aws s3 ls --recursive s3://uat-files-transfer-storage/ | awk '$1 < "2018-02-01 11:13:29" {print $0}' | sort -n its run perfectly but when i use this command with rm its delete all files aws s3 rm --recursive s3://uat-files-transfer-storage/ | awk '$1 < "2018-02-01 11:13:29" {print $0}' | sort -n any solution You're on the right track. To understand what's going on, let's look at what your commands are doing step by step. aws s3 ls --recursive s3://uat-files-transfer-storage/ |

HTTPSConnectionPool(host='s3-us-west-1b.amazonaws.com', port=443): Max retries exceeded with url

风格不统一 提交于 2019-12-05 18:37:49
I am trying to copy a file from my aws ec2 instance to S3 bucket folder, but i am getting error Here is the command sample aws s3 cp /home/abc/icon.jpg s3://mybucket/myfolder This the error i am getting upload failed: ./icon.jpg to s3://mybucket/myfolder/icon.jpg HTTPSConnectionPool(host='s3-us-west-1b.amazonaws.com', port=443): Max retries exceeded with url: /mybucket/myfolder/icon.jpg (Caused by : [Errno -2] Name or service not known) I have already configured the config file for aws cli command line Please suggest the solution to this problem You aren't using a valid endpoint. s3-us-west-1b

Deploy AWS Elastic beanstalk to an environment in different region

前提是你 提交于 2019-12-05 18:32:27
I'm a little new to Elastic Beanstalk on AWS so forgive me if this is a little newbie.... But we've got an instance of our product in a new region (EU) and I'm unsure how to bind a specific git brand to deploy to that environment? (Using CLI3) If it something best setup in the config.yml? Many thanks! To do it once: eb deploy {environment-name} --region {region-name} To always deploy to it: eb init --region {region-name} eb use {environment-name} Then use: eb deploy 来源: https://stackoverflow.com/questions/29886795/deploy-aws-elastic-beanstalk-to-an-environment-in-different-region

Retrieving the IP address of an EC2 instance given an instance ID

荒凉一梦 提交于 2019-12-05 15:41:05
Using the aws CLI , how can I retrieve the private IP address of an EC2 instance given its instanceID? When I do: aws ec2 describe-instance-status --instance-ids <instance_ID> I get other information, but not the private IP addresses such as: { "InstanceStatuses": [ { "InstanceId": "XXXXX", "InstanceState": { "Code": 16, "Name": "running" }, "AvailabilityZone": "us-east-1a", "SystemStatus": { "Status": "ok", "Details": [ { "Status": "passed", "Name": "reachability" } ] }, "InstanceStatus": { "Status": "ok", "Details": [ { "Status": "passed", "Name": "reachability" } ] } } ] } Try describe

AWS ECR GetAuthorizationToken

我怕爱的太早我们不能终老 提交于 2019-12-05 08:48:23
问题 I've tried to follow AWS instructions on setting ECR authorization to my user by giving the AmazonEC2ContainerRegistryFullAccess policy to my user. However when I try to run on my PC the aws ecr get-login I get an error that I don't have permission. An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::ACCOUNT_NUMBER:user/MY_USER is not authorized to perform: ecr:GetAuthorizationToken on resource: * What have I done wrong ? 回答1: You

AWS CLI s3 copy fails with 403 error, trying to administrate a user-uploaded object

可紊 提交于 2019-12-05 04:24:15
Trying to copy a file from an S3 bucket to my local machine: aws s3 cp s3://my-bucket-name/audio-0b7ea3d0-13ab-4c7c-ac66-1bec2e572c14.wav ./ fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden Things I have confirmed: I'm using version aws-cli/1.11.13 Python/3.5.2 Linux/4.4.0-75-generic botocore/1.4.70 The S3 Object key is correct. I have copied it directly from the S3 web interface. The AWS CLI is configured with valid credentials. I generated a new key/secret pair. I deleted the ~/.aws folder before re-configuring the aws cli. The IAM web interface online

Bash script to install AWS CLI tools

假装没事ソ 提交于 2019-12-04 17:53:42
问题 I am writing a bash script that will automatically install and configure AWS CLI tools. I am able to install AWS CLI tools but unable to configure it. My script is something like this: #!/bin/bash wget https://s3.amazonaws.com/aws-cli/awscli-bundle.zip unzip awscli-bundle.zip sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws ./awscli-bundle/install -b ~/bin/aws ./awscli-bundle/install -h aws configure AWS Access Key ID [None]: ABCDEFGHIJKLMNOP ## unable to provide this data

How to uninstall aws-cli

大憨熊 提交于 2019-12-04 17:32:33
问题 I am trying to set up an "Amazon Elastic Container Registry" but I get the following error when using this command: aws ecr get-login --no-include-email --region us-west-2 : Unknown options: --no-include-email The manual redirects me when this occurs to go to the following page, in order to update my aws cli. https://docs.aws.amazon.com/cli/latest/userguide/installing.html Which in short means, call pip install awscli --upgrade --user . While that works, my cli is not updated. So I removed it

Amazon EKS: generate/update kubeconfig via python script

删除回忆录丶 提交于 2019-12-04 17:24:37
When using Amazon's K8s offering, the EKS service, at some point you need to connect the Kubernetes API and configuration to the infrastructure established within AWS. Especially we need a kubeconfig with proper credentials and URLs to connect to the k8s control plane provided by EKS. The Amazon commandline tool aws provides a routine for this task aws eks update-kubeconfig --kubeconfig /path/to/kubecfg.yaml --name <EKS-cluster-name> Question: do the same through Python/boto3 When looking at the Boto API documentation , I seem to be unable to spot the equivalent for the above mentioned aws

AWS CLI get download S3 URL for private bucket from AWS CLI

♀尐吖头ヾ 提交于 2019-12-04 15:16:38
问题 I could upload a file to a private S3 bucket successfully using following command: aws s3 cp "myfile.txt" "s3://myfolder/myfile.txt" --region=us-east-1 --output=json I would like to issue a AWS CLI command to return me a temporary URL download for myfile.txt and does anyone know how to? I googled and look like I have to do some signing to get temporary URL such as: http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html 回答1: aws cli now supports presign command. You can run $