All Questions
Tagged with amazon-web-services aws-cli
296
questions
0
votes
1
answer
20
views
unable to get AWS session via AWSPowerShell in Milano Region via STS
I am using some AWSPowerShell script to get reports from my instances.
I have old working instances in Tokio region ap-northeast-1, new instances were deployed in Milano region eu-south-1,
To get ...
1
vote
1
answer
60
views
How can I list the files that are in one S3 bucket but not in the other bucket?
I have two AWS S3 buckets that have mostly the same content but with a few differences. How can I list the files that are in one bucket but not in the other bucket?
0
votes
1
answer
149
views
Why does `aws s3 ls s3://mybucket/ --recursive | wc -l` list fewer files than the number of objects mentioned in the AWS web UI in my S3 bucket?
I have an AWS S3 bucket s3://mybucket/. Running the following command to count all files:
aws s3 ls s3://mybucket/ --recursive | wc -l
outputs: 279847
Meanwhile, the AWS console web UI clearly ...
3
votes
3
answers
432
views
How can one copy an S3 bucket as faithfully as possible (e.g., copying all permission settings)?
I want to copy an S3 bucket as faithfully as possible (e.g., copying all permission settings).
The standard:
aws s3 sync s3://old-bucket s3://new-bucket --source-region us-west-1 --region us-west-2
...
1
vote
1
answer
61
views
AWS CLI Return Nested Results
I am trying to execute an AWS CLI query for EC2. I have crafted the query below, but the triple nesting seems to be throwing things off for InstanceStatus.Details.Status.
aws ec2 describe-instance-...
0
votes
1
answer
504
views
Get AWS role name from EC2 instance list using CLI
AWS CLI requests "ec2 describe-instances" and "ec2 describe-iam-instance-profile-associations" include instance profile in the "IamInstanceProfile" property.
This ...
0
votes
2
answers
908
views
What does `aws configure` actually do?
It's important to understand from a security standpoint what aws configure actually does behind the scenes. Having read the docs, I'm still not clear on this.
We have chosen to move the credentials ...
0
votes
1
answer
305
views
Restrict AWS SSM access to SSH only
I need to restrict some users AWS SSM access to SSH only. These users should only be able to start a SSH session via SSM like this:
ProxyCommand sh -c "aws ssm start-session --target %h --...
0
votes
0
answers
806
views
AWS ECR Login error
AWS ECR Login error:
command: aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin {id}.dkr.ecr.{region}.amazonaws.com
An error occurred (...
-2
votes
1
answer
154
views
about setting up your local AWS development environment
new to AWS here.
Wanted to set up my new Project on the cloud and donate some money to Jeff.
How would you set up your local environment today when starting a cloud project?
I have issues seeing the ...
0
votes
1
answer
576
views
Cannot create aws lambda function. error: the following arguments are required: --runtime, --handler
I am trying to deploy an image to be run in aws lambda at a scheduled interval. I have built and tested the image using RIE and locally it runs as it should. Next I have pushed the image to aws ecr to ...
0
votes
0
answers
1k
views
Amazon AWS CLI: How do I find out what actions/permissions/policies are attributed to a role?
I'm on Linux and using the AWS CLI.
I tried running the following:
aws iam list-instance-profiles-for-role --role-name role-abc-123
aws iam get-role --role-name role-abc-123 --query 'Role....
0
votes
0
answers
86
views
Switch to a different AWS accounts in the UI
I currently have AWS configuration set up with my access key id and secret access key (i.e. I see this when going to 'aws configure' in the CLI). I then login through my company's OKTA to then access ...
0
votes
1
answer
1k
views
AWS CLI : How to use "--query" to get output from nested JSON
I am using aws-cli v2 to get the --query output from AWS Describe-volumes. In this, I am trying to get the volume id, size, Instance ID, state. Instance ID is nested in the AWS Describe-volumes.
...
1
vote
0
answers
45
views
How do I change a port restricted IP in a Lightsail instance via API?
I have a port that is IP-restricted in a Lightsail instance. How do I change that restricted IP via API or even aws-cli?
I prefer via API using cURL.
Thanks in advance.
0
votes
1
answer
897
views
"route53:ListHostedZones with an explicit deny" error in the AWS console despite having AmazonRoute53FullAccess permissions
I'm trying to run this command in the AWS console:
aws route53 list-hosted-zones
I'm using my access key/secret and it worked fine in a demo account. I checked with my team and I have the ...
0
votes
0
answers
230
views
How to locate a specific request in AWS, cloudtrail or Athena
How locate a specific request in AWS, cloudtrail or cloudwatch?
Request on 2022-11-17T17:07:52.037Z
General:
Request URL: https://0712f1246-1104-y-https-www-abc-com.mplbci.ekb.eg/access
HTTP Version: ...
0
votes
1
answer
289
views
Does AWS CLI bring data across local network when doing `aws s3 mv` between two S3 locations?
When moving data between two S3 locations using the AWS CLI, for example:
aws s3 mv s3://bucket/prefix s3://bucket/other-prefix
Is the data downloaded to your local computer and then re-uploaded? Or ...
2
votes
1
answer
7k
views
Why does an S3 to S3 copy care about VPCs? Related to error: "VPC endpoints do not support cross-region requests."
Goal: Get files
from Bucket 1 in ca-central-1 in Account A
to Bucket 2 in us-east-1 in Account B
using the AWS CLI from a third machine using an the IAM role with correct S3 read and write ...
-1
votes
2
answers
2k
views
Error to login ecr docker
I'm trying to login ecr with docker to upload the container, but it always returns an error. The cli configuration is ok.
I'm following the documentation that aws provides, but still to no avail.
...
2
votes
1
answer
3k
views
Copying files to/from EC2 instance using SSM alone (no SSH or S3 bucket)
I'm trying to setup a ready-to-run terraform template for some performance testing. It creates two EC2 instances in the same cluster placement group and preinstalls a bunch of tools. I don't know the ...
0
votes
0
answers
169
views
EC2 instance DNS resolving issue
How do I identify the EC2 instance causing DNS (my website) resolving errors?
I have some instances in my VPC, one of them is creating an error, I did not enable monitoring for this VPC and the ...
1
vote
0
answers
76
views
Reduce Query Syntax for ends_with()
I have the following query:
--query "Contents[?ends_with(Key, 'jpg') || ends_with(Key, 'NEF') || ends_with(Key, 'nef') || ends_with(Key, 'CR2') || ends_with(Key, 'cr2')]"
Is there a way to ...
0
votes
1
answer
387
views
aws cli import access key in json format
With the aws cli (version 2) I have created an access key for an iam user, which produces json output. I pipe that output to a file.
Now I would like to import these credentials to my aws cli ...
0
votes
1
answer
402
views
How can I find the list of instance types that do not require ENA and the list of AMIs that support ENA?
I have this Terraform file -
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.23"
}
}
required_version = ">= ...
1
vote
0
answers
2k
views
How to connect aws instance with aws cli?
I don't have ssh key but I have access to aws portal and console where the ec2 machine is there.
I tried using the steps in this link to connect ec2 instance.
Method 1:
using only instance-id and mssh
...
0
votes
0
answers
89
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?
1
vote
1
answer
14k
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
3k
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 ...
6
votes
2
answers
3k
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
886
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 ...
2
votes
1
answer
6k
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
85
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
443
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
3k
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
259
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
190
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 ...
1
vote
0
answers
783
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 ...
2
votes
2
answers
3k
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 ...
2
votes
1
answer
2k
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
1
answer
284
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 ...
3
votes
3
answers
869
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
1
answer
618
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 ...
1
vote
0
answers
577
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&...
2
votes
1
answer
5k
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
409
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 ...
0
votes
3
answers
5k
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
506
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
332
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 ...
2
votes
1
answer
586
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-...