Questions tagged [aws-cli]

aws <command> <subcommand> help

Filter by
Sorted by
Tagged with
0
votes
1answer
14 views

how to probe all running aws ec2 instances and their sec groups, etc to generate templates

Typically I spin up all aws ec2 instances together with all its accompanying security groups, volumes, etc ... by executing a series of aws cli commands however when I manually use the aws console in ...
0
votes
0answers
12 views

How to make sure the storage of an AWS isn't accessible without a private ssh key?

Is there a way to encrypt the EBS attached to an EC2 instance in such a way that it can't be re-attached to another EC2 instance and read by someone without the private key required to access the ...
1
vote
1answer
30 views

How can I 'aws s3 sync' two buckets, which are located in different accounts

I'm trying to use 'aws s3 sync' on the awscli between two accounts. Account A, I own. Account B, Owned by a third party. Account B has given a user:jon on account A permission to a bucket through ...
1
vote
1answer
31 views

How to override default aws region credentials for Terraform?

I am using Terraform to create aws resources. I practiced with a single region and with my aws cli credentials being used. worked great! however when I tried to override the region in the Terraform ....
1
vote
1answer
29 views

Cross account access from ec2 to other accounts

Is it possible to run aws cli from ec2 to create some resources in another account without using aws_secret_key and aws_access_key?
1
vote
0answers
377 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
21 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
112 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
44 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
197 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
650 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
159 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
36 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
665 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
847 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
197 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
2k 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 ...
2
votes
2answers
2k 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
807 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
3answers
3k 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 --...
11
votes
4answers
10k 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
1k 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
758 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 ...
9
votes
4answers
17k 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
28 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
1k 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
5k 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
645 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 ...