amazon-web-services

how to check if user already exist with same email or phone number while registration in Cognito user pool

馋奶兔 提交于 2021-02-08 10:46:48
问题 when new user register with same email and phone number user successfully registered in the Cognito user pool. so how can i check if user already exist with same email or phone number while registration in Cognito user pool This is my code for user registration in Cognito user pool result = client.sign_up( ClientId= clientId, Username= data['username'], Password= data['password'], UserAttributes=[ { 'Name': 'phone_number', 'Value': data['phone_number'], }, { 'Name': 'email', 'Value': data[

updating CORS policy of HTTP API via AWS CLI

只愿长相守 提交于 2021-02-08 10:44:53
问题 Amazon has released the ability to create HTTP API's via API gateway. On their website they describe that it is possible to create an HTTP API via AWS CLI: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-examples.html#http-api-examples.cli.quick-create. FOR EXAMPLE: aws apigatewayv2 create-api --name my-api --protocol-type HTTP --target arn:aws:lambda:us-east-2:123456789012:function:function-name For REST API's I know it is possible to update the CORS policy via AWS CLI.

Attach multiple Roles or Profiles to an instance

你。 提交于 2021-02-08 10:44:20
问题 What's the limit for roles to a single instance? I see there's a limit of 20 policies per role and my policies are very granular. Can I have multiple roles or multiple profiles attached to my one instance? I believe the answer is no and that my present design is blocked by AWS for a very good reason which means I need to rethink the policies. I'm using terraform modules and a policy per module seemed like a good separation of concerns but AWS seems to disagree. 回答1: According to Terraform

Passing IAM role to a Docker on EC2

落爺英雄遲暮 提交于 2021-02-08 10:21:51
问题 What is the suggested way to pass IAM role to a Docker container on EC2? I have a mlflow project running in a docker environment on EC2. The python code needs to read and write from S3. The following is the error (sometimes other types of error also indicating no s3 access from the container, for example s3 resourece not found error) botocore.exceptions.ProfileNotFound: The config profile (xxx) could not be found To solve the s3 access issue, I already created an IAM role that allows access

NameError: uninitialized constant CarrierWave::Storage::Fog, heroku

ぃ、小莉子 提交于 2021-02-08 10:18:54
问题 I am trying to use carrierwave, fog and AWS for my image uploading on Heroku. Pretty common...I even have it set up successfully for another app. However when I delpoy to heroku I'm getting this error: Running: rake assets:precompile rake aborted! NameError: uninitialized constant CarrierWave::Storage::Fog Gemfile source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.3.7' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails

Redshift Time Datatype

你。 提交于 2021-02-08 10:18:24
问题 I am trying to create and load a TIME column not unlike other databases to store, only the time. i.e. 09:30:00, 14:23:16 According to this https://docs.aws.amazon.com/redshift/latest/dg/r_Datetime_types.html Redshift has a TIME data type. However trying to use it like the date and timestamp datatypes is proving challenging. select version(); version --------------------------------------------------------------------------------------------------------------------------- PostgreSQL 8.0.2 on

Redshift Truncate table and reset Identity?

喜夏-厌秋 提交于 2021-02-08 10:18:02
问题 I know in PostgresQL there is truncate table restart identity; but this doesn't work in Redshift. Is there something else to do this in Redshift? Otherwise I see it lot of pain to drop table and recreate and load. 回答1: Its not possible to reseed identity value in redshift like other sql databases. you have to create new table and move data there. 来源: https://stackoverflow.com/questions/64530857/redshift-truncate-table-and-reset-identity

AWS API Gateway always returns 502 bad gateway

被刻印的时光 ゝ 提交于 2021-02-08 09:55:12
问题 I have created a simple lambda function in AWS that returns list from DynamoDB. I have also created API Gateway to trigger the lambda function. The function works fine when I test in AWS console. But I always get 502 bad gateway below error when I test this function in Postman. ({ "message": "Internal server error" } Below is the function in node.js: const doc = require('dynamodb-doc'); const dynamo = new doc.DynamoDB(); /** * Provide an event that contains the following keys: * * - operation

AWS API Gateway always returns 502 bad gateway

微笑、不失礼 提交于 2021-02-08 09:54:09
问题 I have created a simple lambda function in AWS that returns list from DynamoDB. I have also created API Gateway to trigger the lambda function. The function works fine when I test in AWS console. But I always get 502 bad gateway below error when I test this function in Postman. ({ "message": "Internal server error" } Below is the function in node.js: const doc = require('dynamodb-doc'); const dynamo = new doc.DynamoDB(); /** * Provide an event that contains the following keys: * * - operation

Replicated caching solutions compatible with AWS

核能气质少年 提交于 2021-02-08 09:52:43
问题 My use case is as follow: We have about 500 servers running in an autoscaling EC2 cluster that need to access the same configuration data (layed out in a key/value fashion) several million times per second. The configuration data isn't very large (1 or 2 GBs) and doesn't change much (a few dozen updates/deletes/inserts per minute during peak time). Latency is critical for us, so the data needs to be replicated and kept in memory on every single instance running our application. Eventual