aws-sdk

Cannot read credentials from /.aws/credentials - PHP script call AWS-SDK

ぐ巨炮叔叔 提交于 2020-05-10 03:54:10
问题 I've looked at every answer on here and it seems my problem is a little different or there hasn't been a proper solution. I'm doing the following in my PHP file: use Aws\Route53\Route53Client; $client = Route53Client::factory(array( 'profile' => 'default', 'region' => 'us-east-1', 'version' => '2013-04-01' )); Getting this error: Fatal error: Uncaught Aws\Exception\CredentialsException: Cannot read credentials from /.aws/credentials Seems like the easy fix would be ensure that the HOME

DynamoDb: Query items between two dates

帅比萌擦擦* 提交于 2020-04-16 03:48:08
问题 I'm not having much luck with this query, it returns 0 items const { Items } = await this.dynamoDb.query({ TableName: 'exampleTableName', IndexName: 'createdDateTime-index', KeyConditionExpression: '#createdDateTime BETWEEN :fromDateTime AND :toDateTime AND #status = :status', ExpressionAttributeNames: { '#status': 'status', '#createdDateTime': 'createdDateTime', }, ExpressionAttributeValues: { ':fromDateTime': '2017-02-20T01:58:49.710Z', ':toDateTime': new Date().toISOString(), ':status':

Check metadata of S3 objects with AWS SDK for Java 2.x

可紊 提交于 2020-04-11 12:35:43
问题 I was not able to find a way to check the metadata fields of an S3 object such as the Content-Type or the Cache-Control with the AWS SDK for Java 2.x. With the AWS SDK for Java 1.x it was as easy as this: s3Client.getObjectMetadata("myBucket", "myfile.doc"); But I cannot see the analogous method for the newest version of the API. 回答1: The solution is to use HeadObjectRequest and HeadObjectResponse : HeadObjectRequest headObjectRequest = HeadObjectRequest.builder() .bucket(bucketName) .key(key

Check metadata of S3 objects with AWS SDK for Java 2.x

爱⌒轻易说出口 提交于 2020-04-11 12:34:21
问题 I was not able to find a way to check the metadata fields of an S3 object such as the Content-Type or the Cache-Control with the AWS SDK for Java 2.x. With the AWS SDK for Java 1.x it was as easy as this: s3Client.getObjectMetadata("myBucket", "myfile.doc"); But I cannot see the analogous method for the newest version of the API. 回答1: The solution is to use HeadObjectRequest and HeadObjectResponse : HeadObjectRequest headObjectRequest = HeadObjectRequest.builder() .bucket(bucketName) .key(key

errorMessage“: ”'Neptune' object has no attribute 'stop_db_cluster"

时光毁灭记忆、已成空白 提交于 2020-03-25 19:12:11
问题 The following code is given below for my lambda funciton import boto3 client = boto3.client('neptune') response = client.stop_db_cluster(DBClusterIdentifier='qa-n1-cluster') output is given below Response: { "errorMessage": "'Neptune' object has no attribute 'stop_db_cluster'", "errorType": "AttributeError", "stackTrace": [ " File \"/var/lang/lib/python3.8/imp.py\", line 234, in load_module\n return load_source(name, filename, file)\n", " File \"/var/lang/lib/python3.8/imp.py\", line 171, in

AWSS3TransferUtilityErrorDomain Code=2 on ios

假如想象 提交于 2020-03-23 12:16:05
问题 AWSS3TransferUtilityErrorDomain Code=2 getting this error when uploading reaches 100% on iOS while android is working fine. I am using react-native-s3 . but it seems to be an issue with sdk or my bucket policy but I don't know how to fix this. More info: To upload, I am using CognitoCredentials, the region, IdentityPool, and sessionToken generated from our server. EDIT: This only happens on iOS. Android is working fine. 回答1: Typically this is an S3 bucket policy issue, permissions. Below is

Dynamo DB Local - Connection Refused

梦想的初衷 提交于 2020-03-12 03:25:30
问题 I am trying to connect to Local Dynamo DB using the AWS Java SDK. So I installed the Local Dynamo DB and started the javascript shell. All works fine and the shell starts at the usual address http://localhost:8000/shell/ Now when I try to access the Dynamo DB Instance via the AWS SDK things start to break. Here is my code: public class MyDynamoDB { private AmazonDynamoDBClient client; public MyDynamoDB() { client = new AmazonDynamoDBClient(); client.setEndpoint("http://localhost:8000"); }

IAM Role Name considred as Class in Yii 1

家住魔仙堡 提交于 2020-02-23 10:14:20
问题 I have attached the policy to EC2 IAM role to access AWS services. After that i have have used below code in Yii 1 controller file: ExampleController.php class ExampleController extends Controller { public function init() { require_once dirname(dirname(__FILE__)) . '/extensions/awsv3/vendor/autoload.php'; $config = array( 'version' => 'latest', 'region' => 'us-west-2', ); $s3_instance = new \Aws\Ssm\SsmClient($config); $result = $s3_instance->getParameters([ 'Names' => array('host_name'),

IAM Role Name considred as Class in Yii 1

試著忘記壹切 提交于 2020-02-23 10:13:39
问题 I have attached the policy to EC2 IAM role to access AWS services. After that i have have used below code in Yii 1 controller file: ExampleController.php class ExampleController extends Controller { public function init() { require_once dirname(dirname(__FILE__)) . '/extensions/awsv3/vendor/autoload.php'; $config = array( 'version' => 'latest', 'region' => 'us-west-2', ); $s3_instance = new \Aws\Ssm\SsmClient($config); $result = $s3_instance->getParameters([ 'Names' => array('host_name'),

IAM Role Name considred as Class in Yii 1

我的未来我决定 提交于 2020-02-23 10:13:02
问题 I have attached the policy to EC2 IAM role to access AWS services. After that i have have used below code in Yii 1 controller file: ExampleController.php class ExampleController extends Controller { public function init() { require_once dirname(dirname(__FILE__)) . '/extensions/awsv3/vendor/autoload.php'; $config = array( 'version' => 'latest', 'region' => 'us-west-2', ); $s3_instance = new \Aws\Ssm\SsmClient($config); $result = $s3_instance->getParameters([ 'Names' => array('host_name'),