aws-cli

Create AWS Athena view programmatically

强颜欢笑 提交于 2019-12-13 11:46:37
问题 Can you create views in Amazon Athena? outlines how to create a view using the User Interface. I'd like to create an AWS Athena View programatically, ideally using Terraform (which calls CloudFormation). I followed the steps outlined here: https://ujjwalbhardwaj.me/post/create-virtual-views-with-aws-glue-and-query-them-using-athena, however I run into an issue with this in that the view goes stale quickly. ...._view' is stale; it must be re-created. The terraform code looks like this:

AWS lambda update-function-code with jar package via AWS CLI

与世无争的帅哥 提交于 2019-12-13 04:45:32
问题 I'm trying to update my lambda function code with jar from my local machine via AWS CLI. The aws lambda has commands to update function code for zip file but not for jar. I can upload by using s3 bucket, but I need to update from local itself. I know following are the way to update from S3 bucket and for zip: aws lambda update-function-code --function-name --s3-bucket --s3-key aws lambda update-function-code --function-name --zip-file "fileb://" I want to ask is there similar command exist

AWS CLI executing in wrong regions

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 03:14:11
问题 My AWS profile is configured to default to eu-west-1, however when I run an AWS CLI command, it is executing in us-east-1: >aws configure get region eu-west-1 >aws events put-rule --name hourly_trigger --schedule-expression "rate(60 minutes)" { "RuleArn": "arn:aws:events:us-east-1:588237033746:rule/hourly_trigger" } I've looked into profiles and config options and can't determine why this is. My profile is set as follows: [default] region = eu-west-1 And this command works in the intended

map datatype in aws cli

冷暖自知 提交于 2019-12-13 02:09:47
问题 i am trying to add a message to queue in amazon aws sqs so i tried this root~# aws sqs send-message --queue-url "queue/url" --message-body "message with attribute" --message-attributes '{"Name": "somename", "Type":"String", "Value":"somevalue"}' bit it gives me this error 'unicode' object has no attribute 'keys' but if i remove the --message-attributes part from the command root~# aws sqs send-message --queue-url "queue/url" --message-body "message with attribute" then it works perfect http:/

Execute AWS CLI command inside a pipeline Jenkins file

断了今生、忘了曾经 提交于 2019-12-12 19:22:03
问题 Do you know how to execute AWS CLI command inside a Jenkinsfile in order to build a pipeline? I didn't find any plugins 回答1: First you need install aws cli on your server and make sure the jenkins user has permissions to run it. Or simply use the Amazon AMI when creating the EC2 instance, it comes with the aws cli. Assign a role the instance with the appropriate policy. ( it is simpler that using user key in aws configure ) Within your pipeline steps use sh 'aws ...' 回答2: First of all you

How to scale down/up containers in aws ecs cluster by command line, should I use aws cli or ecs-cli?

心不动则不痛 提交于 2019-12-12 17:40:54
问题 I'm running AWS ECS cluster with EC2 instances and I want a command to scale up the tasks to 1 running instance and then after some time when I do not need it I want to scale it down to 0. This should destroy the underlying EC2 instance to avoid charges. I'm not using Fargate as it is not in free tier. what I'm currently using to scale up to one and start running it: ecs-cli scale --capability-iam --size 1 --cluster myEC2clusterName --region us-east-1 aws ecs run-task --cluster

api gateway CORS setup

喜欢而已 提交于 2019-12-12 12:31:32
问题 I'm attempting to setup aws CORS from the command line using aws-cli in a deployment script. I have created the POST Resource with the following perl to shell command. I'm attempting to set the integration-response to '*' much like enabling cores would do. aws apigateway put-method-response \\ --region "$region" \\ --rest-api-id "$api_id" \\ --resource-id "$resource_id" \\ --http-method "POST" \\ --status-code 200 \\ --response-models '{"application/json":"Empty"}' \\ --response-parameters '{

How to supply a key on the command line that's not Base 64 encoded

我怕爱的太早我们不能终老 提交于 2019-12-12 11:42:28
问题 Regarding the AWS S3 tool "sync" and a "customer-provided encryption key", it says here, --sse-c-key (string) The customer-provided encryption key to use to server-side encrypt the object in S3. If you provide this value, --sse-c be specfied as well. The key provided should not be base64 encoded. How does one supply a key on the command line that is not base64 encoded? If the key is not base64 encoded, then surely some of the key's bytes would not be expressible as characters? 回答1: At first

Shell script - Sorting 'AWS cloudwatch metrics' json array based on the “Timestamp” property value which comes in ISO 8601 UTC format

≯℡__Kan透↙ 提交于 2019-12-12 10:08:59
问题 I have an Amazon cloudwatch ELB Latency metrics like below. { "Datapoints": [ { "Timestamp": "2016-10-18T12:11:00Z", "Average": 0.25880099632013942, "Minimum": 0.00071811676025390625, "Maximum": 3.2039437294006352, "Unit": "Seconds" }, { "Timestamp": "2016-10-18T12:10:00Z", "Average": 0.25197337517680762, "Minimum": 0.00063610076904296875, "Maximum": 2.839790821075439, "Unit": "Seconds" }, { "Timestamp": "2016-10-18T12:19:00Z", "Average": 0.2287127116954388, "Minimum": 0.00061678886413574219,

How can I create an AWS Lambda function using the AWS CLI?

余生颓废 提交于 2019-12-12 08:31:55
问题 I am trying to create an AWS Lambda function using the command aws lambda create-function \ --function-name foo\ --runtime nodejs\ --role lambda_basic_execution \ --handler asdf --zip-file "fileb:://boom.zip" I have a file called boom.zip available in the directory. But I cannot deploy using the above command. The failure message I get is --zip-file must be a file with the fileb:// prefix. Does anyone have a working example to create a lambda function using the AWS CLI? 回答1: You have an extra