Questions tagged [aws-cli]
The AWS Command Line Interface (CLI) is a unified tool to manage AWS services.
4,377
questions
0
votes
0
answers
17
views
Issue with the AWS SSO setup with the Gossamer3
I am trying to setup AWS SSO using the Gossamer3 SSO tool with the default profile. When I did this for the first time, it worked fine. The connection to AWS was established in AWS CLI (using latest ...
0
votes
0
answers
22
views
AWS Amplify Access Is Denied After Deleting Cognito User Pool
EDIT
when I look at the @aws-amplify/cli folder in my node_modules, I can see there is an error with the tsconfig.json file but I can't see what the error is. Here is the tsconfig.json file:
{
"...
1
vote
0
answers
55
views
Error parsing parameter 'cli-input-json': Invalid JSON received when i passes the json inline [duplicate]
$targetGroupArn = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
$service = '{
"cluster": "democluster",
"serviceName": "demoservice",
&...
0
votes
0
answers
21
views
AWS SESv2 CLI: sending email to contacts subscribed to topic
I have created a contact list and am trying to use AWS SESv2 CLI to send an email to all contacts in the list that are subscribed to the "Announcements" topic:
aws sesv2 send-email \
--...
0
votes
0
answers
22
views
List of AWS SERVICE values used for GetDimensionValues
I would like to know what are all the possible values are for the SERVICE property that you can get from the AWS.CostExplorer.GetDimensionValues() function. Note, I don't want to know this for my own ...
0
votes
0
answers
33
views
How do I run the following Python and Boto3 code?
I'm trying to explore machine learning models from AWS. AWS recently released a Bedrock service, and I would like to setup an environment to do that. I would also need to interact with S3, Langchain ...
0
votes
0
answers
42
views
Unable to locate credentials. You can configure credentials by running "aws configure"
How to fix this in PowerSHell script?
I have same trouble in Ubuntu.
# both get-authorization-token cmds result are not visible for aws codeartifact cmd
$env:AWS_SESSION_TOKEN = aws codeartifact get-...
1
vote
0
answers
19
views
'in <string>' requires string as left operand, not int when trying to make lambda from aws-cli
I am trying to setup github actions to autodeploy lambdas when pushed to main but when i run
aws lambda create-function --function-name "helloWorld" --runtime nodejs20.x --role arn:aws:iam:.....
1
vote
0
answers
23
views
Getting no matches found error for aws logs list-tags-for-resource --resource-arn <arn-value>
I'm getting no matched found error while executing the below aws cli code
aws logs list-tags-for-resource --resource-arn <arn-value>
The arn-value above is a CloudWatch Log Group Arn.
I was ...
-1
votes
1
answer
25
views
Where does AWS CLI export files?
I am trying to export an OpenAPI specification from AWS API Gateway using AWS CLI. The request looks like this:
aws apigateway get-export --parameters extensions='apigateway'
--rest-api-id x8yfzmmuqh ...
0
votes
2
answers
42
views
is secret-id of a secret manger secret in AWS globally unique?
aws secretsmanager get-secret-value --secret-id ${secretId} --profile ${customProfile}
the above fails without the --region option but the below works without the region option
aws s3api get-bucket-...
1
vote
1
answer
17
views
How can i target a subset of ECS tasks for stop operation?
In my architecture, a single "job" may require N "tasks".
A user can start a job, allow many tasks to begin, then later cancel the job all together.
When this happens, i need to ...
0
votes
1
answer
24
views
MalformedPolicy when calling the PutBucketPolicy operation to upload a policy JSON: Policies must be valid JSON and the first byte must be '{'
I am trying to attach a policy to an S3 bucket using the AWS CLI with a JSON file containing the policy as input. My command is:
aws s3api put-bucket-policy --bucket myBucketName --policy file://...
0
votes
1
answer
31
views
get-log-events returns only a few results of many
I am logging to CloudWatch from a python lambda. In the AWS console I can see several hundred log entries, but if I try to use get-log-events from either a Python Boto call, or through the AWS CLI I ...
0
votes
1
answer
56
views
to get the instance count of a certain period via LaunchTime wrt Powershell
I have tried with the below
Is my Date format correct as per awscli LaunchTime ?
To get the last 5 Days Instance count which was created via LaunchTime with of AWS cli in Powershell:
$getDays = ...
0
votes
0
answers
33
views
Getting incorrect instances count via LaunchTime in Powershell [duplicate]
I am getting the incorrect instances count via LaunchTime while using Powershell, any idea of improvement here
Here is my snippets to fetch the instances details which were created in last 2 Days:
...
0
votes
0
answers
25
views
AWS cli lambda get-function returns unexpected result in codebuild
In aws codebuild, I'm using a bash script to check if the lambda functions exist, if it exists, I will update the source etc...
But the condition always returns true, or code exit 0.
I run the same ...
0
votes
0
answers
23
views
AWS Lex V2 start-import
I am migrating AWS Lex V2 chatbot. I have exported the Lex v2 model that I want to migrate an dit's in a zip file named DemoChatbot.zip. I have uploaded the DemoChatbot.zip in a s3 bucket called ...
1
vote
1
answer
570
views
AWS CLI V2 installation issue
I encountered a problem while trying to install AWS CLI v2 on Ubuntu 22.04 running on WSL. Here's the error message I received:
arun@ArunLAL555:~/Python-3.11.1$ aws --version
Fatal error condition ...
-1
votes
1
answer
107
views
How can I continue Terraform's execution if a data source does not find any results?
This command works perfectly fine for me via the terminal:
aws ssm get-parameter --name "/something/i/know/exists" --query "Parameter.Value" --output text
Output:
subnet-...
0
votes
2
answers
42
views
How do I connect to AWS Athena in R using paws via the CLI v2 sso?
I am using AWS CLI v2 to create a configuration file and login to AWS via sso on my computer. I am then trying to access the data stored in our database on AWS Athena through R using the paws package....
0
votes
0
answers
13
views
goofys: Can't access subdir from top dir even as a root user
I mounted the bucket from S3 with the following command
sudo goofys -o allow_other mybucket /mnt/buckets/mybucket/
inside mybucket, there are a bunch of subdirectories.
When I do rsync or cp (with ...
0
votes
1
answer
37
views
AWS permission to list subset of IAM roles
I have an IAM role my-role that I want to allow the aws iam list-roles call. However, I don't want to return simply all roles, but only some that are relevant to my-role, for example, those which are ...
1
vote
1
answer
61
views
sort ebs volumes using aws cli
I want to get list of all instances of xyz cluster (there will be 20 ec2s) along with volumes info (device name and volume id). Some instances have volumes in one order and some have it in different ...
0
votes
0
answers
37
views
AWS instance created in last 48 hrs or last T hrs via AWS CLI
I am following this link How to get the most recently launched EC2 instance with AWS CLI? but not getting appropriate results what I am expecting from
aws ec2 describe-instances --filters 'Name=tag:...
0
votes
0
answers
19
views
Jenkinsfile Username and Password credentials cannot pass over to Packer
I had
Jenkins ver 2.401.3
Packer 1.9.4
Below is my Jenkinsfile
pipeline {
agent any
environment {
AWS_CRED = credentials('AWS_SECRET')
}
stages {
stage('Packer - Build Ubuntu ...
0
votes
0
answers
26
views
Is it possible to pipe a bash formatted date to the AWS S3 CLI cp --include?
I am using the AWS CLI to copy files from the S3 bucket and am using the --include --exclude parameters to select files only from certain dates. My goal is to download only the files from the previous ...
0
votes
1
answer
70
views
Change username for user on AWS IAM Identity Center (AWS SSO)
I'm trying to rename the username of an existing user in the AWS IAM Identity Center (formally AWS Single Sign-On).
I know it's not possible to change the usernames in the AWS Console as the field is ...
0
votes
1
answer
33
views
how to get query output as a single table - aws cli
Thank you in advance.
I am trying to get the result in a single table - specifically to get instance id, status and output.
aws ssm list-command-invocations --command-id "<commandid>" -...
5
votes
2
answers
119
views
Filtering resources when using resourcegroupstaggingapi CLI
I am trying to find resources in my AWS based on certain tag conditions. I have been using jq to achieve it but is there way of using resourcegroupstaggingapi so they provide a direct way to filter ...
0
votes
2
answers
57
views
AWS CLI to Check Free Tier Usage Limit
Is there a way to check my AWS root account Free Tier usage via CLI?
I do not have access to AWS Console (i.e no root password), but I do have the root access key. Therefore, while I cannot use the (...
-1
votes
1
answer
60
views
How to use SCP and AWS to share data from remote Ceph (S3) and a remote standard filesystem?
I need to transfer data between machine A (linux filesystem) and machine B (Ceph/S3 object filesystem) from machine C (the only one I can control). On machine C, I installed aws cli for my transfers.
...
0
votes
1
answer
49
views
How to install AWS CLI on Cloud Composer?
I need to install AWS CLI tool on Google Cloud Composer to be able to use it with BashOperator from Airflow DAGs.
AWS CLI documentation page explains how to install it as a package, but Cloud Composer ...
0
votes
0
answers
50
views
An error occurred PutObject operation: The provided 'x-amz-content-sha256' header does not match what was computed
When start command:
aws --profile 1prof --endpoint-url http://1.1.1.1:80 s3 --recursive cp /tmp/_out/1prof/tbl/ s3://1prof/tbl/tbl20231025/
get errors:
upload: ./output-000005.csv to s3://1prof/tbl/...
1
vote
1
answer
72
views
How does the AWS CLI open a browser and wait for a response before proceeding?
I'm trying to build a golang cli tool for my company and as part of that build login and some other features into the tool. For the life of me I can't figure out how AWS is able to open a browser ...
-1
votes
2
answers
55
views
Sample CloudFormation code to enable Cross region replication on ECR with filter
I have to enable a cross-region replication for AWS ECR through cloud formation. For this, I have to add a rule and filter (optional ). Without the filter, I'll replicate all ECR to the target region. ...
-3
votes
1
answer
31
views
I can upload files to S3 bucket using AWS console but not with CLI. How to upload files to S3 bucket through CLI? [duplicate]
I can successfully upload the file from AWS console (UI) to the S3 bucket, but when I try to upload the file from my CLI using command:
aws s3 sync d1/ s3://<s3-bucket>/test-directory
I am ...
0
votes
0
answers
31
views
Escaping a $ within document JSON, as part of AWS SSM CreateDocument [duplicate]
From my local machine, I am writing a script, which when executed should SSM on to my EC2 instance and write its own shell script (topic-creation.sh) within a user directory.
The intent is that later ...
0
votes
1
answer
49
views
AWS S3 CLI command failing to download GLACIER object from S3 to Linux
I am using aws-cli/1.22.97 from Linux and trying to download a single file from S3 bucket that contains objects (files) of storage class GLACIER and STANDARD.
As expected, I am able to download files ...
1
vote
1
answer
50
views
Unable to connect to Akka HTTP running on EC2
I'm moving an Akka HTTP application to AWS and am stumped at this problem. The Akka HTTP server is booted like so:
Http().bindAndHandle(routes, "0.0.0.0", 5377)
The EC2 Instance is started ...
0
votes
1
answer
34
views
How do I find RDS clusters with 0 instances?
In the RDS UI, you can see clusters and easily identify those with 0 instances. I'm trying to query RDS using AWS CLI, but I don't see anything offhand that will help me find that value.
I briefly ...
0
votes
0
answers
48
views
Trying to add a user to an environment in AWS Cloud9 I get "Member must satisfy regular expression pattern"
I am trying to give read-write permissions to an environment in Cloud9 to a user.
I am using aws cli for this.
$> aws --version
aws-cli/2.9.23 Python/3.9.11 Darwin/22.5.0 exe/x86_64 prompt/off
I ...
0
votes
1
answer
53
views
AWS CLI parse error when listing more than two tags
Why does this command work?:
aws ec2 describe-instances \
--profile ike \
--query 'Reservations[].Instances[].[InstanceId,State.Name,InstanceType,PublicIpAddress, Tags[?Key==`Name`]|[0].Value, ...
0
votes
2
answers
273
views
Can AWS SSO tokens be refreshed (by doing a browser login) automatically?
I have a Ruby application using the AWS SDK Ruby v3, and recent I've added support for using SSO profiles instead of static "key ID + secret" configuration.
The new setup works well for a ...
1
vote
0
answers
35
views
Find EC2 instances where tag value NOT equal value [duplicate]
I have a tag on my EC2 instances - backup_policy
It should be set to
"EC2_Prod_Daily_Weekly_Monthly" for prod accounts
"EC2_NonProd_Daily_Weekly_Monthly" for non-prod accounts
but ...
0
votes
0
answers
72
views
Aws ecr LayersNotFoundException but layers actually present in registry
I am trying to retag and copy an image from a repository to another within the same repository, without the use of Docker but only with the aws cli
I first get the manifest for the image i want to ...
0
votes
1
answer
145
views
awscli-local error: cannot import name 'SSOTokenFetcher' from 'botocore.utils'
I am getting an error when trying to use awscli-local (https://github.com/localstack/awscli-local):
user@user:~$ awslocal
cannot import name 'SSOTokenFetcher' from 'botocore.utils'
(/home/user/.local/...
0
votes
1
answer
60
views
How to associate Call Flow to Phone Number using Terraform?
In Amazon Connect, there is a way to associate a Contact Flow to a Phone Number (the first call flow executed when the phone number is called).
This CLI call to do that is associate-phone-number-...
0
votes
0
answers
36
views
Worker nodes not attaching to AWS EKS cluster
I'm creating a 2 node AWS EKS cluster using aws cli in a .sh script. The script below creates the control plane and 2 ECS instances for worker nodes, but the nodes don't get attached to the cluster. ...
0
votes
0
answers
11
views
Import region stack configuration in CloudFormation
I configured a region manually with some services like EC2, APIGW etc.
I am wondering if I can export this configuration (via aws-cli for example) and import it in CloudFormation as a template
Thanks ...