# RDS Instance and Cluster

### Creating a single az instance with minimal parameters

```
resources:
  - type: aws_rds_db_instance
    name: mysql-db1
    props:
      db_instance_identifier: "my-mysql-db"
      engine: "mysql"
      engine_version: "8.0.35"
      db_instance_class: "db.t3.micro"
      allocated_storage: 100
      storage_type: "gp2"
      db_name: "mydb"
      master_username: "admin"
      master_user_password: "MyPassword123!"
      db_subnet_group_name: "my-existing-subnet-group"
```

#### Example price for above configuration

```
mysql-db1 (action: create)
=> Price (Compute - price: $0.017/Hrs, monthly: $12.65)
=> Price (Storage - price: $0.115/GB-Mo, quantity: 200, monthly: $23.00)
```

### Creating a multi az instance with minimal parameters

```
resources:
  - type: aws_rds_db_instance
    name: mysql-db2
    props:
      db_instance_identifier: "my-mysql-db"
      engine: "mysql"
      engine_version: "8.0.35"
      db_instance_class: "db.t3.micro"
      allocated_storage: 200
      storage_type: "gp3"
      db_name: "mydb"
      master_username: "admin"
      master_user_password: "MyPassword123!"
      db_subnet_group_name: "my-existing-subnet-group"
      multi_az: true
```

#### Example price for above configuration

```
mysql-db2 (action: create)
=> Price (Compute - price: $0.034/Hrs, monthly: $25.30)
=> Price (Storage - price: $0.23/GB-Mo, quantity: 200, monthly: $46.00)
```

### Creating a multi az cluster with minimal parameters

```
resources:
  - type: aws_rds_db_cluster
    name: mysql-cluster
    props:
      db_cluster_identifier: "my-mysql-cluster"
      engine: "mysql"
      engine_version: "8.0.35"
      db_cluster_instance_class: "db.m6gd.large"
      allocated_storage: 200
      storage_type: "gp3"
      iops: 3000
      database_name: "mydb"
      master_username: "admin"
      master_user_password: "MyPassword123!"
      db_subnet_group_name: "my-existing-subnet-group"
```

#### Example price for above configuration

```
mysql-cluster (action: create)
=> Price (Price - price: $0.522/Hrs, monthly: $388.37)
=> Price (Storage - price: $0.345/GB-Mo, quantity: 200, monthly: $69.00)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mechcloud.io/cloud-computing/stateless-iac/aws/examples-resources-with-cost/rds/rds-instance-and-cluster.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
