aws-cli

AWS Cloudfront distribution ID by tag

两盒软妹~` 提交于 2021-02-09 11:13:03
问题 is that possible to get aws cloudfront dist id by tag via awscli or aws sdk for powershell. I could only get only ID by ARN number of resource aws cloudfront list-tags-for-resource --resource XXX { "Tags": { "Items": [ { "Value": "TEST_APP", "Key": "CLIENT_APP" } ] } } UPDATE Solved via cloudfrontdistids=$(aws cloudfront list-distributions | jq -r ".DistributionList.Items[].ARN") for dist in $cloudfrontdistids do if [ $(aws cloudfront list-tags-for-resource --resource $dist | jq -r ".Tags

AWS Cloudfront distribution ID by tag

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-09 11:12:46
问题 is that possible to get aws cloudfront dist id by tag via awscli or aws sdk for powershell. I could only get only ID by ARN number of resource aws cloudfront list-tags-for-resource --resource XXX { "Tags": { "Items": [ { "Value": "TEST_APP", "Key": "CLIENT_APP" } ] } } UPDATE Solved via cloudfrontdistids=$(aws cloudfront list-distributions | jq -r ".DistributionList.Items[].ARN") for dist in $cloudfrontdistids do if [ $(aws cloudfront list-tags-for-resource --resource $dist | jq -r ".Tags

List all parameters in AWS SSM Parameter Store

大憨熊 提交于 2021-02-08 14:16:33
问题 How do I list all parameters in the AWS Systems Manager (SSM) Parameter Store? I am using the AWS CLI. I can store them with aws ssm put-parameter . I can fetch them with aws ssm get-parameter . I can list all documents with aws ssm list-documents , but I do not see a corresponding list-parameters function. 回答1: I think what you want is aws ssm describe-parameters docs 回答2: You are looking for describe-parameters. 来源: https://stackoverflow.com/questions/55011890/list-all-parameters-in-aws-ssm

AWS CLI using Instance Profile Credentials

馋奶兔 提交于 2021-02-08 12:17:12
问题 How do I specify that I want to use Instance profile credentials when using the AWS CLI from within my EC2 instance? the docs say: Instance profile credentials – these credentials can be used on EC2 instances with an assigned instance role, and are delivered through the Amazon EC2 metadata service. Is this automatic or do I need to call the metadata service and save the returned credentials to the ~/.aws/credentials file...then make the call? 回答1: You are talking about IAM Roles. These are

Get a list of AWS pipelines ready for stage approval

和自甴很熟 提交于 2021-01-29 21:55:03
问题 I have 40+ pipelines that I need to approve from dev to QA and then QA to stage. I am working on a script to use AWS CLI commands to do do. I have been able to do that for a single pipeline where I know that the specific pipeline is ready to be approved. aws codepipeline put-approval-result --cli-input-json file://TestPipeline.json This is how I gathered the information for the approval for a single pipeline aws codepipeline get-pipeline-state --name Pipeline-Ready-for-Approval What I am

Cannot copy large (5 Gb) files with awscli 1.5.4

て烟熏妆下的殇ゞ 提交于 2021-01-29 17:45:45
问题 I have problem with aws-cli, I did a yum update, it updated awscli (among other things) and now awscli fails on large files (e.g. 5.1 Gb) with SignatureDoesNotMatch. The exact same command (to same bucket) with smaller files works. The big file still works if I use boto from python. It copies all parts but two it looks like (i.e. it was counted up to 743 of 745 parts), and then the error message comes. Looks like a bug in awscli? I could not find anything about it when I google around though.

Can The AWS CLI Copy From S3 To EC2?

雨燕双飞 提交于 2021-01-29 10:58:37
问题 I'm familiar with running the AWS CLI command to copy from a folder to S3 or from one S3 bucket to another S3 bucket: aws s3 cp ./someFile.txt s3://bucket/someFile.txt aws s3 cp s3://bucketSource/someFile.txt s3://bucketDestination/someFile.txt But is it possible to copy files from S3 to an EC2-Instance when you're not on the EC2-Instance? Something like: aws s3 cp s3://bucket/folder/ ec2-user@1.2.3.4:8080/some/folder/ I'm trying to run this from Jenkins which is why I can't simply run the

How to stop all running Step Functions of a specific state machine?

青春壹個敷衍的年華 提交于 2021-01-29 07:09:23
问题 I accidentally started very many step functions and now wish to terminate all of them. Any smart ways to do this using the CLI or web console? 回答1: OK, let's do this using the CLI. You can stop an execution using the following: aws stepfunctions stop-execution \ --execution-arn <STEP FUNCTION EXECUTION ARN> But since I started way too many executions, it's helpful to be able to list all running executions of a state machine: aws stepfunctions list-executions \ --state-machine-arn <STEP

AWS CLI - aws ec2 describe-instances to retrieve keypair mame for each EC2 instance

感情迁移 提交于 2021-01-29 05:51:42
问题 I am trying to query keypair names that are attached to each EC2 instance, the ec2 describe-instances below works fine, it does exactly what I need, but the column under the {keypair.Name} displays [NONE] I am not sure if I am using the proper parameter name - I know there are few keypairNames.epm attached on my EC2 instances when I login to the console, but I am not seeing that on my report that I run by the command below. Any input is much appreciated.. Thx ! aws ec2 describe-instances -

Error: The provided credentials do not have permission to create the service-linked role for EC2 Spot Instances

老子叫甜甜 提交于 2021-01-28 12:01:50
问题 I'm running into an error when creating a spot fleet request through cloudformation. The request is created but I'm getting the error mentioned in the title when the fleet attempts to request an instance. The permissions needed are described in here, however when I try to follow the steps to create the AWSServiceRoleForEC2SpotFleet role I don't have the option to choose "EC2 - Spot Fleet", only EC2 FLeet. What's odd is that when I create the CF stack it actually does create that service