terraform
Module that contains terraform related functions.
create_tf_files(config, target_path)
Create Terraform files (iam-bindings) based on user-specified resource configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
IAMBindingConfig
|
IAMBindingConfig collected from user that specifies which resources to generate Terraform IAM bindings for |
required |
target_path |
str
|
Path to the (temporary) git repo where the tf files should be written |
required |
Returns:
Type | Description |
---|---|
Dict[str, str]
|
An IAMBindingConfig (filename -> tf file content) |
Source code in dapla_team_cli/tf/iam_bindings/terraform.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
get_bucket_module_name(shortname, env, name)
Get name of the iam module for the given group, environment and bucket.
Source code in dapla_team_cli/tf/iam_bindings/terraform.py
55 56 57 |
|
get_iam_module_name(shortname, environment)
Get name of iam-bindings module for the given auth group and environment.
Source code in dapla_team_cli/tf/iam_bindings/terraform.py
50 51 52 |
|
get_module(modules, module_name)
Return the module asked for, or return None.
Source code in dapla_team_cli/tf/iam_bindings/terraform.py
60 61 62 63 64 65 66 |
|
get_old_bindings(hcl_object, module_name)
Get already-existing bindings, so that we can avoid overwriting them.
Source code in dapla_team_cli/tf/iam_bindings/terraform.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
module_regex(module_name)
Returns regex to match a Terraform module block.
Source code in dapla_team_cli/tf/iam_bindings/terraform.py
85 86 87 |
|
write_tf_files(config, target_path)
Produce and write terraform files to target_path
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
IAMBindingConfig
|
user supplied configuration |
required |
target_path |
str
|
The path to write files to |
required |
Returns:
Type | Description |
---|---|
List[Any]
|
a list of terraform files that was written |
Source code in dapla_team_cli/tf/iam_bindings/terraform.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|