Skip to content

Commit f729216

Browse files
Release 0.2.1 (#27)
* fix: FSS principal names * fix: dependencies strongly typed * feat: automation config added * fix: dependencies strongly typed * feat: data types changed to any in examples * fix: substr length arg added * doc: release notes and version bump
1 parent 07cc201 commit f729216

File tree

22 files changed

+103
-378
lines changed

22 files changed

+103
-378
lines changed

RELEASE-NOTES.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
# February 27, 2024 Release Notes
1+
# April 17, 2024 Release Notes - 0.2.1
2+
## Updates
3+
### All Modules
4+
1. Dependency variables are now strongly typed, enhancing usage guidance.
5+
### Policies Module
6+
1. FSS (File System Service) principal names fixed in realms with keys greater than 10.
7+
8+
9+
# February 27, 2024 Release Notes - 0.2.0
210
## Updates
311
### Identity Domains Module
412
1. The Identity Domains module now supports creating SAML Identity Providers through a new configuration variable. The variable *identity_domain_identity_providers_configuration* includes parameters to manage identity providers using either a SAML metadata file or individual metadata parameter values.
513
### Compartments Module
614
1. The reserved key "TENANCY-ROOT" has been introduced. It is used for referring to the root compartment OCID. It can be assigned to *default_parent_id* and *parent_id* attributes.
715
### Policies Module
8-
1. The reserved key "TENANCY-ROOT" has been introduced. It is used for referring to the root compartment OCID. It can be assigned to *compartment_id* attribute within *supplied_policies* attribute.
16+
2. The reserved key "TENANCY-ROOT" has been introduced. It is used for referring to the root compartment OCID. It can be assigned to *compartment_id* attribute within *supplied_policies* attribute.
917

1018
# January 08, 2024 Release Notes - 0.1.9
1119
## Updates

compartments/README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,29 @@ Check the [examples](./examples) folder for module usage with actual input data.
5656

5757
## External Dependencies
5858

59-
An optional feature, external dependencies are resources managed elsewhere that resources managed by this module may depend on. The following dependencies are supported:
59+
An optional feature, external dependencies are resources managed elsewhere that resources managed by this module depends on. The following dependencies are supported:
6060

61-
- **tags_dependency** – (Optional) A map of objects containing the externally managed tags this module may depend on. All map objects must have the same type and must contain at least an *id* attribute with the tag OCID.
62-
- **compartments_dependency** – (Optional) A map of objects containing the externally managed compartments this module may depend on. All map objects must have the same type and must contain at least an *id* attribute with the tag OCID. This is typically used when using separate configurations for managing compartments.
61+
- **compartments_dependency** – (Optional) A map of objects containing the externally managed compartments this module may depend on. All map objects must have the same type and must contain at least an *id* attribute with the compartment OCID. This mechanism allows for the usage of referring keys (instead of OCIDs) in *default_parent_id* and *parent_id* attributes. The module replaces the keys by the OCIDs provided within *compartments_dependency* map. Contents of *compartments_dependency* is typically the output of a client of this module.
62+
63+
Example:
64+
```
65+
{
66+
"NETWORK-CMP": {
67+
"id": "ocid1.compartment.oc1..aaaaaaaa...7xq"
68+
}
69+
}
70+
```
71+
72+
- **tags_dependency** – (Optional) A map of objects containing the externally managed tags this module may depend on. All map objects must have the same type and must contain at least an *id* attribute with the tag OCID. This mechanism allows for the usage of referring keys (instead of OCIDs) in *tag_id* attribute. The module replaces the keys by the OCIDs provided within *tags_dependency* map. Contents of *tags_dependency* is typically the output of a client of the [Tags module](https://github.com/oracle-quickstart/terraform-oci-cis-landing-zone-governance/tree/main/tags).
73+
74+
Example:
75+
```
76+
{
77+
"COST-CENTER-TAG": {
78+
"id": "ocid1.tag.oc1..aaaaaaaa...8yr"
79+
}
80+
}
81+
```
6382

6483
## Requirements
6584
### IAM Permissions

compartments/SPEC.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ No modules.
3131
| Name | Description | Type | Default | Required |
3232
|------|-------------|------|---------|:--------:|
3333
| <a name="input_compartments_configuration"></a> [compartments\_configuration](#input\_compartments\_configuration) | The compartments configuration. Use the compartments attribute to define your topology. OCI supports compartment hierarchies up to six levels. | <pre>object({<br> default_parent_id = optional(string) # the default parent for all top (first level) compartments. Use parent_id attribute within each compartment to specify different parents.<br> default_defined_tags = optional(map(string)) # applies to all compartments, unless overriden by defined_tags in a compartment object<br> default_freeform_tags = optional(map(string)) # applies to all compartments, unless overriden by freeform_tags in a compartment object<br> enable_delete = optional(bool) # whether or not compartments are physically deleted when destroyed. Default is false.<br> compartments = map(object({<br> name = string<br> description = string<br> parent_id = optional(string)<br> defined_tags = optional(map(string))<br> freeform_tags = optional(map(string))<br> tag_defaults = optional(map(object({<br> tag_id = string,<br> default_value = string,<br> is_user_required = optional(bool)<br> })))<br> children = optional(map(object({<br> name = string<br> description = string<br> defined_tags = optional(map(string))<br> freeform_tags = optional(map(string))<br> tag_defaults = optional(map(object({<br> tag_id = string,<br> default_value = string,<br> is_user_required = optional(bool)<br> })))<br> children = optional(map(object({<br> name = string<br> description = string<br> defined_tags = optional(map(string))<br> freeform_tags = optional(map(string))<br> tag_defaults = optional(map(object({<br> tag_id = string,<br> default_value = string,<br> is_user_required = optional(bool)<br> })))<br> children = optional(map(object({<br> name = string<br> description = string<br> defined_tags = optional(map(string))<br> freeform_tags = optional(map(string))<br> tag_defaults = optional(map(object({<br> tag_id = string,<br> default_value = string,<br> is_user_required = optional(bool)<br> })))<br> children = optional(map(object({<br> name = string<br> description = string<br> defined_tags = optional(map(string))<br> freeform_tags = optional(map(string))<br> tag_defaults = optional(map(object({<br> tag_id = string,<br> default_value = string,<br> is_user_required = optional(bool)<br> })))<br> children = optional(map(object({<br> name = string<br> description = string<br> defined_tags = optional(map(string))<br> freeform_tags = optional(map(string))<br> tag_defaults = optional(map(object({<br> tag_id = string,<br> default_value = string,<br> is_user_required = optional(bool)<br> })))<br> }))) <br> })))<br> })))<br> })))<br> }))) <br> }))<br> })</pre> | `null` | no |
34-
| <a name="input_compartments_dependency"></a> [compartments\_dependency](#input\_compartments\_dependency) | A map of objects containing the externally managed compartments this module may depend on. All map objects must have the same type and must contain at least an 'id' attribute (representing the compartment OCID) of string type. | `map(any)` | `null` | no |
34+
| <a name="input_compartments_dependency"></a> [compartments\_dependency](#input\_compartments\_dependency) | A map of objects containing the externally managed compartments this module may depend on. All map objects must have the same type and must contain an 'id' attribute of string type set with the compartment OCID. See 'External Dependencies' section in README.md for details. | <pre>map(object({<br> id = string<br> }))</pre> | `null` | no |
3535
| <a name="input_derive_keys_from_hierarchy"></a> [derive\_keys\_from\_hierarchy](#input\_derive\_keys\_from\_hierarchy) | Whether identifying keys should be derived from the provided compartments hierarchy | `bool` | `false` | no |
3636
| <a name="input_module_name"></a> [module\_name](#input\_module\_name) | The module name. | `string` | `"iam-compartments"` | no |
37-
| <a name="input_tags_dependency"></a> [tags\_dependency](#input\_tags\_dependency) | A map of objects containing the externally managed tags this module may depend on. All map objects must have the same type and must contain at least an 'id' attribute (representing the tag OCID) of string type. | `map(any)` | `null` | no |
37+
| <a name="input_tags_dependency"></a> [tags\_dependency](#input\_tags\_dependency) | A map of objects containing the externally managed tags this module may depend on. All map objects must have the same type and must contain at least an 'id' attribute (representing the tag OCID) of string type. See 'External Dependencies' section in README.md for details. | <pre>map(object({<br> id = string<br> }))</pre> | `null` | no |
3838
| <a name="input_tenancy_ocid"></a> [tenancy\_ocid](#input\_tenancy\_ocid) | The OCID of the tenancy. | `string` | n/a | yes |
3939

4040
## Outputs

compartments/examples/external-dependency/variables.tf

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -14,80 +14,7 @@ variable "private_key_password" {default = ""}
1414
#-------------------------------------------------------------
1515
variable "compartments_configuration" {
1616
description = "The compartments configuration. Use the compartments attribute to define your topology. OCI supports compartment hierarchies up to six levels."
17-
type = object({
18-
default_parent_id = optional(string) # the default parent for all top (first level) compartments. Use parent_id attribute within each compartment to specify different parents.
19-
default_defined_tags = optional(map(string)) # applies to all compartments, unless overriden by defined_tags in a compartment object
20-
default_freeform_tags = optional(map(string)) # applies to all compartments, unless overriden by freeform_tags in a compartment object
21-
enable_delete = optional(bool) # whether or not compartments are physically deleted when destroyed. Default is false.
22-
compartments = map(object({
23-
name = string
24-
description = string
25-
parent_id = optional(string)
26-
defined_tags = optional(map(string))
27-
freeform_tags = optional(map(string))
28-
tag_defaults = optional(map(object({
29-
tag_id = string,
30-
default_value = string,
31-
is_user_required = optional(bool)
32-
})))
33-
children = optional(map(object({
34-
name = string
35-
description = string
36-
defined_tags = optional(map(string))
37-
freeform_tags = optional(map(string))
38-
tag_defaults = optional(map(object({
39-
tag_id = string,
40-
default_value = string,
41-
is_user_required = optional(bool)
42-
})))
43-
children = optional(map(object({
44-
name = string
45-
description = string
46-
defined_tags = optional(map(string))
47-
freeform_tags = optional(map(string))
48-
tag_defaults = optional(map(object({
49-
tag_id = string,
50-
default_value = string,
51-
is_user_required = optional(bool)
52-
})))
53-
children = optional(map(object({
54-
name = string
55-
description = string
56-
defined_tags = optional(map(string))
57-
freeform_tags = optional(map(string))
58-
tag_defaults = optional(map(object({
59-
tag_id = string,
60-
default_value = string,
61-
is_user_required = optional(bool)
62-
})))
63-
children = optional(map(object({
64-
name = string
65-
description = string
66-
defined_tags = optional(map(string))
67-
freeform_tags = optional(map(string))
68-
tag_defaults = optional(map(object({
69-
tag_id = string,
70-
default_value = string,
71-
is_user_required = optional(bool)
72-
})))
73-
children = optional(map(object({
74-
name = string
75-
description = string
76-
defined_tags = optional(map(string))
77-
freeform_tags = optional(map(string))
78-
tag_defaults = optional(map(object({
79-
tag_id = string,
80-
default_value = string,
81-
is_user_required = optional(bool)
82-
})))
83-
})))
84-
})))
85-
})))
86-
})))
87-
})))
88-
}))
89-
})
90-
default = null
17+
type = any
9118
}
9219

9320
variable "oci_shared_config_bucket_name" {

compartments/examples/vision/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ The same structure as shown by OCI Console:
2121

2222
Refer to [compartment's module README.md](../../README.md) for overall attributes usage.
2323

24-
Note the *freeform_tags* applied to each compartment. **They are not required**, but if defined they are leveraged by [OCI CIS Landing Zone IAM Policies Module](../../../policies/) for deploying template (pre-configured) policies.
24+
*TOP-CMP* defines two tag defaults. *COST-CENTER-TAG-DEFAULT* will automatically apply value "a1" to any resources created in *TOP-CMP* compartment and sub-compartments. *ENVIRONMENT-TAG-DEFAULT* will automatically require that users provide a value when creating resources in *TOP-CMP* compartment and sub-compartments.
2525

26-
*TOP-CMP* defines two tag defaults. *COST-CENTER-TAG-DEFAULT* will automatically apply value "a1" to any resources created in *TOP-CMP* compartment and sub-compartments. *ENVIRONMENT-TAG-DEFAULT* will automatically require that users provide a value when creating resources in *TOP-CMP* compartment and sub-compartments.
26+
**Note**: If the *automation_config* variable is provided, the example writes the compartments output to the specified OCI Object Storage bucket (write permissions are required on the bucket). The example can be easily changed to write the output to a local file instead. The output can be further used by another module that depends on these compartments.
2727

2828
3. In this folder, run the typical Terraform workflow:
2929
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2023, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
data "oci_objectstorage_namespace" "this" {
5+
count = var.automation_config != null ? 1 : 0
6+
compartment_id = var.tenancy_ocid
7+
}
8+
9+
### Writing compartments module output to Object Storage bucket.
10+
resource "oci_objectstorage_object" "this" {
11+
count = var.automation_config != null ? 1 : 0
12+
bucket = var.automation_config.bucket_name
13+
content = jsonencode(module.vision_compartments.compartments)
14+
namespace = data.oci_objectstorage_namespace.this[0].namespace
15+
object = var.automation_config.output_file_name
16+
}

compartments/examples/vision/input.auto.tfvars.template

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ compartments_configuration = {
3838
name = "vision-top-cmp",
3939
description = "Vision Enclosing compartment",
4040
#parent_id = null,
41-
freeform_tags = {
42-
"cislz"="vision",
43-
"cislz-cmp-type"="enclosing"
44-
},
4541
tag_defaults = {
4642
COST-CENTER-TAG-DEFAULT = {
4743
tag_id = "<REPLACE-BY-THE-COST-CENTER-TAG-OCID>"
@@ -58,44 +54,29 @@ compartments_configuration = {
5854
NETWORK-CMP = {
5955
name = "vision-network-cmp",
6056
description = "Vision Network compartment",
61-
freeform_tags = {
62-
"cislz"="vision",
63-
"cislz-cmp-type"="network"
64-
}
6557
},
6658
SECURITY-CMP = {
6759
name = "vision-security-cmp",
6860
description = "Vision Security compartment",
69-
freeform_tags = {
70-
"cislz"="vision",
71-
"cislz-cmp-type"="security"
72-
}
7361
},
7462
APP-CMP = {
7563
name = "vision-application-cmp",
7664
description = "Vision Application compartment",
77-
freeform_tags = {
78-
"cislz"="vision",
79-
"cislz-cmp-type"="application"
80-
}
8165
},
8266
DB-CMP = {
8367
name = "vision-database-cmp",
8468
description = "Vision Database compartment",
85-
freeform_tags = {
86-
"cislz"="vision",
87-
"cislz-cmp-type"="database"
88-
}
8969
},
9070
EXACS-CMP = {
9171
name = "vision-exainfra-cmp",
9272
description = "Vision Exadata Cloud Service compartment",
93-
freeform_tags = {
94-
"cislz"="vision",
95-
"cislz-cmp-type"="exainfra"
96-
}
9773
}
9874
}
9975
}
10076
}
101-
}
77+
}
78+
79+
# automation_config = {
80+
# bucket_name : "<REPLACE-BY-THE-BUCKET-NAME>"
81+
# output_file_name : "vision-compartments.json"
82+
# }

0 commit comments

Comments
 (0)