Skip to content

Commit fc0a9c1

Browse files
Merge pull request #11 from ShibraAmin18/gcp
1. Added Azure and GCP cloud Compatibility 2. Enhanced Security: a. Credential Storage and Retrieval 3. Customization: a. Custom Credentials b. Custom Database Support
2 parents 581d5d7 + 5350627 commit fc0a9c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1480
-325
lines changed

IAM.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## IAM Permission
1+
## IAM AWS Permission
22

33
The Policy required to deploy this module:
44
```hcl
@@ -50,3 +50,36 @@ The Policy required to deploy this module:
5050
]
5151
}
5252
```
53+
## Azure Role Permissions
54+
55+
```hcl
56+
permissions {
57+
actions = [
58+
"Microsoft.Authorization/roleAssignments/delete",
59+
"Microsoft.Authorization/roleAssignments/read",
60+
"Microsoft.Authorization/roleAssignments/write",
61+
"Microsoft.KeyVault/locations/deletedVaults/read",
62+
"Microsoft.KeyVault/vaults/delete",
63+
"Microsoft.KeyVault/vaults/read",
64+
"Microsoft.KeyVault/vaults/write",
65+
"Microsoft.ManagedIdentity/userAssignedIdentities/delete",
66+
"Microsoft.ManagedIdentity/userAssignedIdentities/read",
67+
"Microsoft.ManagedIdentity/userAssignedIdentities/write",
68+
"Microsoft.Resources/subscriptions/providers/read",
69+
"Microsoft.Resources/subscriptions/resourcegroups/read"]
70+
not_actions = []
71+
}
72+
```
73+
74+
## Google IAM Permissions
75+
76+
```hcl
77+
permissions = [
78+
"iam.serviceAccounts.create",
79+
"iam.serviceAccounts.delete",
80+
"iam.serviceAccounts.get",
81+
"iam.serviceAccounts.update",
82+
"resourcemanager.projects.getIamPolicy",
83+
"resourcemanager.projects.setIamPolicy"
84+
]
85+
```

README.md

Lines changed: 80 additions & 38 deletions
Large diffs are not rendered by default.

backup/templates/backup-secrets.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

example/complete/main.tf

Lines changed: 0 additions & 49 deletions
This file was deleted.
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

examples/complete/aws/main.tf

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
locals {
2+
name = "mongo"
3+
region = "us-east-2"
4+
environment = "prod"
5+
additional_tags = {
6+
Owner = "organization_name"
7+
Expires = "Never"
8+
Department = "Engineering"
9+
}
10+
create_namespace = true
11+
namespace = "mongodb"
12+
store_password_to_secret_manager = true
13+
mongodb_custom_credentials_enabled = true
14+
mongodb_custom_credentials_config = {
15+
root_user = "root"
16+
root_password = "NCPFUKEMd7rrWuvMAa73"
17+
metric_exporter_user = "mongodb_exporter"
18+
metric_exporter_password = "nvAHhm1uGQNYWVw6ZyAH"
19+
}
20+
}
21+
module "aws" {
22+
source = "squareops/mongodb/kubernetes//modules/resources/aws"
23+
environment = local.environment
24+
name = local.name
25+
store_password_to_secret_manager = local.store_password_to_secret_manager
26+
cluster_name = ""
27+
mongodb_custom_credentials_enabled = local.mongodb_custom_credentials_enabled
28+
mongodb_custom_credentials_config = local.mongodb_custom_credentials_config
29+
}
30+
31+
module "mongodb" {
32+
source = "squareops/mongodb/kubernetes"
33+
namespace = local.namespace
34+
create_namespace = local.create_namespace
35+
mongodb_config = {
36+
name = local.name
37+
namespace = local.namespace
38+
values_yaml = file("./helm/values.yaml")
39+
environment = local.environment
40+
volume_size = "10Gi"
41+
architecture = "replicaset"
42+
custom_databases = "['db1', 'db2']"
43+
custom_databases_usernames = "['admin', 'admin']"
44+
custom_databases_passwords = "['pass1', 'pass2']"
45+
replica_count = 2
46+
storage_class_name = "gp2"
47+
store_password_to_secret_manager = local.store_password_to_secret_manager
48+
}
49+
mongodb_custom_credentials_enabled = local.mongodb_custom_credentials_enabled
50+
mongodb_custom_credentials_config = local.mongodb_custom_credentials_config
51+
root_password = local.mongodb_custom_credentials_enabled ? "" : module.aws.root_password
52+
metric_exporter_password = local.mongodb_custom_credentials_enabled ? "" : module.aws.metric_exporter_password
53+
bucket_provider_type = "s3"
54+
mongodb_backup_enabled = true
55+
iam_role_arn_backup = module.aws.iam_role_arn_backup
56+
mongodb_backup_config = {
57+
bucket_uri = "s3://mongo-demo-backup"
58+
s3_bucket_region = "us-east-2"
59+
cron_for_full_backup = "* * * * *"
60+
}
61+
mongodb_restore_enabled = true
62+
iam_role_arn_restore = module.aws.iam_role_arn_restore
63+
mongodb_restore_config = {
64+
bucket_uri = "s3://mongo-demo-backup/mongodumpfull_20230523_092110.gz"
65+
s3_bucket_region = "us-east-2"
66+
file_name = "mongodumpfull_20230523_092110.gz"
67+
}
68+
mongodb_exporter_enabled = true
69+
}

examples/complete/azure/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Mongodb Example
2+
![squareops_avatar]
3+
4+
[squareops_avatar]: https://squareops.com/wp-content/uploads/2022/12/squareops-logo.png
5+
6+
### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
7+
<br>
8+
This example will be very useful for users who are new to a module and want to quickly learn how to use it. By reviewing the examples, users can gain a better understanding of how the module works, what features it supports, and how to customize it to their specific needs.
9+
10+
## Requirements
11+
12+
No requirements.
13+
14+
## Providers
15+
16+
| Name | Version |
17+
|------|---------|
18+
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 3.70.0 |
19+
20+
## Modules
21+
22+
| Name | Source | Version |
23+
|------|--------|---------|
24+
| <a name="module_azure"></a> [azure](#module\_azure) | squareops/mongodb/kubernetes//provider/azure | n/a |
25+
| <a name="module_mongodb"></a> [mongodb](#module\_mongodb) | squareops/mongodb/kubernetes | n/a |
26+
27+
## Resources
28+
29+
| Name | Type |
30+
|------|------|
31+
| [azurerm_kubernetes_cluster.primary](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/kubernetes_cluster) | data source |
32+
33+
## Inputs
34+
35+
No inputs.
36+
37+
## Outputs
38+
39+
| Name | Description |
40+
|------|-------------|
41+
| <a name="output_mongodb_credential"></a> [mongodb\_credential](#output\_mongodb\_credential) | MongoDB credentials used for accessing the MongoDB database. |
42+
| <a name="output_mongodb_endpoints"></a> [mongodb\_endpoints](#output\_mongodb\_endpoints) | MongoDB endpoints in the Kubernetes cluster. |

0 commit comments

Comments
 (0)