aws-sdk

AWS Cognito Federated Identity + Facebook: suggested logout flow

戏子无情 提交于 2020-01-04 15:57:13
问题 Looking at http://docs.aws.amazon.com/cognito/latest/developerguide/facebook.html there is an example of how to code up a login using AWS Cognito + Facebook. However, I’m unable to find examples of a logout flow. Because of the 3 parties interacting, including browser-side caching, and potentially asynchronous operations involved, it would be good to be aware of any gotchas or recommendations. So: what’s a good way of handling logout after logging in with AWS Cognito + Facebook? 来源: https:/

Will getObjectSummaries get the count of objects stored in a S3 Bucket?

删除回忆录丶 提交于 2020-01-04 09:28:01
问题 I need to know the number of files that are stored under S3 bucket. Currently, ObjectListing doesn't has a method such as count or numberOfObject . However, it has a method that will return a List of S3ObjectSummary . public java.util.List<S3ObjectSummary> getObjectSummaries() Since it is a List , I can call size() method but is it accurate and right thing to assume that the size of getObjectSummaries() List is the same number of objects that are stored under a bucket? 回答1: No -- it is more

Will getObjectSummaries get the count of objects stored in a S3 Bucket?

拟墨画扇 提交于 2020-01-04 09:27:29
问题 I need to know the number of files that are stored under S3 bucket. Currently, ObjectListing doesn't has a method such as count or numberOfObject . However, it has a method that will return a List of S3ObjectSummary . public java.util.List<S3ObjectSummary> getObjectSummaries() Since it is a List , I can call size() method but is it accurate and right thing to assume that the size of getObjectSummaries() List is the same number of objects that are stored under a bucket? 回答1: No -- it is more

How to obtain the Public IP Address on EC2 launch instance request?

对着背影说爱祢 提交于 2020-01-04 01:38:13
问题 I can't figure it out how I can do it: runInstancesRequest.withImageId("ami-53170b32") .withInstanceType("t2.micro") .withMinCount(1) .withMaxCount(1) .withKeyName("mac") .withSecurityGroupIds("sg-49025d2d"); RunInstancesResult runInstancesResult = amazonEC2Client.runInstances(runInstancesRequest); So far everything works fine. Now I want to get the Public IP Address from the recently started instance. How can I do that? I tried: runInstancesResult.getReservation().getInstances().get(0)

Given an AWS Access / Secret Key Pair, how do I retrieve its IAM permissions?

試著忘記壹切 提交于 2020-01-03 13:03:27
问题 Given the input of just an AWS Access Key and an AWS Secret Key, how can I use the AWS SDK to lookup what kind of permissions that the account can do? I want do XYZ for a customer so the customer needs to give the access key and secret key to me to perform XYZ programmatically. However, before trying to do any of those actions, I'd like to verify that the credentials they gave me have access to certain privileges, such as being able to create S3 objects or being able to launch an EC2 instance

How to setup different configuration(awsconfiguration.json) with AWSMobileClient for debug and release build types

懵懂的女人 提交于 2020-01-02 15:03:18
问题 I want to have different configuration for debug and release builds. All the configuration is stored inside awsconfiguration.json , for example I have two different config files how can I set which file should be used. When using AWSMobileClient.getInstance() it gets default configuration from file awsconfiguration.json Configuration file example: { "Version": "1.0", "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId": "DIFFERENT_VALUES", "Region": "DIFFERENT_VALUES" } } },

How to close AWS connection if there is no such key in the query

天涯浪子 提交于 2020-01-02 11:30:23
问题 I'm using AWS java SDK to upload file on AWS Management Console's Bucket. However, if there is no such file online at first time when I try to get access to it, my code will catch the exception (NoSuchKey). Then I want to close the connection. The problem is I don't have any reference to close that connection because of the exception(The original reference will be null). Here is my code: S3Object object = null; GetObjectRequest req = new GetObjectRequest(bucketName, fileName); try{ logconfig(

AWS Cognito force refresh session

别来无恙 提交于 2020-01-02 08:49:12
问题 I'm running into some problems when I attempt to refresh my session tokens, (Access, Id, Refresh). I have already read this question and the answer has helped me understand what is going on some. But I feel what I am trying to do isn't quite what getSession is for. I am attempting to implement a session expiration message (done) that allows the user to extend their session (refreshes the tokens). From what I gather about getSession() , it returns either the old tokens, if they are still valid

How to get the file diff between two S3 buckets?

浪子不回头ぞ 提交于 2020-01-02 03:44:23
问题 So I have an S3 bucket of videos (several hundred), upon which I used ElasticTranscoder to transcode everything into a second, optimised bucket. However, when I inspect my second bucket, there are 40-50 less objects, but I cannot figure out what they are (the directory structure is deeply nested etc). How can I get the file diff of two buckets using aws s3api list-objects ? Perhaps there are files in the bucket which are not videos, which I somehow didn't know about. 回答1: Using Display only

AWS SDK v2 AllAccessDisabled error for S3 file copy

五迷三道 提交于 2020-01-02 02:03:07
问题 I'm in the process of switching over to the new aws-sdk in a rails app I wrote and cannot for the life of me find working corresponding methods in the v2 sdk. I'm also running into access denied issues I can't work out. The way I make use of the v1 sdk is that users directly upload to s3 using an "uploads" namespaced key, and after they create the object they're working on, a callback moves the file to the longterm key and deletes the old one. Here is an example of that: def move_file old_key