Skip to content

Commit f64a054

Browse files
authored
Update Documentation (#21)
- add missing description for outputs - remove uncorrect module version from examples (Issue #18) - fix typo in example/main.tf for iam_dynamic_group module source path (Issue #19) - fix explanation of `enable_delete` argument behaviour in modules/iam-compartment documentation (Issue #20)
1 parent 5f88108 commit f64a054

File tree

11 files changed

+91
-27
lines changed

11 files changed

+91
-27
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ Given a version number MAJOR.MINOR.PATCH:
1111
- MINOR version when adding functionality in a backwards compatible manner,
1212
- PATCH version when making backwards compatible bug fixes.
1313

14+
## [2.0.1] - 2021-02-09
15+
16+
### Fixed
17+
18+
- missing description for outputs
19+
- Remove uncorrect module version from examples (Issue #18)
20+
- typo in examples/main.tf for iam_dynamic_group module source path (Issue #19)
21+
- explanation of `enable_delete` argument behaviour in modules/iam-compartment documentation (Issue #20)
22+
23+
### Changed
24+
25+
- no more version pinning in examples to keep documentation current, but add a note on how to do it for production code.
26+
1427
## [2.0.0] - 2021-01-27
1528

1629
### Added

LICENSE

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
1-
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
1+
Copyright (c) 2018, 2021, Oracle and/or its affiliates.
22

33
This software is dual-licensed to you under the Universal Permissive License (UPL) or Apache License 2.0. See below for license terms. You may choose either license.
44
____________________________
55
The Universal Permissive License (UPL), Version 1.0
6-
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
76

8-
Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both
7+
Subject to the condition set forth below, permission is hereby granted to any
8+
person obtaining a copy of this software, associated documentation and/or data
9+
(collectively the "Software"), free of charge and under any and all copyright
10+
rights in the Software, and any and all patent rights owned or freely
11+
licensable by each licensor hereunder covering either (i) the unmodified
12+
Software as contributed to or provided by such licensor, or (ii) the Larger
13+
Works (as defined below), to deal in both
914

1015
(a) the Software, and
11-
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software (each a "Larger Work" to which the Software is contributed by such licensors),
16+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
17+
one is included with the Software (each a "Larger Work" to which the Software
18+
is contributed by such licensors),
1219

13-
without restriction, including without limitation the rights to copy, create derivative works of, display, perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms.
20+
without restriction, including without limitation the rights to copy, create
21+
derivative works of, display, perform, and distribute the Software and make,
22+
use, sell, offer for sale, import, export, have made, and have sold the
23+
Software and the Larger Work(s), and to sublicense the foregoing rights on
24+
either these or other terms.
1425

1526
This license is subject to the following condition:
27+
The above copyright notice and either this complete permission notice or at
28+
a minimum a reference to the UPL must be included in all copies or
29+
substantial portions of the Software.
30+
31+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37+
SOFTWARE.
1638

17-
The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must be included in all copies or substantial portions of the Software.
18-
19-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20-
39+
____________________________
2140
The Apache Software License, Version 2.0
2241
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2342

@@ -80,4 +99,3 @@ END OF TERMS AND CONDITIONS
8099
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81100
See the License for the specific language governing permissions and
82101
limitations under the License.
83-

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ All resources created by this example can be deleted by using the `terraform des
2525
> terraform init
2626
```
2727

28-
- Inspect what Terraform plans to do before actually doing it:
28+
- Inspect what Terraform plans to do for the next `apply`:
2929

3030
```bash
3131
> terraform plan
3232
```
3333

34-
- If proposed changes are what waas intended, apply the plan to Provision resources on OCI (if not abort the operation and review the configuration):
34+
- If proposed changes are what is intended, apply the current plan to Provision resources on OCI (if not, abort the operation and review the configuration):
3535

3636
```bash
3737
> terraform apply

examples/main.tf

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ provider "oci" {
3939
*/
4040

4141
module "iam_compartment" {
42-
4342
source = "oracle-terraform-modules/iam/oci//modules/iam-compartment"
44-
version = "2.1.1"
43+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
44+
# version = "x.x.x"
4545
tenancy_ocid = var.tenancy_ocid
4646
compartment_id = var.tenancy_ocid # define the parent compartment. Creation at tenancy root if omitted
4747
compartment_name = "tf_example_compartment"
@@ -52,7 +52,8 @@ module "iam_compartment" {
5252

5353
module "iam_subcompartment1" {
5454
source = "oracle-terraform-modules/iam/oci//modules/iam-compartment"
55-
version = "2.1.1"
55+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
56+
# version = "x.x.x"
5657
tenancy_ocid = var.tenancy_ocid
5758
compartment_id = module.iam_compartment.compartment_id # define the parent compartment. Here we make reference to the previous module
5859
compartment_name = "tf_example_subcompartment1"
@@ -63,7 +64,8 @@ module "iam_subcompartment1" {
6364

6465
module "iam_subcompartment2" {
6566
source = "oracle-terraform-modules/iam/oci//modules/iam-compartment"
66-
version = "2.1.1"
67+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
68+
# version = "x.x.x"
6769
tenancy_ocid = var.tenancy_ocid
6870
compartment_id = module.iam_compartment.compartment_id # define the parent compartment. Here we make reference to the previous module
6971
compartment_name = "tf_example_subcompartment2"
@@ -74,7 +76,8 @@ module "iam_subcompartment2" {
7476

7577
module "iam_users" {
7678
source = "oracle-terraform-modules/iam/oci//modules/iam-user"
77-
version = "2.1.1"
79+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
80+
# version = "x.x.x"
7881
tenancy_ocid = var.tenancy_ocid
7982
users = [
8083
{ # user1
@@ -97,7 +100,7 @@ module "iam_users" {
97100

98101
module "iam_group" {
99102
source = "oracle-terraform-modules/iam/oci//modules/iam-group"
100-
version = "2.1.1"
103+
version = "2.0.0"
101104
tenancy_ocid = var.tenancy_ocid
102105
group_name = "tf_example_group"
103106
group_description = "an example group - terraformed"
@@ -112,8 +115,9 @@ module "iam_group" {
112115
}
113116

114117
module "iam_dynamic_group" {
115-
source = "oracle-terraform-modules/iam/oci//modules/iam-group"
116-
version = "2.1.1"
118+
source = "oracle-terraform-modules/iam/oci//modules/iam-dyanmic-group"
119+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
120+
# version = "x.x.x"
117121
tenancy_ocid = var.tenancy_ocid
118122
dynamic_group_name = "tf_example_dynamic_group"
119123
dynamic_group_description = "dynamic group created by terraform"

modules/iam-compartment/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ This [Terraform module](https://www.terraform.io/docs/modules/index.html) allows
44

55
With the `enable_delete` argument (boolean: `true` or `false`), you can control the `terraform destroy` command behavior:
66

7-
- `true`: terraform will only remove the compartment from the configuration (the actual OCI resource is not deleted, only the terraform representation is deleted
8-
- `false`: terraform will actually delete the compartment from OCI.
7+
- `true`: terraform will actually delete the compartment from OCI.
8+
- `false`: terraform will only remove the compartment from the configuration (the actual OCI resource is not deleted, only the terraform representation is deleted
99

1010
Below is the typical module block you should add to your configuration to create a compartment with this module.
1111

12+
**IMPORTANT:** There is no version pinning of modules in the examples to lower documentation maintenance when releasing new module versions. It is a good practice to pin the module version to the exact version you are using in your code so that your infrastructure remains stable and predictible.
13+
1214
```hcl
1315
module "iam_compartment" {
1416
source = "oracle-terraform-modules/iam/oci//modules/iam-compartment"
17+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
18+
# version = "x.x.x"
1519
tenancy_ocid = var.tenancy_ocid
1620
compartment_id = var.tenancy_ocid
1721
compartment_name = "tf_example_compartment"
@@ -29,6 +33,8 @@ The argument `compartment_id` defines the parent compartment of the defined comp
2933
```hcl
3034
module "iam_subcompartment" {
3135
source = "oracle-terraform-modules/iam/oci//modules/iam-compartment"
36+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
37+
# version = "x.x.x"
3238
tenancy_ocid = var.tenancy_ocid
3339
compartment_id = module.iam_compartment.compartment_id
3440
compartment_name = "tf_example_subcompartment"

modules/iam-compartment/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
22

33
output "compartment_id" {
4+
description = "Compartment ocid"
45
// This allows the compartment ID to be retrieved from the resource if it exists, and if not to use the data source.
56
value = var.compartment_create ? element(concat(oci_identity_compartment.this.*.id, list("")), 0) : lookup(local.compartment_ids[0], "id")
67
}
78

89
output "parent_compartment_id" {
10+
description = "Parent Compartment ocid"
911
// This allows the compartment ID to be retrieved from the resource if it exists, and if not to use the data source.
1012
value = var.compartment_create ? element(concat(oci_identity_compartment.this.*.compartment_id, list("")), 0) : lookup(local.parent_compartment_ids[0], "compartment_id")
1113
}
1214

1315
output "compartment_name" {
16+
description = "Compartment name"
1417
value = var.compartment_name
1518
}
1619

1720
output "compartment_description" {
21+
description = "Compartment description"
1822
value = var.compartment_description
1923
}

modules/iam-dynamic-group/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ This [Terraform module](https://www.terraform.io/docs/modules/index.html) define
44

55
* add an OCI IAM policy for this dynamic group. [See How Policies Work](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policies.htm) and [Common Policies](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/commonpolicies.htm) for more information regarding the policy syntax.
66

7+
Below is the typical module block you should add to your configuration to create a compartment with this module.
8+
9+
**IMPORTANT:** There is no version pinning of modules in the examples to lower documentation maintenance when releasing new module versions. It is a good practice to pin the module version to the exact version you are using in your code so that your infrastructure remains stable and predictible.
10+
711
```hcl
812
module "iam_dynamic_group" {
913
source = "oracle-terraform-modules/iam/oci//modules/iam-dynamic-group"
14+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
15+
# version = "x.x.x"
1016
tenancy_ocid = "${var.tenancy_ocid}"
1117
dynamic_group_name = "tf_example_dynamic_group"
1218
dynamic_group_description = "dynamic group created by terraform"
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
22

33
output "dynamic_group_id" {
4+
description = "Dynamic Group ocid"
45
value = var.dynamic_group_create ? element(concat(oci_identity_dynamic_group.this.*.id, list("")), 0) : lookup(local.dynamic_group_ids[0], "id")
56
}
67

78
output "dynamic_group_name" {
9+
description = "Dynamic Group name"
810
value = var.dynamic_group_name
911
}
1012

1113
output "name_ocid" {
1214
value = zipmap(oci_identity_dynamic_group.this[*].name, oci_identity_dynamic_group.this[*].id)
13-
description = "group name and associated OCID"
15+
description = "Dynamic Group name and associated OCID"
1416
}
1517
output "dynamic_group_policy_name" {
18+
description = "Dynamic Group policy name"
1619
value = var.policy_name
1720
}

modules/iam-group/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ This [Terraform module](https://www.terraform.io/docs/modules/index.html) define
55
* add a list of users as member to the created group,
66
* add an OCI IAM policy. [See How Policies Work](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policies.htm) and [Common Policies](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/commonpolicies.htm) for more information regarding the policy syntax.
77

8-
Below is the typical module block you should add to your configuration to create a group with this module.
8+
Below is the typical module block you should add to your configuration to create a compartment with this module.
9+
10+
**IMPORTANT:** There is no version pinning of modules in the examples to lower documentation maintenance when releasing new module versions. It is a good practice to pin the module version to the exact version you are using in your code so that your infrastructure remains stable and predictible.
911

1012
```hcl
1113
module "iam_group" {
1214
source = "oracle-terraform-modules/iam/oci//modules/iam-group"
13-
version = "2.1.1"
15+
# Pinning each module to a specific version is highly advisable. Please adjust and uncomment the line below
16+
# version = "x.x.x"
1417
tenancy_ocid = var.tenancy_ocid # required
1518
group_name = "tf_example_group" # required
1619
group_description = "an example group - terraformed" # required

modules/iam-group/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
22

33
output "group_id" {
4+
description = "Group ocid"
45
value = var.group_create ? element(concat(oci_identity_group.this.*.id, list("")), 0) : lookup(local.group_ids[0], "id")
56
}
67

78
output "group_name" {
9+
description = "Group name"
810
value = var.group_name
911
}
1012

@@ -14,9 +16,11 @@ output "name_ocid" {
1416
}
1517

1618
output "group_description" {
19+
description = "Group description"
1720
value = var.group_description
1821
}
1922

2023
output "group_policy_name" {
24+
description = "Group policy name"
2125
value = var.policy_name
2226
}

0 commit comments

Comments
 (0)