All Questions
309 questions
1
vote
3
answers
75
views
Pipe commands not getting killed after head exits
So, I'm not sure if the commands are actually important, but for background this is the command I was running:
aws s3 ls s3://REDACTED/ | jq -nR '[inputs | split(" +"; null).[3]] | reverse.[]...
0
votes
0
answers
54
views
Python pexpect: Command only happens after subsequent commands are sent
Objective*
I am trying to use aws ecs execute-command in conjunction with pexpect.spawn() to start an interactive bash session in a container running on an EC2 instance.
Sample Code
import sys
import ...
0
votes
0
answers
51
views
How to convert AWS CLI string array into a bash array efficiently [duplicate]
This is an example AWS CLI script:
taskDefs=$(aws ecs list-task-definitions --status="INACTIVE" --query="taskDefinitionArns")
echo $taskDefs
# output: ["arn:1", "arn:...
0
votes
1
answer
90
views
AWS KMS Key Created by CloudFormation Immediately Enters Pending Deletion State
Background
I'm running a bash script to set up AWS Roles Anywhere using a KMS key created via a CloudFormation stack. The script first deploys the KMS key, then uses it to sign a Certificate Authority ...
0
votes
1
answer
391
views
How to avoid "Invalid argument type" error when executing a seemingly valid AWS CLI command created using jq and bash?
I have a file of s3 paths, sources.lst. Contents:
[
"s3://bucket-name/path/to/file0.tif",
"s3://bucket-name/path/to/file1.tif",
]
I am attempting to iterate over these s3 ...
0
votes
1
answer
501
views
What is the better way to perform resource already exist in AWS secret manager
I am trying to create the secret in secret manager using CFT, but there is no direct way in CFT to check If the secret already exist and then If it doesn't exists then create the secret. (Basically ...
1
vote
1
answer
676
views
How can I get the aws profile id from the aws configure sso command
As part of a bash script to automate connecting to our postgres instance I need to configure the aws cli tool and set the AWS_PROFILE variable. The command outputs this in the final line of its output....
0
votes
2
answers
331
views
How to delete objects in S3 bucket based on contents in another S3 bucket?
Context: I have 2 buckets, bucket A and bucket B. Bucket A had all of its contents placed in Bucket B via the aws s3 sync CLI command.
Problem: I want to delete all the items in bucket B that also ...
0
votes
2
answers
200
views
sort_by function when using AWS CLI for aws ec2 describe-security-groups
I am trying to compare 2 security groups in AWS that are in 2 different accounts, using aws ec2 describe-security-groups. Even if the security groups are exactly the same, it's impossible for me to ...
0
votes
1
answer
1k
views
aws cloudformation deploy and --parameter-overrides syntax
I'm using aws cli v1 (aws-cli/1.29.8 Python/3.9.17 Linux/4.14.291-218.527.amzn2.x86_64 exec-env/AWS_ECS_EC2 botocore/1.31.) within CodeBuild, and reading the documentation for the --parameter-...
0
votes
1
answer
466
views
Getting a error when we use "pip3 install awscli" command
I am getting an eror as follows when I use pip3 install awscli. It was working fine earlier. It would be great if someone could help with this issue.
Collecting awscli Downloading awscli-1.29.3-py3-...
0
votes
0
answers
375
views
aws cli get emr cluster and steps
Goal: Retrieve AWS EMR clusters with name, id, starttime, endtime, step id, instance sizes, and step ID where status change reason is all steps completed and the clusters are created after a specific ...
0
votes
1
answer
146
views
Using output of an aws cli command as an input for another command
I have been trying to use output of the list-backup-plans to use as input for get-backup-plan --backup-plan-id. I tried this command but it seems inappropriate for multiple backup plan ids. Could ...
0
votes
2
answers
375
views
ValidationException while executing bash
Here i am trying to retrieve latest ami id for k8s worker node.
i have written a bash script for the same, every time i run this script it return errors.
Please set VERSION=v1.23 before running script
...
0
votes
0
answers
59
views
Enforce minimum version of AWS CLI in a bash script
I am writing bash scripts that make heavy use of the AWS cli, and I need to ensure a minimum version is installed. Is there a better way to do that than to parse the output of aws --version?