Skip to content

Commit 057ab19

Browse files
Merge pull request #12 from ShibraAmin18/gcp
Added Azure and GCP Compatibility Enhanced Security: 1. Credential Storage and Retrieval Customization 1. Custom Credentials 2. Custom Database Support
2 parents 4402cb8 + 08188b1 commit 057ab19

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

+1595
-327
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+
## AWS IAM 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+
## GCP 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: 85 additions & 37 deletions
Large diffs are not rendered by default.

backup/templates/backup-secret.yaml

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

backup/templates/service_account.yaml

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

examples/complete/README.md renamed to examples/complete/aws/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
77
<br>
88
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+
910
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
1011
## Requirements
1112

@@ -21,6 +22,7 @@ No requirements.
2122

2223
| Name | Source | Version |
2324
|------|--------|---------|
25+
| <a name="module_aws"></a> [aws](#module\_aws) | squareops/mysql/kubernetes//provider/aws | n/a |
2426
| <a name="module_mysql"></a> [mysql](#module\_mysql) | squareops/mysql/kubernetes | n/a |
2527

2628
## Resources
File renamed without changes.

examples/complete/aws/main.tf

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
locals {
2+
name = "mysql"
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 = false
11+
namespace = "mysql"
12+
store_password_to_secret_manager = false
13+
mysqldb_custom_credentials_enabled = true
14+
mysqldb_custom_credentials_config = {
15+
root_user = "root"
16+
root_password = "RJDRIFsYC8ZS1WQuV0ps"
17+
custom_username = "admin"
18+
custom_user_password = "NCPFUKEMd7rrWuvMAa73"
19+
replication_user = "replicator"
20+
replication_password = "nvAHhm1uGQNYWVw6ZyAH"
21+
exporter_user = "mysqld_exporter"
22+
exporter_password = "ZawhvpueAehRdKFlbjaq"
23+
}
24+
custom_user_username = "custom"
25+
}
26+
27+
module "aws" {
28+
source = "squareops/mysql/kubernetes//modules/resources/aws"
29+
cluster_name = "cluster-name"
30+
environment = local.environment
31+
name = local.name
32+
store_password_to_secret_manager = local.store_password_to_secret_manager
33+
mysqldb_custom_credentials_enabled = local.mysqldb_custom_credentials_enabled
34+
mysqldb_custom_credentials_config = local.mysqldb_custom_credentials_config
35+
custom_user_username = local.mysqldb_custom_credentials_enabled ? "" : local.custom_user_username
36+
}
37+
38+
module "mysql" {
39+
source = "squareops/mysql/kubernetes"
40+
create_namespace = local.create_namespace
41+
namespace = local.namespace
42+
mysqldb_config = {
43+
name = local.name
44+
values_yaml = file("./helm/values.yaml")
45+
app_version = "8.0.29-debian-11-r9"
46+
environment = local.environment
47+
architecture = "replication"
48+
custom_database = "test_db"
49+
storage_class_name = "gp2"
50+
custom_user_username = local.mysqldb_custom_credentials_enabled ? "" : local.custom_user_username
51+
primary_db_volume_size = "10Gi"
52+
secondary_db_volume_size = "10Gi"
53+
secondary_db_replica_count = 2
54+
store_password_to_secret_manager = local.store_password_to_secret_manager
55+
}
56+
mysqldb_custom_credentials_enabled = local.mysqldb_custom_credentials_enabled
57+
mysqldb_custom_credentials_config = local.mysqldb_custom_credentials_config
58+
root_password = local.mysqldb_custom_credentials_enabled ? "" : module.aws.root_password
59+
metric_exporter_pasword = local.mysqldb_custom_credentials_enabled ? "" : module.aws.metric_exporter_pasword
60+
mysqldb_replication_user_password = local.mysqldb_custom_credentials_enabled ? "" : module.aws.mysqldb_replication_user_password
61+
custom_user_password = local.mysqldb_custom_credentials_enabled ? "" : module.aws.custom_user_password
62+
bucket_provider_type = "s3"
63+
iam_role_arn_backup = module.aws.iam_role_arn_backup
64+
mysqldb_backup_enabled = true
65+
mysqldb_backup_config = {
66+
bucket_uri = "s3://bucket_name"
67+
s3_bucket_region = ""
68+
cron_for_full_backup = "*/5 * * * *"
69+
}
70+
mysqldb_restore_enabled = true
71+
iam_role_arn_restore = module.aws.iam_role_arn_restore
72+
mysqldb_restore_config = {
73+
bucket_uri = "s3://bucket_name/mysqldump_20230710_120501.zip"
74+
file_name = "mysqldump_20230710_120501.zip"
75+
s3_bucket_region = ""
76+
}
77+
mysqldb_exporter_enabled = true
78+
}
File renamed without changes.
File renamed without changes.

examples/complete/azure/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Mysql 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/mysql/kubernetes//provider/azure | n/a |
25+
| <a name="module_mysql"></a> [mysql](#module\_mysql) | squareops/mysql/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_mysql_credential"></a> [mysql\_credential](#output\_mysql\_credential) | MySQL credentials used for accessing the MySQL database. |
42+
| <a name="output_mysql_endpoints"></a> [mysql\_endpoints](#output\_mysql\_endpoints) | MySQL endpoints in the Kubernetes cluster. |

0 commit comments

Comments
 (0)