aws-sdk

AWS SDK PHP Class Not Found

雨燕双飞 提交于 2019-12-13 19:11:30
问题 When I am use the AWS SDK with php I get an error stating that the class cannot be found. <?php require_once '/var/www/html/aws.phar'; use Aws\Common\Aws; use Aws\Common\Enum\Region; echo "test"; $AWSregion = Region::US_EAST_1; $aws = Aws\Common\Aws::factory(array('key'=>'key', 'secret' => 'secret_key', 'region' => $AWSregion)); $client = $aws->get('Sqs'); ?> The exact error message I receive is PHP Fatal Error: Class 'Aws\Common\Enum\Region' not found in /var/www/html/sendSQS.php Any help is

When AWS KCL processRecords is failed, how to “mark” that the records should be reprocessed?

老子叫甜甜 提交于 2019-12-13 18:08:06
问题 I'm working with AWS DynamoStream which his API is based on the AWS KCL. In cases I received records which I failed to process and I want those records to be available later to allow reprocessing of them. For instance I'm trying to save them to a remote DB and I experience network issues sometime. My questions are: Can I use the Checkpointer in some way to indicate I Didn't handled the records? Should I just avoid executing Checkpointer.checkpoint()? will it have any effect if I still use it

AWS S3 copy object source key and destination key

ⅰ亾dé卋堺 提交于 2019-12-13 16:10:02
问题 I am writing JAVA code to copy object within AWS S3. CopyObjectRequest copyObjRequest = new CopyObjectRequest(srcbucket, srcKey, destbucket, destKey); s3Client.copyObject(copyObjRequest); What is source key and destination key? I read a lot in theory but no where it is mentioned that from where we can get these keys. Maybe I missed some part. Please help me to get source and destination keys of bucket.... Please provide an example for that also... 回答1: From the documentation:

AWS Credentials for lambda when working with scala not working

我的梦境 提交于 2019-12-13 16:07:45
问题 AWS lambda function does not work when attempting to work with credentials provided using the DefaultCredentialProvider. I need to pass the credentials to S3 for it to run. Code def initializeAwsCredentials():AWSCredentials = { var credentials: AWSCredentials = null try { credentials = new ProfileCredentialsProvider().getCredentials } catch { case e: Exception => { throw new AmazonClientException( "Cannot load the credentials from the credential profiles file. " + "Please make sure that your

Jackson JSON deserialization for Amazon Lex AWS Lambda hook

老子叫甜甜 提交于 2019-12-13 16:00:23
问题 I have a problem with deserialization implemented in AWS Lex Lambda hook. I have an AWS Lambda function to validate the user input, but I keep getting JSONMapping errors. The Lex json is like this: { "currentIntent": { "name": "intent-name", "slots": { "slot-name": "value", "slot-name": "value", "slot-name": "value" }, "confirmationStatus": "None, Confirmed, or Denied (intent confirmation, if configured)", }, "bot": { "name": "bot-name", "alias": "bot-alias", "version": "bot-version" },

Is it possible to use TypeScript with 'aws-sdk-mock'

走远了吗. 提交于 2019-12-13 14:06:25
问题 I'm writing unit tests for a serverless application in TypeScript, and I'd like to mock the AWS SDK. Unfortunately I have not found many existing type definitions for popular AWS mocking projects. In particular I'd like to use the aws-sdk-mock library, but without its type definitions I can't. Theoretically I'd like to be able to do something like: import 'jest'; import * as sinon from 'sinon'; import * as _ from 'lodash'; import { handler } from '../lib/lambda'; import AWSMock from 'aws-sdk

passenger meet Library not loaded error : liblzma.5.dylib

邮差的信 提交于 2019-12-13 13:55:41
问题 I am trying to running rails with passenger. I both AWS SDK 1 and 2 gem installed: gem 'aws-sdk-v1' gem 'aws-sdk', '~> 2' when I use AWS sdk to run: s3 = AWS::S3.new I meet error: LoadError: dlopen(/Users/XXXX/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.6.2/lib/nokogiri/nokogiri.bundle, 9): Library not loaded: /usr/local/lib/liblzma.5.dylib Referenced from: /Users/XXXX/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.6.2/lib/nokogiri/nokogiri.bundle Reason

Custom URL with Paperclip and AWS S3

◇◆丶佛笑我妖孽 提交于 2019-12-13 13:07:17
问题 We're using Paperclip with the aws-sdk gem to store and display images in our Rails app: class User < ActiveRecord::Base has_attached_file :image, storage: :s3, s3_credentials: 'config/s3.yml', s3_protocol: :https, styles: { curriculum: '120x120>', medium: '600x600>', thumb: '200x200>' }, default_url: 'missing_photo.png' end If I then use <%= image_tag current_user.image.url %> in an html.erb file, I get the following HTML: <img src="https://s3.amazonaws.com/<my_bucket>/users/images/000/000

How to get file stream in the output of Object.get

﹥>﹥吖頭↗ 提交于 2019-12-13 07:08:16
问题 I a writing a Rails API, with help of aws-sdk-ruby, which retrieves a file from AWS and returns in the response of API. Can I get somehow file stream in response of object.get, which I can directly return from the Rails API. s3 = Aws::S3::Resource.new bucket_name = "my_bucket" bucket = s3.bucket(bucket_name) object = bucket.object("a/b/my.pdf") Rails.logger.info 'Downloading file to AWS' downloaded_data = object.get({}) send_data(downloaded_data, :filename => "my.pdf", :type => "mime/type" )

Amazon S3 : List Objects

蓝咒 提交于 2019-12-13 07:00:28
问题 I have this code to list objects in the folder. var accessKey = ConfigurationManager.AppSettings["AWSAccessKey"]; var secretKey = ConfigurationManager.AppSettings["AWSSecretKey"]; using (AmazonS3Client s3Client = new AmazonS3Client(accessKey, secretKey, RegionEndpoint.USEast1 )) { var prefix = string.Format(@"{0}/", uniqueKey); ListObjectsRequest request = new ListObjectsRequest(); request.BucketName = bucketName; request.Delimiter = "/"; request.Prefix = prefix; do { ListObjectsResponse