Questions tagged [aws-cli]

aws <command> <subcommand> help

Filter by
Sorted by
Tagged with
1
vote
1answer
22 views

Kubernetes api service unit file

i was going through the kubernetes the hard way(kelsey), i see in the API server unit file with a cluster ip range as --service-cluster-ip-range=10.32.0.0/24 \ is it a default ip range ? my VPC ...
0
votes
2answers
13 views

AWS-CLI : to download IAM user with policy

aws : A single command(aws-cli) to get the IAM user name with the what all permission he/she have , would be great if can be downloaded as an excel or csv ?
2
votes
1answer
35 views

How to install aws cli on a self-hosted azure DevOps Windows agent?

I have quite some difficulties installing aws cli on a self-hosted Azure DevOps Windows agent as part of a pipeline. Does anyone have a working solution? What I have tried so far: a) install aws cli ...
0
votes
0answers
23 views

Selectively uploading multiple folders to AWS S3 using CLI

I have around 50 folders, which contain subfolder, I want to upload the folders including the subfolders to an S3 bucket, while keeping the subfolders structure. I read I can use --include command ...
0
votes
0answers
3 views

Create s3 bucket against a 3rd party endpoint using aws cli

I'm using AWS CLI (command line tools) against a 3rd party S3 interface. https://docs.aws.amazon.com/cli/latest/reference/s3api/create-bucket.html I need to create a bucket but I don't see that the ...
0
votes
1answer
31 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 ...
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
33 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
45 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
35 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
660 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 ...
3
votes
3answers
244 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
52 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 ...
1
vote
1answer
905 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
205 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
40 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
826 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
1k 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
236 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
3k 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 ...
3
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
958 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
4k 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
14k 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 ...
-1
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
907 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 ...
10
votes
4answers
20k 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 ...
5
votes
3answers
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
6k 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
720 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 ...