Questions tagged [aws-cli]
aws-cli is the Amazon Web Services Command Line Interface
351
questions
0
votes
0
answers
6
views
How to list all function apps and it's storage account
Is there anyway to combine both commands below where it lists all the function app together with the storage account used for it?
This command gets all the function app in the subscription
az ...
0
votes
0
answers
14
views
How to get aws account id from local configuration?
I'm well aware of the aws sts ... method but that requires a remote call. Is there a way to get my account id/number from local configuration?
0
votes
1
answer
21
views
How do I extract a list of all folders of my AWS S3 storage bucket or directories?
Does Amazon provide an easy way extract a list of all folders that have files greater than 500 MB from a s3 bucket? want to limit the scope to the '/files/ftp_upload/' directories also This is so I ...
0
votes
0
answers
22
views
AWS BYOIP: The CidrAuthorizationContext signature could not be verified with the X509 certificates in the RIR records
My goal
I am trying to bring my own /46 IPv6 prefix to Amazon AWS following this documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip
What I need in a ...
0
votes
0
answers
66
views
How to run aws cli on amazon linux container?
I want to run amazon linux commands as part of gitlab pipeline.
So, trying to use docker image as runner, amazonlinux:latest
So, connected to docker container and ran below command.
yum -yq install ...
0
votes
0
answers
12
views
AWS CLI restrict restart of only one instance at a time
We have hub and spoke model in our AWS environment.
We are allowed to perform AWS CLI commands from our HUB instances on all other instances.
This includes Stop/Start, so we would like to restrict ...
5
votes
1
answer
209
views
AWS Root volume Encryption
In my scenario, I have some old EBS volumes that are not encrypted. To satisfy new corporate security measures, all data needs to be encrypted so I need to compile a plan to encrypt the unencrypted ...
0
votes
1
answer
23
views
How do I switch to another organization in the AWS console?
My company has two organizations: one is the primary organization that my user is part of. The other is a new one created for testing purposes.
I need to switch to that organization to create an S3 ...
0
votes
0
answers
6
views
Commands for AWS FSx shadow copy
We have enabled shadow copy in AWS Fsx I want schedule triggers with IST timezone there is no commands are mentioned in documents please help with the commands to schedule shadow copy with IST ...
0
votes
1
answer
302
views
How to retrieve binary file from aws secrets manager using aws cli
After uploading a binary secret using something like
aws secretsmanager create-secret --name my-file-secret --secret-binary fileb://mysecret.file
I'm having trouble retrieving the file using the CLI.
...
0
votes
1
answer
62
views
AWS CLI Usage Issue
In our scenario, We previously had some AWS keys. The IAM interface show/showed no usage for it but the employee has been able to upload resources. Could anyone advise how to check if the interface is ...
0
votes
0
answers
32
views
Providing working-directory in AWS CLI ECS run-task command
Is there any way of overriding the working-directory from the task-definition default when starting a task from the CLI? It seems like a fairly easy thing and a potentially important thing, but, if it ...
0
votes
1
answer
303
views
How to download millions of s3 files and compress them on the fly?
I have an S3 bucket with millions of files, and I want to download all of them.
Since I don't have enough storage, I would like to download them, compress them on the fly and only then save them. How ...
1
vote
1
answer
38
views
Not able to list all the images
I am trying to list all the images which has the name Ansible*.
If i can pull it off, i can use it to clean my AMI's that are created during patching activity. i am trying it via SSM Automation ...
0
votes
1
answer
96
views
S3 Logs event Issue
Is there a way to see what actions the 'g2' IAM user is performing in S3, and which IP(s) they are running from? I have already enabled the logging of S3 actions.
One point I’m still not able to ...
0
votes
0
answers
47
views
Why does AWS take a long time to change the password of DB Clusters?
I'm running this command to change the master user password of a DB Cluster on AWS:
aws rds modify-db-cluster --db-cluster-identifier development-db \
--region us-east-2 --master-user-password ...
1
vote
1
answer
586
views
Can't use execute-command --interactive in AWS CLI session manager
I'm trying to use the AWS cli + session manager plugin to get into a database container to run some migrations, and I am struggling to get it working. I'm trying to use the following command:
aws ecs ...
0
votes
0
answers
50
views
ERROR: NotSupportedError - The EB CLI cannot find your SSH key file for keyname
Trying to deploy an app on AWS and this is only one of the hurdles I've had to deal with. I am trying to connect to an Elastic Beanstalk instance and when I attempt to connect with the awsebcli tool I ...
0
votes
0
answers
141
views
How to Bulk Delete 1.4 Million AWS S3 Access Logs
We hadn't specified a target bucket for our AWS access logs & I believe we set up an infinite loop https://aws.amazon.com/premiumsupport/knowledge-center/s3-server-access-logs-same-bucket leading ...
0
votes
1
answer
132
views
Is it possible to upload files along with initialization script on EC2 instance when running it with AWS CLI?
I have nginx configuration files which I would like to deploy on my Ubuntu EC2 instance. I create instance using AWS CLI:
aws ec2 run-instances --instance-type t2.micro \
--count 1 \
--image-...
0
votes
1
answer
174
views
Could not resolve host: mirrors.iuscommunity.org
I'm not able to install or update the package on my centos machine .
check with
vi /etc/sysconfig/network-scripts/ifcfg-lo
ONBOOT=yes
NAME=loopbac
[ec2-user@ip- ~]$ sudo yum update
Loaded plugins: ...
0
votes
0
answers
34
views
How to show which resources are connected to (depend on) which other resources in AWS
Is there a way to show which resources are connected to what other resources in AWS? Basically the kind of information that would allow one to understand/view the current architecture.
There are CLI ...
2
votes
3
answers
92
views
Is there a minimal aws cli installation?
Sometimes I'd like to spin up an instance and run an aws cli command on it quickly, but there seems to be a great delay in installing the aws cli. Is there any way to get a "minimal" ...
0
votes
0
answers
84
views
determine IPv6 address of AWS EC2 instance from CLI
Previously, I was able to find the auto-assigned IPv6 address of an Amazon EC2 instance with something like the following:
aws ec2 describe-instances --region us-west-2 --instance-id i-...
0
votes
1
answer
232
views
how to download archive in aws s3 glacier
first, sorry for my bad english.
i create a vault in glacier service and then i uploaded an archive into vault and in out-put, aws gave back me a archive id. then using the archive-id, i created a job ...
0
votes
0
answers
97
views
CDK WAF Python Multiple Statement values error
I have AWS WAF CDK that is working with rules, and now I'm trying to add a rule in WAF with multiple statements, but I'm getting this error:
Resource handler returned message: "Error reason: You ...
0
votes
1
answer
118
views
Ansible EC2 metatadata options?
I'm trying to get Ansible EC2 to provision instances that require IMDSV2.
Through the aws ec2 run-instances I'm able to do it by adding --metadata-options "HttpEndpoint=enabled,HttpTokens=...
1
vote
0
answers
94
views
AWS-CLI EC2 AMI :: Get details about owner via OwnerId
Given the OwnerId field returned from an AWS ami query such as:
$ aws ec2 describe-images --image-ids ami-015f906ef3e2123c0 --region ap-southeast-2 --query Images[].OwnerId
[
"602401143452&...
1
vote
1
answer
1k
views
How can I search across CloudWatch log groups on AWS?
I have a number of lambda functions which run my serverless backend. Something somewhere is misbehaving, and I need to bring up/search all the logs from a particular time — from all log groups, not ...
0
votes
0
answers
92
views
How can I let apache server work always on my ec2 instance?
I am learning aws's EC2 server. I configured apache and php. I started the apache server with the command
Sudo service httpd start
But every time I stop my pc, or the next day, when I want to continue ...
2
votes
2
answers
3k
views
How to *actually* exclude a directory in AWS S3 sync?
The aws s3 sync command has an --exclude flag which lets you exclude a folder from the sync. However, even though the files are not uploaded from that directory, the command still looks at and ...
0
votes
2
answers
1k
views
Is there a way to export all AWS Security Groups to CSV? moreover, is there a recommended way of keeping track of SR changes?
We have a relatively small dev environment in AWS with about 50 Security groups with multiple permission entries. is there a recommended way of keeping track of SR changes, Access, etc?
My manager ...
0
votes
0
answers
199
views
Can i access an EKS cluster , if i don't have access to iam user that created it?
An AWS admin , created an IAM user , and that user created an EKS cluster. Now , we don't have access to that IAM user.
If , we try to execute , kubectl , commands on that EKS cluster from a new IAM ...
0
votes
1
answer
214
views
AWS Glacier and Ransomware
I'm trying to understand the structure of how AWS Glacier works because I have a problem.
Problem:
I have a NAS that backs up to Glacier about once a week. About two weeks ago the NAS got infected ...
-1
votes
1
answer
31
views
How to control AWS EC2 live from a web app [closed]
We are building some penetration testing stations (both attack & target) for a hackathon in AWS VPC and I need a way to control the following in a live setting:
VPN connection access: if someone ...
1
vote
1
answer
99
views
Schedule RDS upgrades/downgrades
I have a project that sends notifications to various services. Users manage their subscriptions 24 hours a day, but we need a stronger MySQL RDS instance during the week (t3.xlarge), specifically Tue-...
1
vote
1
answer
944
views
AWS Cloudformation Template error: every Ref object must have a single String value
SNSTopic
Type: 'AWS::SNS'......
SNSTopic2
Type: 'AWS::SNS'.......
EventRule:
Type: 'AWS::Events::Rule'
Properties:
Name: !Ref EventRuleName
Description:
State: ...
-2
votes
1
answer
1k
views
How can I connect AWS by using AWS-CLI in Windows Subsystem Linux?
I am totaly new for AWS I am trying to use awscli by calling below code :
root@DESKTOP-QK5VI8R:~# aws s3 ls
I applied lots of solution for that:
I added port 8888 into Inbound/Outbound Rule set in ...
1
vote
0
answers
153
views
Create custom AMI for Aarch64 with latest Debian and custom Kernel
I am trying to create a custom Debian based AMI with my own custom kernel for AWS EC2 instances,
specifically I'm trying to run it on t4g.micro/medium instances.
I debootstrap an ARM64 Debian and copy ...
0
votes
0
answers
90
views
Terminating AWS ECS services and tasks automatically
We have created a ECS cluster with Fargate and have created few tasks in service to be used in a CI/CD pipeline. Service has desired count of 1. So if we terminate any task, new task comes up ...
3
votes
0
answers
1k
views
AWS - VPC creation date
Could you possibly let me know how I can check when the VPC has been created? Or how to check in cloudtrail who created vpc via cli?
I've tried to use cloudtrail and search in event name for CreateVpc ...
0
votes
0
answers
62
views
Copy old data from local Centos to AWS S3 bucket
I have the following task to complete. I hope someone can provide the feedback to get me started.
We have a directory with thousands of images in many folders and sub-folders
The goal is to have a ...
0
votes
1
answer
106
views
Add Error Logging to script
I have the following Big Sur Mac OS script:
#!/bin/zsh
/usr/local/bin/aws s3 cp /Library/FileMaker\ Server/Data/Backups/S3/noon_db_* s3://testbackupnoon
rm -rf /Library/FileMaker\ Server/Data/...
0
votes
2
answers
334
views
How to check via aws cli if a Security Group description contains a secific string?
Using aws cli, I would like to be able to fuzzy search for a part of a string in the 'description' of a Security Group.
For example let's say Security Group sd-afafaf00 contains "Hey there kaipee&...
2
votes
1
answer
549
views
pip upgrade downloading every previous version until storage is full
On CentOS 7, I am trying to upgrade awscli:
/usr/bin/python3 -m pip install awscli --upgrade --user
Why is this downloading every single previous version, until there is finally no space left on ...
0
votes
1
answer
352
views
AWS WAF Web ACL Rule -- programmatically get details
While adding resources to protect with AWS Shield Advanced through the console, the 'wizard' created a Web ACL rate-limiting rule, which I can see in the console under
AWS WAF > Web ACLs > ...
0
votes
2
answers
54
views
AWS backup is not in the list of command line interface commands
When I'm trying to use aws backup on my AWS server through command-line interface, but it's not in the list of available commands. How do I add this in?
Currently when I run
aws backup
I get the ...
1
vote
1
answer
64
views
What is the best way to attach instance to auto scaling?
This is my first post so hope I will get the answer.
I want to create auto scaling on my existing EC2 instance, so I found this approach so hope someone will tell me is it good ( or suggest me how to ...
1
vote
1
answer
401
views
How to tag launch template _itself_ in AWS with JSON and `create-launch-template` AWS CLI
While creating EC2 launch templates with the create-launch-template AWS CLI ec2 command and a JSON spec, I can't seem to figure out how to tag the template itself. I'm providing the TagSpecifications ...
1
vote
1
answer
936
views
How to automate the generation of the table schema json for aws dynamodb create-table?
Currently if I run aws dynamodb create-table --generate-cli-skeleton, it will generate a template for me to fill in column definitions etc to create a new dynamodb table.
I want to be able to dump ...