Skip to content

Commit b32e555

Browse files
committed
Merge branch 'azure-dev' of https://github.com/ShibraAmin18/terraform-kubernetes-mongodb into azure-dev
2 parents 7e928cb + 3b5940b commit b32e555

File tree

10 files changed

+30
-35
lines changed

10 files changed

+30
-35
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ No requirements.
117117
| <a name="input_chart_version"></a> [chart\_version](#input\_chart\_version) | Version of the Mongodb chart that will be used to deploy Mongodb application. | `string` | `"13.1.5"` | no |
118118
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Specifies the name of the EKS cluster to deploy the Mongodb application on. | `string` | `""` | no |
119119
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Specify whether or not to create the namespace if it does not already exist. Set it to true to create the namespace. | `string` | `true` | no |
120+
| <a name="input_iam_role_arn_backup"></a> [iam\_role\_arn\_backup](#input\_iam\_role\_arn\_backup) | IAM role ARN for backup (AWS) | `string` | `""` | no |
121+
| <a name="input_iam_role_arn_restore"></a> [iam\_role\_arn\_restore](#input\_iam\_role\_arn\_restore) | IAM role ARN for restore (AWS) | `string` | `""` | no |
122+
| <a name="input_metric_exporter_pasword"></a> [metric\_exporter\_pasword](#input\_metric\_exporter\_pasword) | Metric exporter password for MongoDB | `string` | `""` | no |
120123
| <a name="input_mongodb_backup_config"></a> [mongodb\_backup\_config](#input\_mongodb\_backup\_config) | Configuration options for Mongodb database backups. It includes properties such as the S3 bucket URI, the S3 bucket region, and the cron expression for full backups. | `any` | <pre>{<br> "bucket_uri": "",<br> "cron_for_full_backup": "*/5 * * * *",<br> "s3_bucket_region": "us-east-2"<br>}</pre> | no |
121124
| <a name="input_mongodb_backup_enabled"></a> [mongodb\_backup\_enabled](#input\_mongodb\_backup\_enabled) | Specifies whether to enable backups for Mongodb database. | `bool` | `false` | no |
122125
| <a name="input_mongodb_config"></a> [mongodb\_config](#input\_mongodb\_config) | Specify the configuration settings for Mongodb, including the name, environment, storage options, replication settings, and custom YAML values. | `any` | <pre>{<br> "architecture": "",<br> "environment": "",<br> "name": "",<br> "replica_count": 2,<br> "storage_class_name": "",<br> "store_password_to_secret_manager": true,<br> "values_yaml": "",<br> "volume_size": ""<br>}</pre> | no |
@@ -132,6 +135,10 @@ No requirements.
132135
| <a name="input_resource_group_location"></a> [resource\_group\_location](#input\_resource\_group\_location) | Azure region | `string` | `"East US"` | no |
133136
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | Azure Resource Group name | `string` | `""` | no |
134137
| <a name="input_storage_account_name"></a> [storage\_account\_name](#input\_storage\_account\_name) | Azure storage account name | `string` | `""` | no |
138+
| <a name="input_root_password"></a> [root\_password](#input\_root\_password) | Root password for MongoDB | `string` | `""` | no |
139+
| <a name="input_service_account_backup"></a> [service\_account\_backup](#input\_service\_account\_backup) | Service account for backup (GCP) | `string` | `""` | no |
140+
| <a name="input_service_account_restore"></a> [service\_account\_restore](#input\_service\_account\_restore) | Service account for restore (GCP) | `string` | `""` | no |
141+
135142

136143
## Outputs
137144

example/complete/aws/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ No requirements.
2121

2222
| Name | Source | Version |
2323
|------|--------|---------|
24+
| <a name="module_aws"></a> [aws](#module\_aws) | squareops/mongodb/kubernetes//provider/aws | n/a |
2425
| <a name="module_mongodb"></a> [mongodb](#module\_mongodb) | squareops/mongodb/kubernetes | n/a |
2526

2627
## Resources

example/complete/aws/helm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ affinity:
33
requiredDuringSchedulingIgnoredDuringExecution:
44
nodeSelectorTerms:
55
- matchExpressions:
6-
- key: "Addon-Services"
6+
- key: "Data-Services"
77
operator: In
88
values:
99
- "true"

example/complete/aws/main.tf

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ locals {
1717
}
1818
}
1919
module "aws" {
20-
source = "../../../provider/aws"
20+
source = "squareops/mongodb/kubernetes//provider/aws"
2121
environment = local.environment
2222
name = local.name
2323
store_password_to_secret_manager = local.store_password_to_secret_manager
24-
cluster_name = "dev-cluster"
24+
cluster_name = "ipv6-shib"
2525
mongodb_custom_credentials_enabled = local.mongodb_custom_credentials_enabled
2626
mongodb_custom_credentials_config = local.mongodb_custom_credentials_config
2727
}
2828

2929
module "mongodb" {
30-
source = "../../../" #"squareops/mongodb/kubernetes"
30+
source = "squareops/mongodb/kubernetes"
3131
mongodb_config = {
3232
name = local.name
3333
values_yaml = file("./helm/values.yaml")
@@ -46,19 +46,16 @@ module "mongodb" {
4646
mongodb_backup_enabled = true
4747
iam_role_arn_backup = module.aws.iam_role_arn_backup
4848
mongodb_backup_config = {
49-
s3_bucket_uri = "s3://bucket_name"
50-
s3_bucket_region = "bucket_region"
49+
bucket_uri = "s3://mongo-demo-backup"
50+
s3_bucket_region = "us-east-2"
5151
cron_for_full_backup = "* * * * *"
5252
}
5353
mongodb_restore_enabled = true
5454
iam_role_arn_restore = module.aws.iam_role_arn_restore
5555
mongodb_restore_config = {
56-
s3_bucket_uri = "s3://bucket_name/filename"
57-
s3_bucket_region = "bucket_region"
58-
full_restore_enable = true
59-
file_name_full = "filename"
60-
incremental_restore_enable = false
61-
file_name_incremental = ""
56+
bucket_uri = "s3://mongo-demo-backup/mongodumpfull_20230523_092110.gz"
57+
s3_bucket_region = "us-east-2"
58+
file_name = "mongodumpfull_20230523_092110.gz"
6259
}
6360
mongodb_exporter_enabled = true
6461
}

example/complete/gcp/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ No requirements.
2222

2323
| Name | Source | Version |
2424
|------|--------|---------|
25+
| <a name="module_gcp"></a> [gcp](#module\_gcp) | squareops/mongodb/kubernetes//provider/gcp | n/a |
2526
| <a name="module_mongodb"></a> [mongodb](#module\_mongodb) | squareops/mongodb/kubernetes | n/a |
2627

2728
## Resources

example/complete/gcp/helm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ affinity:
33
requiredDuringSchedulingIgnoredDuringExecution:
44
nodeSelectorTerms:
55
- matchExpressions:
6-
- key: "Infra-Services"
6+
- key: "Data-Services"
77
operator: In
88
values:
99
- "true"

example/complete/gcp/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ locals {
1818
}
1919

2020
module "gcp" {
21-
source = "../../../provider/gcp"
22-
project_id = "fresh-sanctuary-389006" #for gcp
21+
source = "squareops/mongodb/kubernetes//provider/gcp"
22+
project_id = "fresh-sanctuary-387476" #for gcp
2323
environment = local.environment
2424
name = local.name
2525
store_password_to_secret_manager = local.store_password_to_secret_manager
@@ -29,8 +29,8 @@ module "gcp" {
2929

3030

3131
module "mongodb" {
32-
source = "../../../" #"squareops/mongodb/kubernetes"
33-
cluster_name = "skaf-dev-gke-cluster"
32+
source = "squareops/mongodb/kubernetes"
33+
cluster_name = "dev-gke-cluster"
3434
mongodb_config = {
3535
name = local.name
3636
values_yaml = file("./helm/values.yaml")
@@ -50,13 +50,13 @@ module "mongodb" {
5050
service_account_restore = module.gcp.service_account_restore
5151
mongodb_backup_enabled = true
5252
mongodb_backup_config = {
53-
bucket_uri = "gs://mongo-backup-skaf"
53+
bucket_uri = "gs://mongo-backup-dev"
5454
s3_bucket_region = ""
5555
cron_for_full_backup = "* * * * *"
5656
}
5757
mongodb_restore_enabled = true
5858
mongodb_restore_config = {
59-
bucket_uri = "gs://mongo-backup-skaf/mongodumpfull_20230710_132301.gz"
59+
bucket_uri = "gs://mongo-backup-dev/mongodumpfull_20230710_132301.gz"
6060
s3_bucket_region = ""
6161
file_name = "mongodumpfull_20230710_132301.gz"
6262

example/complete/gcp/provider.tf

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
data "google_client_config" "default" {}
22

33
data "google_container_cluster" "primary" {
4-
name = "skaf-dev-gke-cluster"
4+
name = "dev-gke-cluster"
55
location = "asia-south1"
6-
project = "fresh-sanctuary-389006"
6+
project = "fresh-sanctuary-3894579"
77
}
88

99
provider "kubernetes" {
@@ -19,14 +19,3 @@ provider "helm" {
1919
cluster_ca_certificate = base64decode(data.google_container_cluster.primary.master_auth.0.cluster_ca_certificate)
2020
}
2121
}
22-
23-
provider "google" {
24-
region = "asia-south1"
25-
project = "fresh-sanctuary-389006"
26-
}
27-
28-
provider "aws" {
29-
alias = "aws"
30-
access_key = null
31-
secret_key = null
32-
}

output.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ output "mongodb_credential" {
1010
description = "MongoDB credentials used for accessing the MongoDB database."
1111
value = var.mongodb_config.store_password_to_secret_manager ? null : {
1212
root_user = var.mongodb_custom_credentials_enabled ? var.mongodb_custom_credentials_config.root_user : "root",
13-
root_password = var.mongodb_custom_credentials_enabled ? var.mongodb_custom_credentials_config.root_password : nonsensitive(random_password.mongodb_root_password[0].result),
13+
root_password = var.mongodb_custom_credentials_enabled ? var.mongodb_custom_credentials_config.root_password : var.root_password,
1414
metric_exporter_user = var.mongodb_custom_credentials_enabled ? var.mongodb_custom_credentials_config.metric_exporter_user : "mongodb_exporter",
15-
metric_exporter_password = var.mongodb_custom_credentials_enabled ? var.mongodb_custom_credentials_config.metric_exporter_password : nonsensitive(random_password.mongodb_exporter_password[0].result)
15+
metric_exporter_password = var.mongodb_custom_credentials_enabled ? var.mongodb_custom_credentials_config.metric_exporter_password : var.metric_exporter_password
1616
}
1717
}

provider/aws/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ output "root_password" {
1616
output "metric_exporter_pasword" {
1717
value = var.mongodb_custom_credentials_enabled ? null : nonsensitive(random_password.mongodb_exporter_password[0].result)
1818
description = "mongodb_exporter user's password of MongoDB"
19-
}
19+
}

0 commit comments

Comments
 (0)