Questions tagged [aws-cli]

aws <command> <subcommand> help

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

In the AWS CLI how do I treat a special character as a string?

I'm trying to run an AWS CLI command for a resource with a ! in its name. I'm doing this from Centos docker instance running on my local device a MAC and if I run echo "$SHELL" it says it ...
0
votes
0answers
4 views

What is the benifit of useing AWS Systems manager rather than aws secure token service?

I saw this question about running CLI commands on an instance How to run a script or a command on EC2 instance via AWS CLI? They I can already run CLI commands with a secure token service but all the ...
0
votes
1answer
8 views

How do I edit my AWS ASG scheduled action useing the aws CLI

my scheduled action is called training my ASG is called temp_4_jenkins as I was planning to set up a pipeline on a Jenkins on my personal account to run the CLI commands. aws application-autoscaling ...
1
vote
0answers
17 views

Can Gitlab Auto DevOps provide an aws/dynamodb-local service without being customised?

I'm using an aws/dynamodb-local Docker container for use during local testing of my Node application and I'd like to integrate it with my Gitlab CI test job. I have made a rudimentary extension to ...
1
vote
0answers
12 views

Allow specific AWS permissions(Lambda, S3) / roles to specific Jenkins Jobs within same AWS account

We have one AWS account in which an Ec2 instance is running where Jenkins is installed, and we have attached an IAM role to it, with s3 access permission. We have Jenkins jobs which needed aws ...
1
vote
1answer
21 views

`UnauthorizedResourceAccessException` when calling `aws workdocs create-user`

When calling aws workdocs create-user, I'm getting UnauthorizedResourceAccessException or UnauthorizedOperationException. I believe I have all of the permissions required. What could be causing this?...
0
votes
1answer
58 views

Was AWS Secrets Manager removed from AWS CLI commands?

If I enter: aws secretsmanager get-secret-value --secret-id my secret id It says invalid choice. aws: error: argument command: Invalid choice, valid choices are: and doesn't list ...
2
votes
1answer
30 views

Cross Account EC2 Access from within Amazon Workspace

I have a requirement to setup a bastion host (Amazon Workspace) to connect to an ec2 instance living on a different account. As Amazon Workspaces cannot assume a role the way EC2s can, A cross ...
2
votes
1answer
62 views

Get tagging to work on AWS CLI

I am trying to tag commit hash and app version onto the ECS service to make it easier for developers to identify the service with the code. But I get this error + aws ecs tag-resource --resource-...
1
vote
2answers
24 views

Is there a policy that can limit the growth of an AWS S3 buckets total size?

We have an AWS S3 bucket that accepts uploads from untrusted sources which are then processed and moved out of the bucket. Is there a Policy that can limit the growth of the bucket to some ...
1
vote
1answer
522 views

Running a command as a specific user on an ec2 using ssm

Background I want to automatically configure an EC2 via a build, using the aws cli and ssm. The (manual) setup for the container looks something like this: Create an EC2 Run a shell script as root ...
1
vote
1answer
24 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
49 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 ?
3
votes
1answer
668 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
1answer
34 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 ...
1
vote
1answer
66 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
91 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 ....
2
votes
2answers
147 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?
2
votes
0answers
1k views

How to override the user for ECS task via CLI? [closed]

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 ...
4
votes
4answers
794 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
59 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
1k 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 ...
3
votes
1answer
315 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
45 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-...
4
votes
3answers
1k 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 ...
5
votes
2answers
2k 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
280 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
4k 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 ...
5
votes
2answers
4k 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
1k 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
6k 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 --...
14
votes
5answers
24k 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
2k 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
1k 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 ...
11
votes
4answers
26k 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
30 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
4answers
2k 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
8k 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
841 views

How to 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 ...