---
title: "How To Create a DynamoDB Table Using AWS CLI"
lang: "en"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/post/how-to-create-a-dynamodb-table-using-aws-cli
---

![Blog post image for How To Create a DynamoDB Table Using AWS CLI - In this article, we will learn how to create a DynamoDB table using AWS CLI. We will also learn how to add items to the table and how to query the table.](/_astro/hero.DFm0nlBr_Z27hBtk.webp)

[Home](/)›[Blog](/blog)›[All Categories](/blog/categories)›[AWS](/blog/categories/aws)

Blog

[Prev in AWSHow To Create A Custom VPC Using AWS CLI](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)[Next in AWSHow To Create An AWS EC2 Instance Using AWS CLI](/blog/post/how-to-create-an-aws-ec2-instance-using-aws-cli)

[AWS](/blog/categories/aws)[DynamoDB](/blog/categories/dynamodb)[AWS CLI](/blog/categories/aws-cli)[NoSQL Databases](/blog/categories/nosql-databases)

# How To Create a DynamoDB Table Using AWS CLI

[Mohammad Abu Mattar](/authors/mohammad-abu-mattar)Published: 10 Nov 202206 Mins read10 Mins listen

[Markdown for AI(opens in a new tab)](/post/how-to-create-a-dynamodb-table-using-aws-cli/index.md "Open the plain-Markdown version of this page, for pasting into an AI tool")

TL;DR

In this article, we will learn how to create a DynamoDB table using AWS CLI. We will also learn how to add items to the table and how to query the table.

Series

[AWS CLI Guides](/series/aws-cli-guides)3/4

[PreviousHow To Create An AWS EC2 Instance Using AWS CLI](/blog/post/how-to-create-an-aws-ec2-instance-using-aws-cli)[NextHow To Create a AWS S3 Bucket Using AWS CLI](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

All posts in this series (4)

Blog4

1.  [How To Create A Custom VPC Using AWS CLI](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)
2.  [How To Create An AWS EC2 Instance Using AWS CLI](/blog/post/how-to-create-an-aws-ec2-instance-using-aws-cli)
3.  [How To Create a DynamoDB Table Using AWS CLIYou are here](/blog/post/how-to-create-a-dynamodb-table-using-aws-cli)
4.  [How To Create a AWS S3 Bucket Using AWS CLI](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

### How To Create a DynamoDB Table Using AWS CLI

Contents

[Introduction](#introduction)[Prerequisites](#prerequisites)[Create a DynamoDB table](#create-a-dynamodb-table)[Step 1: create a DynamoDB table](#step-1-create-a-dynamodb-table)[Step 2: list the tables](#step-2-list-the-tables)[Step 3: insert items into the table](#step-3-insert-items-into-the-table)[\# Step 3.1: insert an item using AWS CLI](#-step-31-insert-an-item-using-aws-cli)[\# Step 3.2: insert multiple items using AWS CLI](#-step-32-insert-multiple-items-using-aws-cli)[\# Step 3.3: insert items from a JSON file using AWS CLI](#-step-33-insert-items-from-a-json-file-using-aws-cli)[Step 4: query the table](#step-4-query-the-table)[\# Step 4.1: query the table using AWS CLI](#-step-41-query-the-table-using-aws-cli)[\# Step 4.2: query the table using AWS CLI and output to a JSON file](#-step-42-query-the-table-using-aws-cli-and-output-to-a-json-file)[Step 5: create a global secondary index](#step-5-create-a-global-secondary-index)[\# Step 5.1: create a global secondary index using AWS CLI](#-step-51-create-a-global-secondary-index-using-aws-cli)[Step 6: remove the global secondary index](#step-6-remove-the-global-secondary-index)[\# Step 6.1: remove the global secondary index using AWS CLI](#-step-61-remove-the-global-secondary-index-using-aws-cli)[Step 7: create two DynamoDB tables with relationships](#step-7-create-two-dynamodb-tables-with-relationships)[\# Step 7.1: create the first table](#-step-71-create-the-first-table)[\# Step 7.2: create the second table](#-step-72-create-the-second-table)[\# Step 7.3: add items to the first table](#-step-73-add-items-to-the-first-table)[\# Step 7.4: add items to the second table](#-step-74-add-items-to-the-second-table)[\# Step 7.5: query the second table using AWS CLI](#-step-75-query-the-second-table-using-aws-cli)[Step 8: create a DynamoDB table with a local secondary index](#step-8-create-a-dynamodb-table-with-a-local-secondary-index)[\# Step 8.1: create the table](#-step-81-create-the-table)[\# Step 8.2: add items to the table](#-step-82-add-items-to-the-table)[\# Step 8.3: query the table using AWS CLI](#-step-83-query-the-table-using-aws-cli)[Step 9: describe a DynamoDB table using AWS CLI](#step-9-describe-a-dynamodb-table-using-aws-cli)[Step 10: delete a DynamoDB table using AWS CLI](#step-10-delete-a-dynamodb-table-using-aws-cli)[Conclusion](#conclusion)[References](#references)

## [Introduction](#introduction)

In this article, we will learn how to create a DynamoDB table using AWS CLI. We will also learn how to add items to the table and how to query the table.

## [Prerequisites](#prerequisites)

To follow this article, you need to have the following:

-   AWS CLI
-   AWS Account
-   AWS IAM User with the following permissions:
    -   AmazonDynamoDBFullAccess
-   AWS CLI configured with the IAM User

## [Create a DynamoDB table](#create-a-dynamodb-table)

### [Step 1: create a DynamoDB table](#step-1-create-a-dynamodb-table)

To create a DynamoDB table, run the following command:

Terminal window

```
1aws dynamodb create-table \2    --table-name MyTable \3    --attribute-definitions \4        AttributeName=Id,AttributeType=S \5    --key-schema \6        AttributeName=Id,KeyType=HASH \7    --provisioned-throughput \8        ReadCapacityUnits=1,WriteCapacityUnits=1
```

Explanation:

-   `--table-name`: The name of the table to create.
-   `--attribute-definitions`: An array of attributes that describe the key schema for the table and indexes.
-   `--key-schema`: Specifies the attributes that make up the primary key for a table or an index.
-   `--provisioned-throughput`: The provisioned throughput settings for the table or index.

### [Step 2: list the tables](#step-2-list-the-tables)

To list the tables, run the following command:

Terminal window

```
1aws dynamodb list-tables
```

### [Step 3: insert items into the table](#step-3-insert-items-into-the-table)

#### [Step 3.1: insert an item using AWS CLI](#step-31-insert-an-item-using-aws-cli)

To insert an item into the table, run the following command:

Terminal window

```
1aws dynamodb put-item \2    --table-name MyTable \3    --item \4        '{"Id": {"S": "1"}, "Name": {"S": "John Doe"}}'
```

Explanation:

-   `--item`: A map of attribute names to attribute values, representing the item to write.

#### [Step 3.2: insert multiple items using AWS CLI](#step-32-insert-multiple-items-using-aws-cli)

To insert multiple items into the table, run the following command:

Terminal window

```
1aws dynamodb batch-write-item \2    --request-items \3        '{"MyTable": [{"PutRequest": {"Item": {"Id": {"S": "2"}, "Name": {"S": "Jane Doe"}}}}]}'
```

Explanation:

-   `--request-items`: A map of one or more table names and, for each table, a list of operations to be performed (`DeleteRequest` or `PutRequest`).

#### [Step 3.3: insert items from a JSON file using AWS CLI](#step-33-insert-items-from-a-json-file-using-aws-cli)

Create a JSON file with the following content:

Terminal window

```
1# create a JSON file2touch items.json3
4# open the file5vim items.json
```

```
1{2  "MyTable": [3    {4      "PutRequest": {5        "Item": {6          "Id": {7            "S": "3"8          },9          "Name": {10            "S": "John Doe"11          }12        }13      }14    },15    {16      "PutRequest": {17        "Item": {18          "Id": {19            "S": "4"20          },21          "Name": {22            "S": "Jane Doe"23          }24        }25      }26    }27  ]28}
```

To insert items from a JSON file into the table, run the following command:

Terminal window

```
1aws dynamodb batch-write-item \2    --request-items file://items.json
```

Explanation:

-   `--request-items`: A map of one or more table names and, for each table, a list of operations to be performed (`DeleteRequest` or `PutRequest`).
-   `file://items.json`: The path to the JSON file.

### [Step 4: query the table](#step-4-query-the-table)

#### [Step 4.1: query the table using AWS CLI](#step-41-query-the-table-using-aws-cli)

To query the table, run the following command:

Terminal window

```
1aws dynamodb query \2    --table-name MyTable \3    --key-condition-expression "Id = :id" \4    --expression-attribute-values  '{":id":{"S":"1"}}'
```

Explanation:

-   `--key-condition-expression`: A condition that evaluates the query results and returns only the desired values.
-   `--expression-attribute-values`: One or more values that can be substituted in an expression.

#### [Step 4.2: query the table using AWS CLI and output to a JSON file](#step-42-query-the-table-using-aws-cli-and-output-to-a-json-file)

To query the table and output the result to a JSON file, run the following command:

Terminal window

```
1aws dynamodb query \2    --table-name MyTable \3    --key-condition-expression "Id = :id" \4    --expression-attribute-values  '{":id":{"S":"1"}}' \5    --output json > result.json
```

Explanation:

-   `--output`: The output format of the query result.
-   `> result.json`: The path to the JSON file.

### [Step 5: create a global secondary index](#step-5-create-a-global-secondary-index)

A global secondary index is a secondary index with a partition key and a sort key that can be different from those on the table. You can query the index using the partition key and sort key, or you can query the index using only the partition key.

#### [Step 5.1: create a global secondary index using AWS CLI](#step-51-create-a-global-secondary-index-using-aws-cli)

To create a global secondary index, run the following command:

Terminal window

```
1aws dynamodb update-table \2    --table-name MyTable \3    --attribute-definitions \4        AttributeName=Name,AttributeType=S \5    --global-secondary-index-updates \6        '[{"Create": {"IndexName": "NameIndex", "KeySchema": [{"AttributeName": "Name", "KeyType": "HASH"}], "Projection": {"ProjectionType": "ALL"}, "ProvisionedThroughput": {"ReadCapacityUnits": 1, "WriteCapacityUnits": 1}}}]'
```

Explanation:

-   `--attribute-definitions`: An array of attributes that describe the key schema for the table and indexes.
-   `--global-secondary-index-updates`: An array of one or more global secondary indexes to be updated on the table.

### [Step 6: remove the global secondary index](#step-6-remove-the-global-secondary-index)

#### [Step 6.1: remove the global secondary index using AWS CLI](#step-61-remove-the-global-secondary-index-using-aws-cli)

To remove the global secondary index, run the following command:

Terminal window

```
1aws dynamodb update-table \2    --table-name MyTable \3    --global-secondary-index-updates \4        '[{"Delete": {"IndexName": "NameIndex"}}]'
```

Explanation:

-   `--global-secondary-index-updates`: An array of one or more global secondary indexes to be updated on the table.

### [Step 7: create two DynamoDB tables with relationships](#step-7-create-two-dynamodb-tables-with-relationships)

#### [Step 7.1: create the first table](#step-71-create-the-first-table)

To create the first table, run the following command:

Terminal window

```
1aws dynamodb create-table \2    --table-name User \3    --attribute-definitions \4        AttributeName=Id,AttributeType=S \5    --key-schema \6        AttributeName=Id,KeyType=HASH \7    --provisioned-throughput \8        ReadCapacityUnits=1,WriteCapacityUnits=1
```

Explanation:

-   `--table-name`: The name of the table to be created.
-   `--attribute-definitions`: An array of attributes that describe the key schema for the table and indexes.
-   `--key-schema`: Specifies the attributes that make up the primary key for a table or an index.
-   `--provisioned-throughput`: The provisioned throughput settings for the table or index.

#### [Step 7.2: create the second table](#step-72-create-the-second-table)

To create the second table, run the following command:

Terminal window

```
1aws dynamodb create-table \2    --table-name Post \3    --attribute-definitions \4        AttributeName=Id,AttributeType=S \5        AttributeName=UserId,AttributeType=S \6    --key-schema \7        AttributeName=Id,KeyType=HASH \8    --global-secondary-indexes \9        '[{"IndexName": "UserIdIndex", "KeySchema": [{"AttributeName": "UserId", "KeyType": "HASH"}], "Projection": {"ProjectionType": "ALL"}, "ProvisionedThroughput": {"ReadCapacityUnits": 1, "WriteCapacityUnits": 1}}]' \10    --provisioned-throughput \11        ReadCapacityUnits=1,WriteCapacityUnits=1
```

Explanation:

-   `--table-name`: The name of the table to be created.
-   `--attribute-definitions`: An array of attributes that describe the key schema for the table and indexes.
-   `--key-schema`: Specifies the attributes that make up the primary key for a table or an index.
-   `--global-secondary-indexes`: One or more global secondary indexes (the maximum is 20) to be created on the table.
-   `--provisioned-throughput`: The provisioned throughput settings for the table or index.

#### [Step 7.3: add items to the first table](#step-73-add-items-to-the-first-table)

To add items to the first table, run the following command:

Terminal window

```
1aws dynamodb batch-write-item \2    --request-items \3        '{"User": [{"PutRequest": {"Item": {"Id": {"S": "1"}, "Name": {"S": "John Doe"}}}}]}'
```

Explanation:

-   `--request-items`: A map of one or more table names and, for each table, a list of operations to be performed (`DeleteRequest` or `PutRequest`).

#### [Step 7.4: add items to the second table](#step-74-add-items-to-the-second-table)

To add items to the second table, run the following command:

Terminal window

```
1aws dynamodb batch-write-item \2    --request-items \3        '{"Post": [{"PutRequest": {"Item": {"Id": {"S": "1"}, "UserId": {"S": "1"}, "Title": {"S": "Hello World"}}}}]}'
```

Explanation:

-   `--request-items`: A map of one or more table names and, for each table, a list of operations to be performed (`DeleteRequest` or `PutRequest`).

#### [Step 7.5: query the second table using AWS CLI](#step-75-query-the-second-table-using-aws-cli)

To query the second table, run the following command:

Terminal window

```
1aws dynamodb query \2    --table-name Post \3    --index-name UserIdIndex \4    --key-condition-expression "UserId = :userId" \5    --expression-attribute-values  '{":userId":{"S":"1"}}'
```

Explanation:

-   `--table-name`: The name of the table containing the requested items.
-   `--index-name`: The name of a global secondary index to be queried.
-   `--key-condition-expression`: A condition that evaluates the query results and returns only the desired values.
-   `--expression-attribute-values`: One or more values that can be substituted in an expression.

### [Step 8: create a DynamoDB table with a local secondary index](#step-8-create-a-dynamodb-table-with-a-local-secondary-index)

#### [Step 8.1: create the table](#step-81-create-the-table)

To create the table, run the following command:

Terminal window

```
1aws dynamodb create-table \2    --table-name MyTable \3    --attribute-definitions \4        AttributeName=Id,AttributeType=S \5        AttributeName=Name,AttributeType=S \6    --key-schema \7        AttributeName=Id,KeyType=HASH \8        AttributeName=Name,KeyType=RANGE \9    --local-secondary-indexes \10        '[{"IndexName": "NameIndex", "KeySchema": [{"AttributeName": "Id", "KeyType": "HASH"}, {"AttributeName": "Name", "KeyType": "RANGE"}], "Projection": {"ProjectionType": "ALL"}}]' \11    --provisioned-throughput \12        ReadCapacityUnits=1,WriteCapacityUnits=1
```

Explanation:

-   `--table-name`: The name of the table to be created.
-   `--attribute-definitions`: An array of attributes that describe the key schema for the table and indexes.
-   `--key-schema`: Specifies the attributes that make up the primary key for a table or an index.
-   `--local-secondary-indexes`: One or more local secondary indexes (the maximum is 5) to be created on the table.
-   `--provisioned-throughput`: The provisioned throughput settings for the table or index.

#### [Step 8.2: add items to the table](#step-82-add-items-to-the-table)

To add items to the table, run the following command:

Terminal window

```
1aws dynamodb batch-write-item \2    --request-items \3        '{"MyTable": [{"PutRequest": {"Item": {"Id": {"S": "1"}, "Name": {"S": "John Doe"}}}}]}'
```

Explanation:

-   `--request-items`: A map of one or more table names and, for each table, a list of operations to be performed (`DeleteRequest` or `PutRequest`).

#### [Step 8.3: query the table using AWS CLI](#step-83-query-the-table-using-aws-cli)

To query the table, run the following command:

Terminal window

```
1aws dynamodb query \2    --table-name MyTable \3    --index-name NameIndex \4    --key-condition-expression "Id = :id" \5    --expression-attribute-values  '{":id":{"S":"1"}}'
```

Explanation:

-   `--table-name`: The name of the table containing the requested items.
-   `--index-name`: The name of a local secondary index to be queried.
-   `--key-condition-expression`: A condition that evaluates the query results and returns only the desired values.
-   `--expression-attribute-values`: One or more values that can be substituted in an expression.

### [Step 9: describe a DynamoDB table using AWS CLI](#step-9-describe-a-dynamodb-table-using-aws-cli)

`describe-table` returns information about a table, such as the table status, creation date, and primary key schema.

To describe a table, run the following command:

Terminal window

```
1aws dynamodb describe-table \2    --table-name MyTable
```

### [Step 10: delete a DynamoDB table using AWS CLI](#step-10-delete-a-dynamodb-table-using-aws-cli)

`delete-table` removes a table and all of its items.

To delete a table, run the following command:

Terminal window

```
1aws dynamodb delete-table \2    --table-name MyTable
```

## [Conclusion](#conclusion)

In this tutorial, you learned how to use the AWS CLI to create, query, and delete DynamoDB tables. You also learned how to add global and local secondary indexes to a table, and how to query through them.

## [References](#references)

-   [Amazon DynamoDB Developer Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html)
-   [AWS CLI Command Reference - dynamodb](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/index.html)
-   [Getting Started with DynamoDB and the AWS CLI](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.CLI.html)
-   [Core Components of Amazon DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html)
-   [Working with Tables in DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html)
-   [Working with Items in DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html)
-   [Querying Data in DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html)
-   [Global Secondary Indexes (GSIs) in DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html)
-   [Local Secondary Indexes (LSIs) in DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LSI.html)
-   [Provisioned Throughput in DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ProvisionedThroughput.html)
-   [AWS CLI User Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)
-   [DynamoDB `create-table` CLI command](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/create-table.html)
-   [DynamoDB `put-item` CLI command](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/put-item.html)
-   [DynamoDB `batch-write-item` CLI command](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/batch-write-item.html)
-   [DynamoDB `query` CLI command](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/query.html)

Was this useful?

## Tags

[#AWS DynamoDB](/blog/tags/aws-dynamodb)[#AWS CLI Commands](/blog/tags/aws-cli-commands)[#NoSQL](/blog/tags/nosql)[#Database Management](/blog/tags/database-management)[#DynamoDB CRUD](/blog/tags/dynamodb-crud)[#Global Secondary Index](/blog/tags/global-secondary-index)[#Local Secondary Index](/blog/tags/local-secondary-index)

## Share

[Facebook](https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli "Share on Facebook")[Twitter](https://twitter.com/intent/tweet/?text=How%20To%20Create%20a%20DynamoDB%20Table%20Using%20AWS%20CLI&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli "Share on Twitter")[LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli&title=How%20To%20Create%20a%20DynamoDB%20Table%20Using%20AWS%20CLI&summary=In%20this%20article%2C%20we%20will%20learn%20how%20to%20create%20a%20DynamoDB%20table%20using%20AWS%20CLI.%20We%20will%20also%20learn%20how%20to%20add%20items%20to%20the%20table%20and%20how%20to%20query%20the%20table.&source=https://mkabumattar.com "Share on LinkedIn")[WhatsApp](https://wa.me/?text=How%20To%20Create%20a%20DynamoDB%20Table%20Using%20AWS%20CLI%20https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli "Share on WhatsApp")[Telegram](https://t.me/share/url?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli&text=How%20To%20Create%20a%20DynamoDB%20Table%20Using%20AWS%20CLI "Share on Telegram")[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli&title=How%20To%20Create%20a%20DynamoDB%20Table%20Using%20AWS%20CLI "Share on Reddit")[Hacker News](http://news.ycombinator.com/submitlink?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli&t=How%20To%20Create%20a%20DynamoDB%20Table%20Using%20AWS%20CLI "Share on Hacker News")[Pinterest](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli&media=&description=In%20this%20article%2C%20we%20will%20learn%20how%20to%20create%20a%20DynamoDB%20table%20using%20AWS%20CLI.%20We%20will%20also%20learn%20how%20to%20add%20items%20to%20the%20table%20and%20how%20to%20query%20the%20table. "Share on Pinterest")[Email](<mailto:?subject=How%20To%20Create%20a%20DynamoDB%20Table%20Using%20AWS%20CLI&body=Check out this article: https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-a-dynamodb-table-using-aws-cli>)

## Comments

## You might also enjoy

More posts on similar topics

[![How To Create a AWS S3 Bucket Using AWS CLI](/_astro/hero.CDw8keBv_tv9MO.webp)](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

## [How To Create a AWS S3 Bucket Using AWS CLI](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [S3](/blog/categories/s3)
-   [AWS CLI](/blog/categories/aws-cli)
-   [Cloud Storage](/blog/categories/cloud-storage)

Introduction In this post, I will show you how to create an AWS S3 bucket using AWS CLI. Prerequisites You need to have:AWS CLI installed and configured AWS S3 bucket nameAWS S3 bu

[#AWS S3 Bucket](/blog/tags/aws-s3-bucket)[#AWS CLI Commands](/blog/tags/aws-cli-commands)[#S3 Management](/blog/tags/s3-management)+3 tags

[read more](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

[![How To Create A Custom VPC Using AWS CLI](/_astro/hero.BWXhtVCk_Z2s3b7P.webp)](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)

## [How To Create A Custom VPC Using AWS CLI](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [VPC](/blog/categories/vpc)
-   [AWS CLI](/blog/categories/aws-cli)
-   [Cloud Networking](/blog/categories/cloud-networking)
-   [Infrastructure as Code](/blog/categories/infrastructure-as-code)

Introduction The example below creates a VPC with an IPv4 CIDR block, a public subnet, and a private subnet, all with AWS CLI commands. Once the VPC and subnets are configured, you can run an inst

[#AWS VPC](/blog/tags/aws-vpc)[#AWS CLI Commands](/blog/tags/aws-cli-commands)[#Virtual Private Cloud](/blog/tags/virtual-private-cloud)+7 tags

[read more](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)

[![How To Create An AWS EC2 Instance Using AWS CLI](/_astro/hero.Dh2x9Phr_14dc4A.webp)](/blog/post/how-to-create-an-aws-ec2-instance-using-aws-cli)

## [How To Create An AWS EC2 Instance Using AWS CLI](/blog/post/how-to-create-an-aws-ec2-instance-using-aws-cli)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [VPC](/blog/categories/vpc)
-   [AWS CLI](/blog/categories/aws-cli)
-   [WordPress](/blog/categories/wordpress)
-   [Linux](/blog/categories/linux)

Introduction In this tutorial we will create an AWS EC2 instance with the AWS CLI. We will build the network around it first, then launch the instance with a user data script that installs the Apa

[#AWS CLI EC2](/blog/tags/aws-cli-ec2)[#AWS CLI VPC](/blog/tags/aws-cli-vpc)[#VPC Configuration](/blog/tags/vpc-configuration)+8 tags

[read more](/blog/post/how-to-create-an-aws-ec2-instance-using-aws-cli)

[![How To Connect A Two EC2 Instances Data Transfer Using AWS CLI Without AWS EFS](/_astro/hero.WG5UXtzN_2uuusz.webp)](/blog/post/how-to-connect-a-two-ec2-instances-data-transfer-using-aws-cli-without-aws-efs)

## [How To Connect A Two EC2 Instances Data Transfer Using AWS CLI Without AWS EFS](/blog/post/how-to-connect-a-two-ec2-instances-data-transfer-using-aws-cli-without-aws-efs)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [S3](/blog/categories/s3)
-   [Data Transfer](/blog/categories/data-transfer)
-   [AWS CLI](/blog/categories/aws-cli)

Introduction In this post, I will show you how to transfer data between two EC2 instances using AWS CLI, without AWS EFS. We will use an AWS S3 bucket as the middleman. We will create an AWS S3 b

[#AWS S3 Sync](/blog/tags/aws-s3-sync)[#EC2 Data Transfer](/blog/tags/ec2-data-transfer)[#AWS CLI Automation](/blog/tags/aws-cli-automation)+5 tags

[read more](/blog/post/how-to-connect-a-two-ec2-instances-data-transfer-using-aws-cli-without-aws-efs)

[![How To Setup Bastion Host on AWS using AWS CLI](/_astro/hero.DGhoBA0r_KL9IM.webp)](/blog/post/how-to-setup-bastion-host-on-aws-using-aws-cli)

## [How To Setup Bastion Host on AWS using AWS CLI](/blog/post/how-to-setup-bastion-host-on-aws-using-aws-cli)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [AWS CLI](/blog/categories/aws-cli)
-   [Security](/blog/categories/security)
-   [Networking](/blog/categories/networking)
-   [DevOps](/blog/categories/devops)

Introduction Security is the top priority for any infrastructure and application, and that's why a Bastion host is a must-have in your infrastructure if you want to secure your remote connections.

[#AWS Bastion Host](/blog/tags/aws-bastion-host)[#AWS CLI](/blog/tags/aws-cli)[#VPC Setup](/blog/tags/vpc-setup)+7 tags

[read more](/blog/post/how-to-setup-bastion-host-on-aws-using-aws-cli)

[![How to Create a AWS RDS MySQL Database and Connect to it using MySQL Workbench](/_astro/hero.BalpSU3D_jRzSY.webp)](/blog/post/how-to-create-a-aws-rds-mysql-database-and-connect-to-it-using-mysql-workbench)

## [How to Create a AWS RDS MySQL Database and Connect to it using MySQL Workbench](/blog/post/how-to-create-a-aws-rds-mysql-database-and-connect-to-it-using-mysql-workbench)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [RDS](/blog/categories/rds)
-   [MySQL](/blog/categories/mysql)
-   [Database Management](/blog/categories/database-management)
-   [Cloud Computing](/blog/categories/cloud-computing)

Introduction RDS is a managed service that makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while automating time-c

[#AWS RDS Setup](/blog/tags/aws-rds-setup)[#MySQL Workbench Connection](/blog/tags/mysql-workbench-connection)[#Relational Database](/blog/tags/relational-database)+4 tags

[read more](/blog/post/how-to-create-a-aws-rds-mysql-database-and-connect-to-it-using-mysql-workbench)

6 related posts
