https://github.com/jameswoolfenden/terraform-aws-documentdb
Basic Documentdb module
https://github.com/jameswoolfenden/terraform-aws-documentdb
aws module terraform
Last synced: 3 months ago
JSON representation
Basic Documentdb module
- Host: GitHub
- URL: https://github.com/jameswoolfenden/terraform-aws-documentdb
- Owner: JamesWoolfenden
- License: apache-2.0
- Created: 2020-11-03T14:34:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-24T15:46:25.000Z (about 3 years ago)
- Last Synced: 2025-01-25T19:28:05.545Z (over 1 year ago)
- Topics: aws, module, terraform
- Language: HCL
- Homepage:
- Size: 76.2 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# terraform-aws-documentdb
[](https://github.com/JamesWoolfenden/terraform-aws-documentdb)
[](https://github.com/JamesWoolfenden/terraform-aws-documentdb/releases/latest)
[](https://github.com/JamesWoolfenden/terraform-aws-documentdb/releases/latest)

[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=JamesWoolfenden%2Fterraform-aws-documentdb&benchmark=CIS+AWS+V1.2)
[](https://github.com/pre-commit/pre-commit)
[](https://www.checkov.io/)
[](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=JamesWoolfenden%2Fterraform-aws-documentdb&benchmark=INFRASTRUCTURE+SECURITY)
---
Terraform module a documentdb. It's 100% Open Source and licensed under the [APACHE2](LICENSE).
## Usage
This is just a very basic example.

Include this repository as a module in your existing Terraform code:
```hcl
module "documentdb" {
source = "jameswoolfenden/documentdb/aws"
common_tags = var.common_tags
}
```
## Costs
```text
Monthly cost estimate
Project: JamesWoolfenden/terraform-aws-documentdb/example/examplea
Name Monthly Qty Unit Monthly Cost
module.documentdb.aws_docdb_cluster.examplea
└─ Backup storage Monthly cost depends on usage: $0 per GB
module.documentdb.aws_docdb_cluster_instance.examplea[0]
├─ Database instance (on-demand, db.r5.large) 730 hours $237.25
├─ Storage Monthly cost depends on usage: $0 per GB
└─ I/O Monthly cost depends on usage: $0 per 1M requests
OVERALL TOTAL $237.25
```
## Detailed Notes
## Requirements
No requirements.
## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | n/a |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_docdb_cluster.examplea](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/docdb_cluster) | resource |
| [aws_docdb_cluster_instance.examplea](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/docdb_cluster_instance) | resource |
| [aws_docdb_cluster_parameter_group.examplea](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/docdb_cluster_parameter_group) | resource |
| [aws_docdb_subnet_group.examplea](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/docdb_subnet_group) | resource |
| [aws_availability_zones.available](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [apply\_immediately](#input\_apply\_immediately) | n/a | `bool` | `false` | no |
| [backup\_retention\_period](#input\_backup\_retention\_period) | n/a | `number` | `5` | no |
| [change\_stream\_log\_retention\_duration](#input\_change\_stream\_log\_retention\_duration) | Defines the duration of time (in seconds) that the change stream log is retained and can be consumed. | `number` | `10800` | no |
| [cluster\_identifier](#input\_cluster\_identifier) | n/a | `string` | `"my-docdb-cluster"` | no |
| [deletion\_protection](#input\_deletion\_protection) | n/a | `bool` | `false` | no |
| [family](#input\_family) | n/a | `string` | `"docdb3.6"` | no |
| [instance-prefix](#input\_instance-prefix) | n/a | `string` | `"docdb-cluster-demo"` | no |
| [instance\_class](#input\_instance\_class) | n/a | `string` | `"db.r5.large"` | no |
| [instance\_count](#input\_instance\_count) | n/a | `number` | `1` | no |
| [instance\_maintenance\_window](#input\_instance\_maintenance\_window) | n/a | `string` | `"Sat:00:00-Sat:03:00"` | no |
| [kms\_key\_id](#input\_kms\_key\_id) | The ARN of the key to encrypt the db with. | `string` | n/a | yes |
| [master\_password](#input\_master\_password) | DocumentDB Password | `string` | n/a | yes |
| [master\_username](#input\_master\_username) | n/a | `string` | `"docadmin"` | no |
| [param\_group\_name](#input\_param\_group\_name) | n/a | `string` | `"examplea"` | no |
| [profiler](#input\_profiler) | n/a | `string` | `"disabled"` | no |
| [profiler\_sampling\_rate](#input\_profiler\_sampling\_rate) | Defines the sampling rate for logged operations. | `number` | `1` | no |
| [profiler\_threshold\_ms](#input\_profiler\_threshold\_ms) | Defines the threshold for profiler | `number` | `100` | no |
| [promotion\_tier](#input\_promotion\_tier) | n/a | `number` | `0` | no |
| [subnet\_group\_name](#input\_subnet\_group\_name) | n/a | `string` | `"docdb"` | no |
| [subnet\_list](#input\_subnet\_list) | n/a | `list(any)` | n/a | yes |
| [ttl\_monitor](#input\_ttl\_monitor) | n/a | `string` | `"enabled"` | no |
## Outputs
| Name | Description |
|------|-------------|
| [cluster](#output\_cluster) | n/a |
| [instance](#output\_instance) | n/a |
| [properties](#output\_properties) | n/a |
## Policy
This is the policy required to build this project:
The Terraform resource required is:
```golang
resource "aws_iam_policy" "terraform_pike" {
name_prefix = "terraform_pike"
path = "/"
description = "Pike Autogenerated policy from IAC"
policy = jsonencode({
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:DescribeAccountAttributes",
"ec2:DescribeAvailabilityZones"
],
"Resource": [
"*"
]
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"rds:CreateDBCluster",
"rds:CreateDBClusterParameterGroup",
"rds:CreateDBInstance",
"rds:CreateDBSubnetGroup",
"rds:DeleteDBCluster",
"rds:DeleteDBClusterParameterGroup",
"rds:DeleteDBInstance",
"rds:DeleteDBSubnetGroup",
"rds:DescribeDBClusterParameterGroups",
"rds:DescribeDBClusterParameters",
"rds:DescribeDBClusters",
"rds:DescribeDBInstances",
"rds:DescribeDBSubnetGroups",
"rds:DescribeGlobalClusters",
"rds:ListTagsForResource",
"rds:ModifyDBCluster",
"rds:ModifyDBClusterParameterGroup",
"rds:ModifyDBInstance"
],
"Resource": [
"*"
]
}
]
})
}
```
## Related Projects
Check out these related projects.
- [terraform-aws-codecommit](https://github.com/jameswoolfenden/terraform-aws-codecommit) - Storing ones code
## Help
**Got a question?**
File a GitHub [issue](https://github.com/jameswoolfenden/terraform-aws-documentdb/issues).
## Contributing
### Bug Reports & Feature Requests
Please use the [issue tracker](https://github.com/jameswoolfenden/terraform-aws-documentdb/issues) to report any bugs or file feature requests.
## Copyrights
Copyright © 2019-2023 James Woolfenden
## License
[](https://opensource.org/licenses/Apache-2.0)
See [LICENSE](LICENSE) for full details.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
### Contributors
[![James Woolfenden][jameswoolfenden_avatar]][jameswoolfenden_homepage]
[James Woolfenden][jameswoolfenden_homepage]
[jameswoolfenden_homepage]: https://github.com/jameswoolfenden
[jameswoolfenden_avatar]: https://github.com/jameswoolfenden.png?size=150