-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add type definitions all usages (#34)
Co-authored-by: dkool <dkool@dkools-MacBook-Pro.local>
- Loading branch information
Showing
8 changed files
with
153 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,13 @@ | ||
This example illustrates the default recovery services vault setup, in its simplest form. | ||
# Default | ||
|
||
## Usage: default | ||
This example illustrates the default setup, in its simplest form. | ||
|
||
```hcl | ||
module "rsv" { | ||
source = "cloudnationhq/rsv/azure" | ||
version = "~> 0.5" | ||
vault = { | ||
name = module.naming.recovery_services_vault.name | ||
location = module.rg.groups.demo.location | ||
resourcegroup = module.rg.groups.demo.name | ||
} | ||
} | ||
``` | ||
|
||
## Usage: multiple | ||
|
||
Additionally, for certain scenarios, the example below highlights the ability to use multiple vaults, enabling a broader setup. | ||
|
||
```hcl | ||
module "rsv" { | ||
source = "cloudnationhq/rsv/azure" | ||
version = "~> 0.1" | ||
for_each = local.vault | ||
naming = local.naming | ||
vault = each.value | ||
} | ||
``` | ||
|
||
The module uses a local to iterate, generating a recovery services vault for each key. | ||
## Types | ||
|
||
```hcl | ||
locals { | ||
vault = { | ||
vault1 = { | ||
name = "rsv-demo-dev-weu" | ||
location = module.rg.groups.demo.location | ||
resourcegroup = module.rg.groups.demo.name | ||
policies = { | ||
vms = { | ||
weu = { | ||
timezone = "W. Europe Standard Time" | ||
backup = { | ||
frequency = "Daily" | ||
time = "23:00" | ||
} | ||
retention = { | ||
daily = { | ||
count = 7 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
vault2 = { | ||
name = "rsv-demo-dev-sea" | ||
location = module.rg.groups.demo2.location | ||
resourcegroup = module.rg.groups.demo2.name | ||
policies = { | ||
vms = { | ||
sea = { | ||
timezone = "Singapore Standard Time" | ||
backup = { | ||
frequency = "Daily" | ||
time = "23:00" | ||
} | ||
retention = { | ||
daily = { | ||
count = 7 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
vault = object({ | ||
name = string | ||
location = string | ||
resource_group = string | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,43 @@ | ||
This example highlights recovery services vault policies using different types. | ||
# Policies | ||
|
||
## Usage: vm | ||
This deploys policies using different types | ||
|
||
```hcl | ||
module "rsv" { | ||
source = "cloudnationhq/rsv/azure" | ||
version = "~> 0.5" | ||
naming = local.naming | ||
vault = { | ||
name = module.naming.recovery_services_vault.name | ||
location = module.rg.groups.demo.location | ||
resourcegroup = module.rg.groups.demo.name | ||
policies = { | ||
vms = { | ||
pol1 = { | ||
timezone = "UTC" | ||
backup = { | ||
frequency = "Daily" | ||
time = "23:00" | ||
} | ||
retention = { | ||
daily = { | ||
count = 7 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Usage: file shares | ||
## Types | ||
|
||
```hcl | ||
module "rsv" { | ||
source = "cloudnationhq/rsv/azure" | ||
version = "~> 0.1" | ||
naming = local.naming | ||
vault = { | ||
name = module.naming.recovery_services_vault.name | ||
location = module.rg.groups.demo.location | ||
resourcegroup = module.rg.groups.demo.name | ||
policies = { | ||
file_shares = { | ||
pol1 = { | ||
timezone = "UTC" | ||
backup = { | ||
frequency = "Daily" | ||
time = "23:00" | ||
} | ||
retention = { | ||
daily = { | ||
count = 3 | ||
} | ||
weekly = { | ||
count = 2 | ||
weekdays = ["Monday", "Tuesday"] | ||
} | ||
monthly = { | ||
count = 1 | ||
weekdays = ["Monday"] | ||
weeks = ["First"] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
vault = object({ | ||
name = string | ||
location = string | ||
resource_group = string | ||
policies = optional(object({ | ||
file_shares = optional(map(object({ | ||
name = optional(string) | ||
timezone = optional(string) | ||
backup = object({ | ||
frequency = string | ||
time = string | ||
}) | ||
retention = object({ | ||
daily = object({ | ||
count = number | ||
}) | ||
weekly = optional(object({ | ||
count = number | ||
weekdays = list(string) | ||
})) | ||
monthly = optional(object({ | ||
count = number | ||
weekdays = list(string) | ||
weeks = list(string) | ||
})) | ||
yearly = optional(object({ | ||
count = number | ||
weekdays = list(string) | ||
weeks = list(string) | ||
months = list(string) | ||
})) | ||
}) | ||
}))) | ||
})) | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,17 @@ | ||
This example details a recovery services vault setup with a private endpoint, enhancing security by restricting data access to a private network. | ||
# Private Endpoint | ||
|
||
## Usage: private endpoint | ||
This deploys private endpoints | ||
|
||
```hcl | ||
module "privatelink" { | ||
source = "cloudnationhq/pe/azure" | ||
version = "~> 0.5" | ||
resourcegroup = module.rg.groups.demo.name | ||
location = module.rg.groups.demo.location | ||
endpoints = local.endpoints | ||
} | ||
``` | ||
|
||
The module uses the below locals for configuration: | ||
## Types | ||
|
||
```hcl | ||
locals { | ||
endpoints = { | ||
vault = { | ||
name = module.naming.private_endpoint.name | ||
subnet_id = module.network.subnets.sn1.id | ||
private_connection_resource_id = module.rsv.vault.id | ||
private_dns_zone_ids = [module.private_dns.zones.vault.id] | ||
subresource_names = ["AzureBackup"] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
The below module call is used to manage the private DNS zone: | ||
|
||
```hcl | ||
module "private_dns" { | ||
source = "cloudnationhq/pdns/azure" | ||
version = "~> 0.1" | ||
resourcegroup = module.rg.groups.demo.name | ||
zones = { | ||
vault = { | ||
name = "privatelink.we.backup.windowsazure.com" | ||
virtual_network_links = { | ||
link1 = { | ||
virtual_network_id = module.network.vnet.id | ||
registration_enabled = true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
resource_group = string | ||
location = string | ||
endpoints = map(object({ | ||
name = string | ||
subnet_id = string | ||
private_connection_resource_id = string | ||
private_dns_zone_ids = list(string) | ||
subresource_names = list(string) | ||
})) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
wip | ||
# Protected File Shares | ||
|
||
This deploys policies and associations to include file shares | ||
|
||
## Types | ||
|
||
```hcl | ||
vault = object({ | ||
name = string | ||
location = string | ||
resource_group = string | ||
policies = optional(object({ | ||
file_shares = optional(map(object({ | ||
name = optional(string) | ||
timezone = optional(string) | ||
backup = object({ | ||
frequency = string | ||
time = string | ||
}) | ||
retention = object({ | ||
daily = object({ | ||
count = number | ||
}) | ||
weekly = optional(object({ | ||
count = number | ||
weekdays = list(string) | ||
})) | ||
monthly = optional(object({ | ||
count = number | ||
weekdays = list(string) | ||
weeks = list(string) | ||
})) | ||
yearly = optional(object({ | ||
count = number | ||
weekdays = list(string) | ||
weeks = list(string) | ||
months = list(string) | ||
})) | ||
}) | ||
protected_shares = optional(map(object({ | ||
name = string | ||
storage_account_id = string | ||
}))) | ||
}))) | ||
})) | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.