aws-sdk

Weird Swift 3 issue with latest Amazon AWS Mobile sample code

 ̄綄美尐妖づ 提交于 2019-12-23 16:14:11
问题 Following along the current sample code for aws.amazon.com/mobile/ there are a number of code items they have not updated really well to Swift 3 (which is pretty bizarre considering their resources). When you come to AWSMobileClient.swift there's a line of code like this: if (!isInitialized) { AWSIdentityManager.defaultIdentityManager().resumeSession(completionHandler: {(result: AnyObject?, error: NSError?) -> Void in print("Result: \(result) \n Error:\(error)") } as! (Any?, Error?) -> Void)

Should you use AWS IAM roles and permission for application users?

纵然是瞬间 提交于 2019-12-23 12:09:22
问题 I'm working on a nodejs application on AWS for the first time and am still learning all the services. I'm working on my applications authentication and authorization and am at the point to create my user roles and groups. Is the AWS IAM service meant for both AWS management and for your application's user authorization or should I use one of nodejs's ACL modules and manage my roles and users outside of AWS IAM service? 回答1: Should you use AWS IAM roles and permission for application users? No

Failed to create AmazonGameLiftClient in Unity3d

与世无争的帅哥 提交于 2019-12-23 12:01:19
问题 I use below code to create GameClient in Unity3d: AmazonGameLiftClient client = new AmazonGameLiftClient("accessKeyId", "accessKey", RegionEndpoint.CNNorth1); Above code is the first line in Awake(), no any other leading codes. I get below error: NullReferenceException: Object reference not set to an instance of an object Amazon.CSMSection.get_CSMEnabled () Amazon.Util.CSMConfig.Configure (Amazon.CSMSection section) Amazon.Util.Internal.RootConfig..ctor () Amazon.AWSConfigs..cctor () Rethrow

Type annotation for boto3 resources like DynamoDB.Table

孤者浪人 提交于 2019-12-23 10:54:38
问题 The boto3 library provides several factory methods that returns resources. For example: dynamo = ( boto3 .resource('dynamodb') .Table(os.environ['DYNAMODB_TABLE']) ) I want to annotate those resources so I can get better type checking and completion, but the only type alike I could find was from boto3.dynamodb.table import TableResource . When I add that annotation: dynamo: TableResource = ( boto3 .resource('dynamodb') .Table(os.environ['DYNAMODB_TABLE']) ) The only method offered by auto

Can I specify a default AWS configuration profile?

爷,独闯天下 提交于 2019-12-23 09:37:35
问题 In my development environment, I regularly switch between several AWS access keys. So in my ~/.aws/credentials file, I have several profiles. I can then use these profiles with aws-cli by specifying the --profile <name> flag. I develop several apps that use the Ruby AWS SDK. They are setup to read credentials from the ~/.aws/credentials file (the SDK does this by default, see this configuration article). The problem is that the SDK always reads from the default profile. I would like to be

Cannot configure amazon-cognito-auth-js to angular 4 application with SAML Identity provider

自闭症网瘾萝莉.ら 提交于 2019-12-23 04:47:29
问题 I am trying to integrate SAML Service provider with AWS cognito pool.I have gone through lot of documents and tried to implement .However redirecting is not happening when i click on log in .[scenario is it should redirect to Microsoft login Page] Cognito pool and identity providers are configured correctly. Problem comes when i need to authenticate from front end application could anyone please help me to rectify the same..? here is my code step 1: npm install amazon-cognito-auth-js --save

How to use promises with AWS headObject?

∥☆過路亽.° 提交于 2019-12-23 01:52:57
问题 Using Node AWS SDK which supports callbacks and promises.. https://aws.amazon.com/blogs/developer/support-for-promises-in-the-sdk/ Using q as promise library.. AWS.config.setPromisesDependency(q); const headObjProm = this.s3Client.headObject(headParams).promise(); headObjProm .then(ret => { //ret is promise.. }) console logging ret shows.. (resolve, reject) { self.on('complete', function(resp) { if (resp.error) { reject(resp.error); } else { resolve(resp.data); } }); I was under impression

Getting values from parameter store in AWS

假如想象 提交于 2019-12-23 01:52:25
问题 Here is my code: const AWS = require('aws-sdk'); const { Client } = require('pg'); function main() { AWS.config.update({region:'eu-west-2'}); let db_user = { Name: "postgres_db_user", WithDecryption: false }; let db_host = { Name: "postgres_db_host", WithDecryption: false }; let db_database = { Name: "postgres_db_name", WithDecryption: false }; let db_password = { Name: "postgres_db_password", WithDecryption: true }; let db_port = { Name: "postgres_db_port", WithDecryption: false }; let

Add Tag while uploading an object to Amazon s3 in rails

懵懂的女人 提交于 2019-12-23 01:28:28
问题 I'm trying to upload CSV files to Amazon S3. I'm able to add metadata using the below code snippet: s3_obj.upload_file(file_to_be_uploaded, {"content_type": "application/octet-stream"} How can I add suitable tags (key-value pairs) -- for example exp: tag = { marked_to_delete: "true" } -- while uploading? 回答1: You should be able to do that by passing tagging: "marked_to_delete=true" as an option. Options are passed to an instance of AWS::S3::Client 's put_object method. The docs give a similar

Set signature in AWS JavaScript SDK

六月ゝ 毕业季﹏ 提交于 2019-12-23 01:18:45
问题 Is it possible to manually set the signature when making an AWS request using the AWS JavaScript SDK? I want to upload files directly to S3 but I don't want to make my keys available in plain text to the client. All the official examples require you to hardcode both your key and secret (while explicitly telling you not to do that). I'm calculating the signature server side but I haven't found a way to get that signature into the SDK. 回答1: I ended up going a different route using AWS STS for