Skip to content

Commit fbda94d

Browse files
authored
Merge pull request #30 from Think-Cube/patch
Patch
2 parents 1446f77 + b3b1d9b commit fbda94d

File tree

4 files changed

+196
-0
lines changed

4 files changed

+196
-0
lines changed

examples/advanced/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Terraform Azure Container Registry - Advanced Example
2+
3+
This example demonstrates a **full-featured deployment** of an Azure Container Registry (ACR) using the module.
4+
5+
It is suitable for **production environments** where:
6+
7+
- High availability and security are required
8+
- Georeplication across regions is needed
9+
- Managed identities and customer-managed encryption are used
10+
- Network access is restricted with custom rules
11+
- Quarantine and trust policies are enabled
12+
13+
```hcl
14+
module "acr_advanced" {
15+
source = "./terraform-azure-container-registry"
16+
acr_name = "myadvancedacr"
17+
resource_group_name = "rg-prod"
18+
resource_group_location = "West Europe"
19+
acr_tier = "Premium"
20+
acr_admin_enabled = false
21+
public_network_access_enabled = false
22+
quarantine_policy_enabled = true
23+
zone_redundancy_enabled = true
24+
export_policy_enabled = true
25+
anonymous_pull_enabled = false
26+
data_endpoint_enabled = true
27+
network_rule_bypass_option = "None"
28+
retention_policy = 30
29+
trust_policy = { enabled = true }
30+
31+
georeplications = [
32+
{
33+
location = "North Europe"
34+
zone_redundancy_enabled = true
35+
regional_endpoint_enabled = true
36+
tags = {
37+
replication = "north"
38+
}
39+
},
40+
{
41+
location = "East US"
42+
zone_redundancy_enabled = false
43+
regional_endpoint_enabled = true
44+
tags = {
45+
replication = "east"
46+
}
47+
}
48+
]
49+
50+
network_rule_set = {
51+
default_action = "Deny"
52+
ip_rules = ["203.0.113.0/24", "198.51.100.0/24"]
53+
}
54+
55+
identity = {
56+
type = "UserAssigned"
57+
identity_ids = ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-prod/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mi-acr"]
58+
}
59+
60+
encryption = {
61+
key_vault_key_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-prod/providers/Microsoft.KeyVault/vaults/myvault/keys/mykey"
62+
identity_client_id = "00000000-0000-0000-0000-000000000000"
63+
}
64+
65+
default_tags = {
66+
environment = "prod"
67+
project = "example"
68+
}
69+
}
70+
```

examples/advanced/main.tf

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
module "acr_advanced" {
2+
source = "./terraform-azure-container-registry"
3+
acr_name = "myadvancedacr"
4+
resource_group_name = "rg-prod"
5+
resource_group_location = "West Europe"
6+
acr_tier = "Premium"
7+
acr_admin_enabled = false
8+
public_network_access_enabled = false
9+
quarantine_policy_enabled = true
10+
zone_redundancy_enabled = true
11+
export_policy_enabled = true
12+
anonymous_pull_enabled = false
13+
data_endpoint_enabled = true
14+
network_rule_bypass_option = "None"
15+
retention_policy = 30
16+
trust_policy = { enabled = true }
17+
18+
georeplications = [
19+
{
20+
location = "North Europe"
21+
zone_redundancy_enabled = true
22+
regional_endpoint_enabled = true
23+
tags = {
24+
replication = "north"
25+
}
26+
},
27+
{
28+
location = "East US"
29+
zone_redundancy_enabled = false
30+
regional_endpoint_enabled = true
31+
tags = {
32+
replication = "east"
33+
}
34+
}
35+
]
36+
37+
network_rule_set = {
38+
default_action = "Deny"
39+
ip_rules = ["203.0.113.0/24", "198.51.100.0/24"]
40+
}
41+
42+
identity = {
43+
type = "UserAssigned"
44+
identity_ids = ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-prod/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mi-acr"]
45+
}
46+
47+
encryption = {
48+
key_vault_key_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-prod/providers/Microsoft.KeyVault/vaults/myvault/keys/mykey"
49+
identity_client_id = "00000000-0000-0000-0000-000000000000"
50+
}
51+
52+
default_tags = {
53+
environment = "prod"
54+
project = "example"
55+
}
56+
}

examples/basic/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Terraform Azure Container Registry - Basic Example
2+
3+
This example demonstrates a **basic deployment** of an Azure Container Registry (ACR) using the module.
4+
5+
It is suitable for **development or test environments** where:
6+
7+
- Minimal configuration is needed
8+
- No georeplication is required
9+
- Public network access is enabled
10+
- No managed identity or encryption is required
11+
12+
13+
```hcl
14+
module "acr_basic" {
15+
source = "./terraform-azure-container-registry"
16+
acr_name = "mybasicacr"
17+
resource_group_name = "rg-example"
18+
resource_group_location = "East US"
19+
acr_tier = "Basic"
20+
acr_admin_enabled = true
21+
public_network_access_enabled = true
22+
quarantine_policy_enabled = false
23+
zone_redundancy_enabled = false
24+
export_policy_enabled = false
25+
anonymous_pull_enabled = false
26+
data_endpoint_enabled = false
27+
network_rule_bypass_option = "AzureServices"
28+
retention_policy = 7
29+
trust_policy = { enabled = false }
30+
31+
georeplications = []
32+
33+
network_rule_set = null
34+
identity = null
35+
encryption = null
36+
37+
default_tags = {
38+
environment = "dev"
39+
project = "example"
40+
}
41+
}
42+
```

examples/basic/main.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module "acr_basic" {
2+
source = "./terraform-azure-container-registry"
3+
acr_name = "mybasicacr"
4+
resource_group_name = "rg-example"
5+
resource_group_location = "East US"
6+
acr_tier = "Basic"
7+
acr_admin_enabled = true
8+
public_network_access_enabled = true
9+
quarantine_policy_enabled = false
10+
zone_redundancy_enabled = false
11+
export_policy_enabled = false
12+
anonymous_pull_enabled = false
13+
data_endpoint_enabled = false
14+
network_rule_bypass_option = "AzureServices"
15+
retention_policy = 7
16+
trust_policy = { enabled = false }
17+
18+
georeplications = []
19+
20+
network_rule_set = null
21+
identity = null
22+
encryption = null
23+
24+
default_tags = {
25+
environment = "dev"
26+
project = "example"
27+
}
28+
}

0 commit comments

Comments
 (0)