Creating a DynamoDB Table and Setting Up IAM Access Control

Introduction to DynamoDB Tables
Amazon DynamoDB is a fully managed NoSQL database service provided by AWS (Amazon Web Services). It offers high performance, seamless scalability, and low latency for applications needing consistent, single-digit millise…


This content originally appeared on DEV Community and was authored by Rashmitha v

Introduction to DynamoDB Tables
Amazon DynamoDB is a fully managed NoSQL database service provided by AWS (Amazon Web Services). It offers high performance, seamless scalability, and low latency for applications needing consistent, single-digit millisecond response times. DynamoDB is particularly well-suited for applications requiring fast and predictable performance with seamless scalability.

Architecture:

Image description

_Step 1:Create a DynamoDB table for student details _

Navigate to the DynamoDB dashboard and click “Create table”, as show below.
Image description

  • When creating your DynamoDB table, you need to choose a name for the table and specify a Partition key.

  • The Partition key determines the partition in which the data is stored, while the Sort key helps in sorting the data within the partition based on its value.

  • Once you have named your table and assigned a partition key, navigate to the “Table settings” section.

  • simply click the “Create table” button in orange to initiate the table creation process

Step2 :Add items to DynamoDB table

Choose your recently created table from the list. In the left panel, click on “Explore items” and then select “Create item” to begin creating a new item within the table.

Image description
We are adding 6 student detail to the table.

Image description
Step 3: Launch EC2 with IAM role to scan DynamoDB table
Launching an EC2 instance with an IAM role that allows it to scan a DynamoDB table involves several steps, including creating an IAM role with appropriate permissions, launching the EC2 instance with that IAM role, and writing code on the EC2 instance to interact with DynamoDB.

In the next screen, give your role a name and click “Create role.”
step 4: Attach Policy

In the permissions tab, click "Attach policies directly".

Image description

Search for and attach the AmazonDynamoDBReadOnlyAccess policy (or create a custom policy with specific dynamodb:Scan permissions).

Step 5: Use the AWS CLI in the EC2 instance to scan the DynamoDB table
Navigate to the EC2 dashboard, then select your EC2 Instance.Then connect into your EC2 Instance by selection one of these ways:

Image description
I selected EC2 Instance Connect. We are now connected to our instance and ready to scan the table using the following command.

aws dynamodb scan --table-name <table_name> --region <region_name>

Image description
Benefits:

Scalability: DynamoDB scales automatically to handle any amount of traffic and storage.

Performance: Provides single-digit millisecond latency for read and write operations.

Security: IAM enables granular access control to DynamoDB resources, enhancing security posture.

Conclusion:
Setting up a DynamoDB table and configuring IAM access control ensures your application’s data storage is scalable, performant, and secure. By following best practices in defining table schemas, creating IAM policies, and integrating services, you establish a robust foundation for building cloud-native applications on AWS. This architecture supports modern application requirements with flexibility and resilience in data management.


This content originally appeared on DEV Community and was authored by Rashmitha v


Print Share Comment Cite Upload Translate Updates
APA

Rashmitha v | Sciencx (2024-07-08T18:33:40+00:00) Creating a DynamoDB Table and Setting Up IAM Access Control. Retrieved from https://www.scien.cx/2024/07/08/creating-a-dynamodb-table-and-setting-up-iam-access-control/

MLA
" » Creating a DynamoDB Table and Setting Up IAM Access Control." Rashmitha v | Sciencx - Monday July 8, 2024, https://www.scien.cx/2024/07/08/creating-a-dynamodb-table-and-setting-up-iam-access-control/
HARVARD
Rashmitha v | Sciencx Monday July 8, 2024 » Creating a DynamoDB Table and Setting Up IAM Access Control., viewed ,<https://www.scien.cx/2024/07/08/creating-a-dynamodb-table-and-setting-up-iam-access-control/>
VANCOUVER
Rashmitha v | Sciencx - » Creating a DynamoDB Table and Setting Up IAM Access Control. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/08/creating-a-dynamodb-table-and-setting-up-iam-access-control/
CHICAGO
" » Creating a DynamoDB Table and Setting Up IAM Access Control." Rashmitha v | Sciencx - Accessed . https://www.scien.cx/2024/07/08/creating-a-dynamodb-table-and-setting-up-iam-access-control/
IEEE
" » Creating a DynamoDB Table and Setting Up IAM Access Control." Rashmitha v | Sciencx [Online]. Available: https://www.scien.cx/2024/07/08/creating-a-dynamodb-table-and-setting-up-iam-access-control/. [Accessed: ]
rf:citation
» Creating a DynamoDB Table and Setting Up IAM Access Control | Rashmitha v | Sciencx | https://www.scien.cx/2024/07/08/creating-a-dynamodb-table-and-setting-up-iam-access-control/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.