Reputation: 7413
I've created a node.js application which connects to DynamoDB. Everything is working fine locally Now I'm trying to setup on AWS servers.
ec2-user
and aws configure
with previously generated access key.AWS Access Key ID [None]: ACCESS KEY
AWS Secret Access Key [None]: SECRET
Default region name [None]: us-east-1
Default output format [None]: json
aws dynamodb list-tables
. It gives no output, no error.Upvotes: 2
Views: 1124
Reputation: 7413
As I commented, The main issue was outbound rules for attached security group. Here are the necessary things to do
aws configure
command or directly modify ~/.aws/credentials
file.It is good, though optional, to create VPC endpoint. If you face UnauthorizedOperation
error while creating endpoint, assign AmazonEC2FullAccess
permission to the user from IAM console. Remove it later if you don't need it.
To use the AWS service from your application, find the relevant endpoint from this list.
Upvotes: 1
Reputation: 55760
It sounds like you are having problems connecting to DynamoDB because of the way you have configured your VPC.
There are some options but if you would prefer to keep your VPC isolated from the internet then you could enable VPC endpoints for DynamoDB. That way you can access DynamoDB from within your VPC without those connections going over the public internet.
There is a step-by-step guide for how to do that here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/vpc-endpoints-dynamodb.html
Essentially, it involves the following steps:
aws ec2 create-vpc-endpoint --service-name com.amazonaws.<region>.dynamodb --vpc-id <yourvpcid>
Upvotes: 0