Skip to content

Commit e846070

Browse files
committed
added documentation for identity, secret, and secret data child modules
1 parent 3ef1276 commit e846070

File tree

10 files changed

+164
-10
lines changed

10 files changed

+164
-10
lines changed
-839 Bytes
Loading
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Oracle Cloud Foundation Terraform Module - secret-data - quickly read the contents of secrets that already exist
2+
3+
4+
5+
## Table of Contents
6+
1. [Overview](#overview)
7+
1. [Deliverables](#deliverables)
8+
1. [Architecture](#Architecture-Diagram)
9+
1. [Executing Instructions](#instructions)
10+
1. [Documentation](#documentation)
11+
1. [The Team](#team)
12+
1. [Feedback](#feedback)
13+
1. [Known Issues](#known-issues)
14+
15+
16+
## <a name="overview"></a>Overview
17+
This module allows you to quickly read OCI secrets that already exists in your tenancy. It will handle the data decoding and give you back the contents in a key-value map.
18+
19+
20+
## <a name="deliverables"></a>Deliverables
21+
This folder contains several deliverables:
22+
- A terraform child module that gets the contents from existing secrets
23+
- an example parent module that uses the child module to retrieve a single secret
24+
25+
26+
## <a name="architecture"></a>Architecture-Diagram
27+
<brief introduction to arch diagram. update link to where your image lives. default is in the documentation folder>
28+
29+
![](./documentation/secret_data_module_pattern.png)
30+
31+
## <a name="instructions"></a>Executing Instructions
32+
33+
## Prerequisites
34+
The executor of this stack will need permissions to read secrets and secret bundles. Additionally, there will need to be at least one existing secret to read from
35+
36+
## Deployment
37+
This module is a child module and can't be run directly. It needs a parent module to call this module to run. See the examples folder for example parent modules that call this submodule
38+
39+
### source type
40+
github url with path and git tag is recommended for production code. local path is used for sub-module development and customization
41+
- github url - make sure to update the version tag to latest stable git tag version for initial deployment. If already deployed and you want to update the version, you need to validate that the new child module version works with your codebase and doesn't create dangerous resource changes, deletions, or creations
42+
```
43+
source = https://github.com/oracle-devrel/terraform-oci-oracle-cloud-foundation//cloud-foundation/modules/cloud-foundation-library/secret-data/module?ref=v1.2.0
44+
```
45+
- local path - this should be used if you are customizing the module. The actual path will need to be updated to where your child module resides relative to your parent module.
46+
```
47+
source = "../../module"
48+
```
49+
50+
## Resources Created
51+
52+
This module does not create any resources. It just retrieves data from existing infrastructure
53+
54+
### Secret Contents
55+
The "secret_ocids" variable accepts a map of strings. The key is used for reference and will map to the key of the "contents" output variable. The string value should be the ocid of the secret you want to retrieve. The secret contents will be decoded and placed in the "contents" output variable.
56+
57+
### vault and key
58+
The first secret in the map will additionally be used to return the vault and key used to encrypt it. This allows you to quickly turn around and create your own secret to share information about your stack to others.
59+
60+
61+
## <a name="documentation"></a>Documentation
62+
63+
<link to official oci documentation for the resources you create>
64+
65+
[Vault Overview](https://docs.oracle.com/en-us/iaas/Content/KeyManagement/Concepts/keyoverview.htm)
66+
67+
## <a name="team"></a>The Team
68+
- **Owners**: [JB Anderson](https://github.com/JBAnderson5)
69+
70+
## <a name="feedback"></a>Feedback
71+
We welcome your feedback. To post feedback, submit feature ideas or report bugs, please use the Issues section on this repository.
72+
73+
## <a name="known-issues"></a>Known Issues
74+
**At the moment, there are no known issues**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile host="app.diagrams.net" modified="2022-06-22T23:06:34.397Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36" etag="BvIIzN9VZePLoHi3VUql" version="18.2.0" type="device"><diagram id="UgEwujfaN0rQrrYDC2Rh" name="EBS: V2 Single VCN">7Vvrd6JKEv9r5uPkNK88PqoYQ64NMWIMflN0EETJCobHX79V1Y1C3JiZvXPv2T27uecepOluquv5qyrmm9bbFoP9/G3Nk+Uq/qayZfFNM7+pqqpoGlxwpBQjN5oiBoJ9uBRDjYFxWK3kIJOjh3C5SlsTsySJs/CtPegnu93Kz1pj8/0+ydvTfiRx+61v82B1NjD25/H56DRcZmsxemuw0/jDKgzW9ZsVJp9s5/VkOZCu58skbwxp/W9ab58kmfi1LXqrGJlX80Wsu//k6ZGw/WqX/cyCqjOel6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Pap17jqhzTunzhCrmZM/UsdiIK8kf03hIs0k/8Auj+1Zqe5k+/GLDwnPrtvAxFfAIbDhQha/yEVqrqMMNPeItPmsJ2K9PnVey9ynyk5NPgP1gX/w6R/gzXvlYuqlsjcsx1GUvpbEyp7Gf4KfQTbIpGWuoRMO1k14BTybop7Ent0HbM4Wtwm/y355BvgTLUdixHgtZYteEeo8Yr7CHdfyahRJgw6au9USVPqMQySrKBksEneqyXfjYT0u5jNnIG9AL9Mclfp0ken7kk8sX6rh3sMQl9scuFJY2MEUC2VO5SvFK+nps9zMxrn/CIONjp0UlfiJe6NUlG0yLRElIJL2cCT/lCT8rv2Rx6MuAfiG+AHkRMTiiWFWQ/iL91Gm7mGRH8mu3XHaGEF9gSoZfCKEvVcQXbS+y8zRi4gs46niJr9wo/Zy5okPfF50/+iJA3qNP3/1ndJPUj99kG/r5l7u3vyVdg9vTvx4S31Wf/g2W1v8n</diagram></mxfile>
17.3 KB
Loading

cloud-foundation/modules/cloud-foundation-library/secret-data/examples/just-secret/terraform.tfvars

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

cloud-foundation/modules/cloud-foundation-library/secret-data/module/secret-data.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ variable "load_from_secrets" {
1212
variable "secret_ocids"{
1313
type = map(string)
1414
default = {}
15-
description = "a map of objects where key is used for output reference. the ocid inside should refer to a secret's ocid"
15+
description = "a map of strings where key is used for output reference. the ocid inside should refer to a secret's ocid"
1616
}
1717

1818

@@ -50,6 +50,8 @@ output "key" {
5050
description = "the ocid of the key that encrypted this secret"
5151
}
5252

53+
# TODO: should we also return the compartment the secret was created in?
54+
5355
# logic
5456

5557

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Oracle Cloud Foundation Terraform Module - secret - quickly create OCI secrets and the underlying vault resources if necessary
2+
3+
4+
5+
## Table of Contents
6+
1. [Overview](#overview)
7+
1. [Deliverables](#deliverables)
8+
1. [Architecture](#Architecture-Diagram)
9+
1. [Executing Instructions](#instructions)
10+
1. [Documentation](#documentation)
11+
1. [The Team](#team)
12+
1. [Feedback](#feedback)
13+
1. [Known Issues](#known-issues)
14+
15+
16+
## <a name="overview"></a>Overview
17+
This module allows you to quickly create OCI secrets by just passing in the data in a simple and flexibe json format. It will handle the data encoding for you and also create a vault and AES key if required. It will also create new secret versions whenever the secret contents change.
18+
19+
20+
## <a name="deliverables"></a>Deliverables
21+
This folder contains several deliverables:
22+
- A terraform child module that creates the secret and vault resources
23+
- an example parent module that uses the child module to create secrets.
24+
- three secret content types are shown: string, list, and map
25+
- vault and key options are also shown: provide an existing vault and key or omit and they will be created
26+
- ability to pass in one or multiple secrets into the same module is also shown
27+
28+
29+
## <a name="architecture"></a>Architecture-Diagram
30+
<brief introduction to arch diagram. update link to where your image lives. default is in the documentation folder>
31+
32+
![](./documentation/secret_module_pattern.png)
33+
34+
## <a name="instructions"></a>Executing Instructions
35+
36+
## Prerequisites
37+
The executor of this stack will need manage permissions and quotas to create secrets. They will also need manage access to create vaults and keys if they do not use an existing vault and key. Otherwise they will need use access to vaults and keys
38+
39+
## Deployment
40+
This module is a child module and can't be run directly. It needs a parent module to call this module to run. See the examples folder for example parent modules that call this submodule
41+
42+
### source type
43+
github url with path and git tag is recommended for production code. local path is used for sub-module development and customization
44+
- github url - make sure to update the version tag to latest stable git tag version for initial deployment. If already deployed and you want to update the version, you need to validate that the new child module version works with your codebase and doesn't create dangerous resource changes, deletions, or creations
45+
```
46+
source = https://github.com/oracle-devrel/terraform-oci-oracle-cloud-foundation//cloud-foundation/modules/cloud-foundation-library/secret/module?ref=v1.2.0
47+
```
48+
- local path - this should be used if you are customizing the module. The actual path will need to be updated to where your child module resides relative to your parent module.
49+
```
50+
source = "../../module"
51+
```
52+
53+
## Resources Created
54+
55+
The "compartment" variable takes in a compartment ocid and is used to determine what compartment to create the resources in. If you are using an existing vault and/or key, your secret should live in the same compartment.
56+
57+
### Vault
58+
The "existing_vault" variable takes in an optional ocid of an existing vault. If none is provided, a new vault will be created using the "vault_name" and "vault_type" variables. The vault name should be customized to make logical sense to your company. The vault type defaults to the DEFAULT vault type. If stronger isolation is required, you can also use the VIRTUAL_PRIVATE vault type.
59+
60+
### Key
61+
The "existing_AES_key" variable takes in an optional ocid of an existing vault. If none is provided, a new key is created using the "AES_key_name" and "AES_key_length" variabes. The default key length is 32 Bytes (256 bits). Shorter keys with 16 Bytes (128 bits ) or 24 Bytes (192 bits) are available.
62+
63+
If an existing key is provided, the vault it lives in must also be specified with the "existing_vault" variable. However, you can specify a new key in an existing vault or a new vault.
64+
65+
### Secret
66+
The "secrets" variable is a map of a custom secret object. Each entry in the map will create a secret. The keys in the map will be the names used for the secret and also used as the key in the secrets output variabe. The values of the map are a custom object with two fields currently. The "contents" field should contain the data you want encrypted in the secret. The "description" field should contain helpful information that does not need to be encrypted like what the secret contains or how to use it.
67+
68+
Note: while the contents field accepts any valid terraform variable type including complex types, the same type is required for each module call. I.E. creating two secrets with different content formats (string and list) requires two module calls
69+
70+
71+
## <a name="documentation"></a>Documentation
72+
73+
<link to official oci documentation for the resources you create>
74+
75+
[Vault Overview](https://docs.oracle.com/en-us/iaas/Content/KeyManagement/Concepts/keyoverview.htm)
76+
77+
## <a name="team"></a>The Team
78+
- **Owners**: [JB Anderson](https://github.com/JBAnderson5)
79+
80+
## <a name="feedback"></a>Feedback
81+
We welcome your feedback. To post feedback, submit feature ideas or report bugs, please use the Issues section on this repository.
82+
83+
## <a name="known-issues"></a>Known Issues
84+
**At the moment, there are no known issues**

0 commit comments

Comments
 (0)