Questions tagged [aws-cli]

0

votes
0

answer
2

Views

How to pass a role to cli command “aws cloudformation deploy” or “sam deploy”?

I am creating a cloudformation stack using a SAM template and the CLI. I have successfully done this using an account that gets all the required permissions from policies directly attached to it. It's poor security practice to give this account all these permissions so I've created a role with the s...
Harfel Jaquez
1

votes
1

answer
524

Views

AWS CLI command for querying S3 bucket

I have a bucket which I will call some-images for showing here. I am trying to get my command to return all objects that have a key value which starts_with a number. Here is the code I am using: cmd = 'aws s3api list-objects --bucket some-images --query \'Contents[?starts_with(Key, '10000'\'' push =...
5pence
1

votes
1

answer
330

Views

How to use AWS CLI with Digital Ocean Spaces?

How to use AWS CLI with Digital Ocean Spaces? Is it possible? I tried to add my key id and secret to .aws/credentials but I got: An error occurred (InvalidAccessKeyId) when calling the ListBuckets operation: The AWS Access Key Id you provided does not exist in our record
paul
1

votes
1

answer
163

Views

aws s3 CLI commands are exiting batch file early

This is my batch file: aws s3 sync ./dummy_dist s3://www.mywebsite.com --delete --profile www.mywebsite.com_deploy --debug echo ________________ here 1 __________________ The echo line never runs! This is the debug output from the aws command: 2018-12-23 10:51:52,518 - MainThread - awscli.clidriver...
Force Hero
1

votes
1

answer
348

Views

Finding public IP addresses of all EC2 instances in a ECS cluster

I try to find public IP addresses of all EC2 instances within a ECS cluster. I can see EC2 instances id's with command: aws ecs list-container-instances --cluster myCluster But this won't show IP addresses. I searched ECS CLI documentation but I can't find a command to retrieve associated IP address...
JavaRed
1

votes
0

answer
286

Views

How to use the --profile option with “aws logs” command for the CloudWatch Logs Agent?

After installing the CloudWatchLogs Agent the command /var/awslogs/bin/aws logs push --config-file /var/awslogs/etc/awslogs.conf --additional-configs-dir /var/awslogs/etc/config is running on the machine. To use separate credentials for the CloudWatchLogs Agent a profile was created in /root/.aws. T...
1

votes
2

answer
880

Views

AWS CLI SNS Subscribe with multiple email address

How to subscribe to an SNS topic with multiple email addresses via CLI ? Single subscription is going well as given below aws sns subscribe --topic-arn arn:aws:sns:ap-southeast-2:nnnnnn:abcd --protocol email --notification-endpoint [email protected] when I try to submit to multiple emails with (, or...
suj
1

votes
1

answer
414

Views

How to display the content of a DynamoDB table

My DynamoDB table has the following attritubes sales_id: hashkey created_date: rangekey sales_employee_id:IndexedHashKey I am trying to get all the data of the table Sales just as in MySQL select * from Sales How can I query DynamoDB. I am trying with the below AWS CLI query but it fails everytime w...
J123
1

votes
0

answer
324

Views

How to get max-instances for each instance-type by aws cli?

The max numbers of launching instances are described on EC2 Service Limits of AWS console, and you can see the value of max-instances for each instance type. On the other hand, by using aws ec2 describe-account-attributes, it's possible to get the value of max-instances for overall, but it doesn't i...
otiai10
1

votes
1

answer
2k

Views

UnrecognizedClientException error when authenticating on aws-cli

When I pull a clean Alphine Linux Docker image, install aws-cli on it and try to authenticate myself with aws ecr get-authorization-token --region eu-central-1 I keep getting the following error: An error occurred (UnrecognizedClientException) when calling the GetAuthorizationToken operation: The se...
cute_marmalade
1

votes
1

answer
878

Views

Execution failed due to configuration error: Malformed Lambda proxy response

for reference you can visit this aws issue i've created: https://github.com/aws/aws-cli/issues/3118 I use this AWS CLI commands below but it is inside to *.sh file no problem with the script it successfully run NOTE: i manually create API ``` remove GET method aws apigateway delete-method \ --rest-...
XanderDwyl
1

votes
1

answer
86

Views

Creating transparent Docker network breaks AWS CLI

I'm running Docker version 17.06.2-ee-6, build e75fdb8 on Amazon EC2, Windows Server 2016. The instance role has permissions to get files from one specific S3 bucket: { 'Effect': 'Allow', 'Action': [ 's3:GetObject' ], 'Resource': [ 'arn:aws:s3:::my-s3-bucket/*' ] } In general, if I run aws s3 cp s3:...
Colm Prunty
1

votes
1

answer
142

Views

Execute Lua code in the background Freeswitch

I'm writing some Lua code with Freeswitch and trying to execute some code while the main program continues execution. I've tried ... -- aws is AWS Command Line Interface io.popen('aws s3 cp ' .. s3_src .. ' '.. s3_dst) os.execute('aws s3 cp ' .. s3_src .. ' '.. s3_dst) ... -- program execution c...
devie
1

votes
0

answer
556

Views

aws s3 sync by cron doesn't work

I run command: /usr/bin/aws s3 sync --delete /var/www/html/wp-content/uploads s3://yemaoplanet-blog-mediaassets and it works. also, I tried to do command with --dryrun flag : /usr/bin/aws s3 sync --delete /var/www/html/wp-content/uploads s3://yemaoplanet-blog-mediaassets --dryrun and it works. but,...
Kyungmin Kim
1

votes
1

answer
596

Views

Associate elastic ip address to instance via user-data

I'm trying to associate an elastic IP address to instance via the user-data using the AWS cli INSTANCE_ID=$(curl --silent http://169.254.169.254/latest/meta-data/instance-id) REGION=$(curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region) aws ec2 associate-ad...
Afik Grinstein
1

votes
1

answer
318

Views

Find aws ecs latest task and image used

I trying to find out the latest task and image used for ECS container service. I tried using AWS ECS cli, able to list services/tasks running but not able to find out running latest task ID and image used for that task. Can someone help with AWS CLI or Boto script to find out latest task and image u...
beginnertopython
1

votes
1

answer
149

Views

How to update AWS CloudFront error page response path via CLI?

Looking for a way to update the CloudFront instance error pages with the command line for continuous integration purposes. Have had some success with the update-distribution command for the root page but can't seem to figure out how update the the error page response paths. Suggestions?
codeisforeva
1

votes
1

answer
295

Views

Installing awscli without internet

I am trying to install awscli on a RHEL machine. Python 2.7.5 is installed, the machine does not have internet access. I have installed setuptools 38.5.2 and setuptools_scm 1.15.7 from sources successfully. Here is the command I have tried to run when installing: sudo /usr/bin/python2.7 awscli-bundl...
Vincent Teyssier
1

votes
2

answer
870

Views

AWS Route53 recordset delete Error - values provided do not match the current values

I am trying to delete a failover alias recordset with the following command: aws route53 change-resource-record-sets \ --hosted-zone-id \ --change-batch file://file.json Contents of json: { 'Comment': 'test-rdc', 'Changes': [ { 'Action': 'DELETE', 'ResourceRecordSet': { 'Name': 'abc.aws-ab-xyz.abcd...
pinocchio
1

votes
0

answer
893

Views

AWS S3 uploading hidden files by default

I have created a bucket in AWS and a couple of IAM. The IAM by default are included in a group with read-only access. However, when I create my bucket I generated a policy to grant access to specific IAM to list, put and get. Now I'm trying to run a simple command to put a file with one of these AWS...
1

votes
1

answer
1k

Views

awscli not working on OS X, keep getting ImportError: No module named awscli_plugin_endpoint

I recently broke my awscli installation by doing a brew upgrade. I keep getting ImportError: No module named awscli_plugin_endpoint regardless of what python version I use. Here's what I've tried already: current python version coming with brew using brew install awscli, pyenv with 2.7.14 and 3.6.4...
Daniel Hiller
1

votes
1

answer
178

Views

List files restored from AWS Glacier to S3, time remaining?

When you restore files from AWS Glacier, they go to a temporary location in S3 and remain there for the period specified in the restore request. If that request was made by another tool, is there a way I can see the temporary storage location, and the time remaining in the temporary period? s3api li...
Oli
1

votes
2

answer
1.2k

Views

AWS CLI - how to generate security tokens for a cognito user

Ultimately, I need to generate a AccessKeyId, SecirutyKey and SessionToken for a user in a Cognito User Pool so I can test a lambda function as a cognito user using Postman. So far, I've spent 2 days trying to figure this out. It seems that this would work: aws sts assume-role-with-web-identity --ro...
Dar
1

votes
1

answer
39

Views

How to automatically switch policies of roles (Terraform)

I've created 2 roles using Terraform (Engineering.tf, Finance.tf)- Engineering with AdministratorAccess policy, and -Finance with Billing policy. I need to write a script to switch the roles policies every 10 min (endless loop) I'm not sure how to do that when dealing with Terraform files
Morgen Moran Levy
1

votes
1

answer
245

Views

How can I use python (BOTO3) to cycle through all AWS EC2 instances and remove a security group from them? [duplicate]

This question already has an answer here: BOTO3 — Attach / Detach Security Group from EC2 instance 1 answer I am looking for a script that will cycle through all of my AWS EC2 instances, check for a specific security group, and then delete that group from the instance. I've been reading through t...
RaptorPete
1

votes
1

answer
167

Views

EC2 Auto Scaling create-auto-scaling-group with two Tags

I need to create auto-scaling-group with AWS CLI command. And that ASG needs to have two tags. I'm trying with: aws autoscaling create-auto-scaling-group --auto-scaling-group-name usr --launch-configuration-name TEST --min-size 0 --max-size 20 --vpc-zone-identifier subnet-xxxx --tags ResourceId=usr,...
Goran Jamicic
1

votes
0

answer
55

Views

how to stop the system .service using aws iot job

i'm trying to stop service which is running in my iot device through aws-iot job for this purpose. i follow this link https://github.com/aws/aws-iot-device-sdk-js to start,stop and restart my service through this link i can able to reboot my iot device, likewise i also need to start,stop and resta...
muthu
1

votes
3

answer
200

Views

AWS Rekognition and s3 calling subfolders in Python Lambda

I'm having trouble figuring out how to access a certain folder within a bucket in s3 using Python Let's say I'm trying to access this folder in the bucket which contains a bunch of images that I want to run rekognition on: 'myBucket/subfolder/images/' In /images/ folder there are: one.jpg two.jp...
user2624768
1

votes
1

answer
79

Views

AMI from create-image not maintaining user-data modifications, but console Launch is

TL;DR: when launching an instance of an AMI created with CLI aws ec2 create-image the previous applied user-data is gone, whereas launching off an AMI created in the console has all user-data modifications. Scenario: I want to automate creation of a custom AMI for our use which itself is based on a...
Marakai
1

votes
0

answer
30

Views

Monitoring AWS Kinesis stream on the shell console

I am sending data stream to AWS kinesis service and want to check if the kinesis received the data. What I expect is real-time output on shell console like redis does: Wonder if AWS CLI supports features like that.
Julian
1

votes
0

answer
88

Views

aws s3 sync on a 7TB folder hangs forever

I'm trying to sync around 7TB from a non EC2 instance to S3. So fare I have managed to sync a 500GB folder in something like 3hours. Which is quite good. However, I'm now trying to sync a 7TB folder and it just get stuck. It has been now 1hour and the debug logs are stuck here: 2018-06-01 18:05:05,9...
Marco
1

votes
0

answer
205

Views

register-task-definition environment variables in separate jsonfile

I am currently registering a task definition using this line in circleci: aws ecs register-task-definition --cli-input-json file://.circleci/taskdefinition.json taskdefinition.json looks like this: { 'containerDefinitions': [ { 'portMappings': [ { 'hostPort': 0, 'protocol': 'tcp', 'containerPort': 8...
Moddaman
1

votes
1

answer
61

Views

AWS CLI covert pdf to sdf or json for CloudSearch index

I am working on a document search tool using CloudSearch in AWS. The index only takes XML or JSON. I would like to index the document content along with metadata, but can't figure out how to convert the pdf (and Excel) files into a format that CloudSearch accepts. I have seen references to cs-import...
Kyle
1

votes
0

answer
34

Views

Protect root volume for AMIs with product code

we found that it is possible to take a snapshot of the root volume of an AMI with a Marketplace product code. From this snapshot it is easy to create a new AMI (this one has the product code), or mount it on a new instance and copy the content to another volume and create an AMI from it without the...
Hans
1

votes
1

answer
137

Views

set AWS_PROFILE is not working for powershell

I have multiple profiles in my aws config file. Instead of adding --profile in each command, I want to set the profile to a particular profile before executing the commands. I tried using 'set AWS_PROFILE profilename'. It's working when I open new powershell prompt but I want in the same prompt. Som...
Akhil Teej
1

votes
1

answer
344

Views

how to download S3 bucket files using Python

My requirement is to download files from S3 bucket on daily basis based on the date filter (ex: day=2018-07-14). We are successfully able to download using AWSCLI using the below code aws s3 cp s3:///day=2018-07-14 local_dir --recursive But I would want to download using Python script (may be boto3...
Pradeep
1

votes
1

answer
88

Views

How to choose a profile in AWS CLI?

I am entering aws through okta and I am stuck. I did all the necessary stuff from cloning the okta repo to downloading aws cli to my ubuntu machine. I identified myself with my username, password and push notification. Next I choose a role. After that I am getting such a message (look picture). How...
Michel
1

votes
0

answer
78

Views

AWS CLI command list for checking limits?

I'm working on a project where a single section of our deployment pipeline can easily take up to an hour to deploy onto AWS. We have about 30 steps in our pipeline and one of the primary time killers of spinning up a new environment is hitting a random limit in AWS. I've searched their website for c...
Jacob Chesley
1

votes
0

answer
122

Views

Unable to update ElasticSearch access policy using CLI

I have an access policy that looks something like this: { 'Version': '2012-10-17', 'Statement': [ { 'Effect': 'Allow', 'Principal': { 'AWS': '*' }, 'Action': 'es:*', 'Resource': 'arn:aws:es:us-east-1:123456789012:domain/es01-vpc01-prod-useast1/*', 'Condition': { 'IpAddress': { 'aws:SourceIp': [ '123...
cbp
1

votes
2

answer
969

Views

AWS S3 Sync --force-glacier-transfer

Few days back i was experimenting with S3 & Glacier and my data was archived so restoring it back i had to use their expedited service (which costs a lot). I want to move all of my content from one bucket to another bucket in same region same account. When i try to sync the data it gives following e...
ieatbytes

View additional questions