Author: Henry

How can I whitelist IPs for API Gateway?

As you may know, AWS publishes its current IP address ranges in JSON format. So there is a workaround that you can whitelist the IP CIDR ranges used by API Gateway from the public AWS IP ranges. For example you can download the json file which includes all current IP address ranges of AWS. Then you need to filter the…

Read More »

API GW: Binary Media Support and Content Encoding

// request If the specified content-type header is listed/ matched under BinaryMediaTypes, the payload is accepted and transformed based on the ContentHandling. Otherwise, a 415 unsupported media type is returned. // response If the specified Accept header is listed/ matched under BinaryMediaTypes, the binary data will be returned after the ContentHandling transformation. // base64 Note that base64 encoded data is…

Read More »

Grant Internet access to a Lambda function

You can read this AWS official documentation and see my notes as following. With my understanding, the flow seems: Lambda function –> private subnet –> NAT Gateway –> public subnet –> Internet Gateway With above flow, it could help to understand and config it. PS: public subnet & private subnet A public subnet is a subnet that’s associated with a…

Read More »

Can I create a Cognito User Pool with Software Token (TOTP) MFA ONLY using CloudFormation?

I want to create a AWS::Cognito::UserPool with only the SOFTWARE_TOKEN_MFA enabled for MFA using a Cloudformation template. However when specifying only SOFTWARE_TOKEN_MFA as the enabled MFA (without any SMS), the configuration should be: I got below error: “SMS configuration and Auto verification for phone_number are required when MFA is required/optional (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID:…

Read More »