Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [aws-cli]

aws <command> <subcommand> help

1
vote
0answers
18 views

How to override the user for ECS task via CLI?

I've got a Task Definition with parameters which executes a script using a regular user. I'd like to test the script without changing the Task Definition by overriding the default user which script ...
0
votes
0answers
19 views

AWS golang SDK get configuration variables

Is it possible to get with AWS Golang SDK custom configuration variables the same way you can get them with aws cli? As an example, I have in my ~/.aws/confg [profile test] region = eu-central-1 ...
3
votes
3answers
75 views

How to see when an AWS IAM role was last used?

In AWS in the GUI you can select a role and then click on delete, then when you are prompted to approve or deny the deletion it shows you when the role was last used. I would like to be able to know ...
3
votes
1answer
37 views

AWS CLI --profile with duration > 1h

With the AWS CLI you can assume a role using the --profile parameter: aws --profile <profile_name> <service> <command> e.g.: aws --profile admin s3 ls s3://mybucket/ That profile ...
0
votes
0answers
71 views

copy task definition in aws ecs

Is there a way to copy ECS Task definitions cross region? I know that there isn't any in the console, and I'm familiar with aws ecs describe-task-definition --task-definition in the CLI. Can I just ...
1
vote
1answer
353 views

Different download speeds from AWS S3 CLI vs Console/Websites

I'm experiencing much slower traffic for the exact same files when downloading (or uploading) them via the AWS website vs. downloading them via the CLI. Is there a known reason for this? Is there ...
2
votes
1answer
87 views

Configure AWS cli inside chef cookbook

I am working on setting up something with S3 and Chef, I have AWS CLI installed and working but I need to figure out how to specify the access ID and the secret access key. I know there are cookbooks ...
1
vote
1answer
31 views

AWS Security Group Creation Using AWS CLI

I have created a security group in AWS. I have added the ingress rule using the below command aws ec2 authorize-security-group-ingress --group-id sg-07xxxx4d --ip-protocol tcp --from-port 22 --to-...
3
votes
2answers
435 views

Amazon EKS from local kubectl does not cache MFA token/session

I have set up an EKS cluster in AWS. My user-account there is secured with MFA. And I have an assumerole, that is allowed to manage my infrastructure. So I installed and configured my system as ...
4
votes
2answers
507 views

How to find out the used Key pair name via AWS CLI?

I'm aware of get-password-data command which can display PasswordData data like: $ aws ec2 get-password-data --instance-id i-0123456789 { "InstanceId": "i-0123456789", "PasswordData": "\r\...
0
votes
1answer
144 views

How to access ephemeral storage of EC2 instance?

I've got ephemeral storage setup in Scalr as part of the role. The instance is spinned up by Chef and it seems it is running fine (it's using ephemeral0 device mounted as D: drive). I've tried to use ...
3
votes
1answer
1k views

How to export EC2 snapshot into S3 bucket?

I've created a snapshot of EC2 instance via: aws ec2 create-snapshot --volume-id vol-xyz In aws ec2 create-snapshot help we can read: Creates a snapshot of an EBS volume and stores it in Amazon ...
1
vote
2answers
1k views

How to avoid output being truncated when running AWS SSM command?

I've got the following AWS CLI commands to run the PowerShell's Invoke-WebRequest command: instanceId=i-0xyz # Change this. cmdId=$(aws ssm send-command --instance-ids "$instanceId" --document-name "...
0
votes
2answers
524 views

How to get instance's route table id using CLI?

I'd like to find a route table id associated with the given EC2 instance. How can this be achieved using AWS CLI? I've tried to use aws ec2 describe-vpcs, but the route tables are not there. I'm ...
3
votes
2answers
1k views

How to list security groups for the specific instance via CLI?

I'm looking for syntax like: aws ec2 describe-security-groups --instance-id i-0xyz however, the above sub-command doesn't support --instance-id parameter. I've checked and there are --filters and --...
8
votes
4answers
5k views

How to run a script or a command on EC2 instance via AWS CLI?

According to New EC2 Run Command news article, AWS CLI should support a new sub-command to execute scripts on remote EC2 instances. However I've checked in aws ec2 help, but I can't find the relevant ...
0
votes
1answer
857 views

How to send sms to a phone number using aws sns cli? [closed]

I am using the following command. Getting Authorization error. aws sns publish --phone-number +91XXXXXXXXXX --message hello An error occurred (AuthorizationError) when calling the Publish operation: ...
3
votes
2answers
554 views

List encrypted RDS snapshots using CLI

I have automated the RDS snapshot copy across the region, but the Snapshot which is encrypted gets fail to copy. I have figured a way to copy an encrypted snapshot using $ aws rds copy-db-snapshot ...
8
votes
3answers
12k views

View all AWS S3 buckets and list each buckets storage used

I have multiple AWS accounts and I need to list all S3 buckets per account and then view each buckets total size. Currently, I can only view the storage size of a single S3 bucket with: aws s3 ls ...
3
votes
1answer
26 views

What is the ec2 cli command to modify the minimum number of nodes in a scaling group?

I've got an ec2 autoscaling group that starts in the morning and finishes in the evening. I'd like to create a 'button' that people can click to warm up the autoscaling group to run jobs in the middle ...
2
votes
2answers
937 views

How can I get a list of encrypted disks for instances that are running on the AWS CLI?

There is a great question here about how to get a list of encrypted disks. I'm currently using the describe-volumes command. For the record I'm currently using: aws ec2 describe-volumes --region us-...
3
votes
1answer
3k views

How to get environment variables in ECS container?

What AWS CLI command should I be using to access the environment variables in an AWS ECS cluster's task's container? I've seen describe-cluster, list-tasks, describe-tasks, describe-container-...
11
votes
1answer
510 views

Set up AWS Trusted Advisor alert for Service Limit warnings

All I want in life is for AWS to shoot me an email when any of Trusted Advisor's Service Limits go to WARN or ERROR status. I've checked their guides, tried chatting with support and no one can get ...