aws-sdk

How to get data from aws Dynamodb with using partition key only?

大憨熊 提交于 2020-01-22 14:39:31
问题 I am using aws-sdk-go library for DynamoDb connectivity in Golang. My DynamoDb table have a Partition key DeviceId (String) and a Sort Key Time (Number). How can I write GetItemInput to get all data with a specific DeviceId? params := &dynamodb.GetItemInput{ Key: map[string]*dynamodb.AttributeValue { "DeviceId": { S: aws.String("item_1"), }, }, ExpressionAttributeNames: map[string]*string{ "DeviceId": "DeviceId", }, TableName: aws.String("DbName"), } list, err := svc.GetItem(params) 回答1: You

Lambda cold start possible solution?

偶尔善良 提交于 2020-01-21 04:05:33
问题 Is scheduling a lambda function to get called every 20 mins with CloudWatch the best way to get rid of lambda cold start times? (not completely get rid of)... Will this get pricey or is there something I am missing because I have it set up right now and I think it is working. Before my cold start time would be like 10 seconds and every subsequent call would complete in like 80 ms. Now every call no matter how frequent is around 80 ms. Is this a good method until say your userbase grows, then

How to manage Service Quotas (also referred to as limits in AWS Account) using AWS CLI commands

旧时模样 提交于 2020-01-19 04:10:28
问题 How can I manage my Service Quotas (also referred to as limits in AWS Account) using AWS CLI commands 回答1: You simply search for a quota and put in your desired value to submit a quota increase request via Console or via AWS CLI . You can find answers to your most of the queries with exmaples here on one of below links : [+] Dev.to https://dev.to/dineshrathee12/manage-my-service-quotas-also-referred-to-as-limits-in-aws-account-using-aws-cli-commands-5cg2 [+] GitHub: https://github.com

aws-sdk putObject Access Denied Request.extractError

て烟熏妆下的殇ゞ 提交于 2020-01-17 05:59:46
问题 I have the following policy attached to the IAM user I am using. { "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1468642330000", "Effect": "Allow", "Action": [ "s3:*" ], "Resource": [ "arn:aws:s3:::elasticbeanstalk-ap-southeast-1-648213736065/documents/*" ] } ] } Problem is when I do something like: return readFile(file.path) .then(function(buffer) { var s3obj = s3.putObject({ Bucket: bucket, Key: `documents/${destFileName}`, Body: buffer }); return s3obj.promise(); }); I get:

AWS EC2 Resource Level , Initialization Failed

点点圈 提交于 2020-01-17 01:25:30
问题 I use this Policy { "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1385026304010", "Effect": "Allow", "Action": [ "ec2:RunInstances" ], "Condition": { "StringEquals": { "ec2:InstanceType": "t2.medium" } }, "Resource": [ "arn:aws:ec2:us-east-1:*:instance/*", "arn:aws:ec2:us-east-1:*:image/ami-81c603ea", "arn:aws:ec2:us-east-1:*:key-pair/CodeDeploy", "arn:aws:ec2:us-east-1:*:security-group/sg-5ace243d", "arn:aws:ec2:us-east-1:*:volume/*" ] } ] } But it show error message , Initialization

Are Get request with body allowed on AWS? 403 error from CloudFront

孤街醉人 提交于 2020-01-16 14:49:30
问题 I published an api to AWS with Visual Studio and using the template for AWS Serverless application project, for now I am testing the methods with postman, but all get methods that require a body are returning an error that mentions cloudfront in the response, I do not know if the issue is related to cloudfront or if it is the AWS HTTP 1.1 specification implementation that does not allow get requests with body: Note:Get requests with body were a requirement from our client RFC 7231 HTTP/1.1

How to create a Mono from a completableFuture

被刻印的时光 ゝ 提交于 2020-01-15 12:18:07
问题 I am trying to wrap CompletableFuture inside a Reactor Mono type in order to simplify my transform operations. Project Reactor is more convenient in general! I am working inside an AWS Lambda function and I am invoking AWS services such as S3, SQS, etc... using the new AWS Java SDK 2.x version. This new SDK allows to make asynchronous calls to AWS services and returns CompleteableFuture objects. For example: S3AsyncClient s3AsyncClient = S3AsyncClient.builder().build(); Mono.fromFuture

How to create a Mono from a completableFuture

穿精又带淫゛_ 提交于 2020-01-15 12:18:05
问题 I am trying to wrap CompletableFuture inside a Reactor Mono type in order to simplify my transform operations. Project Reactor is more convenient in general! I am working inside an AWS Lambda function and I am invoking AWS services such as S3, SQS, etc... using the new AWS Java SDK 2.x version. This new SDK allows to make asynchronous calls to AWS services and returns CompleteableFuture objects. For example: S3AsyncClient s3AsyncClient = S3AsyncClient.builder().build(); Mono.fromFuture

UserFrosting & AWS SDK

假如想象 提交于 2020-01-15 05:14:10
问题 I have the following code working as expected outside UserFrosting: <?php echo "Hello World.<br>"; require_once '../vendor/autoload.php'; use Aws\Common\Aws; $aws = Aws::factory('../aws/aws-config.json'); $client = $aws->get('S3'); $bucket = 'my-public-public'; $iterator = $client->getIterator('ListObjects', array( 'Bucket' => $bucket )); foreach ($iterator as $object) { echo $object['Key'] . "<br>"; } On my UserFrosting instance I managed to successfully load aws-sdk-php with Composer: -

Carthage, Xcode 9. “xcodebuild timed out while trying to read *.xcodeproj” error

时光总嘲笑我的痴心妄想 提交于 2020-01-15 03:15:14
问题 Today I downloaded xCode 9 and started converting everything to Swift 3.2/4, so I can build and run my project. As it was expected carthage complaint about some project that they could not be build, as they were not compatible with Swift 3.2/4. I had to find the versions that were compatible and build them. I also had to use --no-use-binaries, as some frameworks are precompiled with previous versions of Swift. I then got the following error: xcodebuild timeout while trying to read AWSiOSSDKv2