You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-20Lines changed: 68 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,34 +3,82 @@ Purpose: allow execution of Terraform deployment from CloudShell. Multiple “Te
3
3
4
4
Additional workflow recommendation: it is very easy to customize Blueprint setup script that will run the “Deploy Terraform” command on the service, and a similar teardown script that will run the “Destroy Terraform” command – this way the Terraform Module lifecycle is connected to the Sandbox lifecycle.
5
5
6
+
## Content
7
+
* (1) cloudshell-iac-terraform - Python package
8
+
* (2) generic_terraform_service - Main Shell
9
+
* Used in a generic fashion or used to build an extension for a specific purpose (e.g. MsSql)
1. Import Shell(/s) to CloudShell “Shells” screen.
8
15
2. Add Terraform Service to Blueprint/Sandbox.
9
-
3. Configure the different attributes to match the requirement of the deployment.
10
-
*Please see below the documentation per attribute.
11
-
12
-
## Service Attributes
13
-
|Attribute Name|Data Type|Description|
14
-
|:---|:---|:---|
15
-
|Github Terraform Module URL|String|path to target module. Can be provided in three formats: <br/> 1)https://github.com/<ACCOUNT>/<REPO>/tree/<BRANCH>/<PATH_TO_FOLDER> <br/> 2)https://github.com/<ACCOUNT>/<REPO>/blob/<BRANCH>/<PATH_TO_FOLDER>/filename.tf<br/> 3)https://raw.githubusercontent.com/<ACCOUNT>/<REPO>/<BRANCH>/<PATH_TO_FOLDER>/filename.tf |
16
-
|Terraform Version|String|The version of terraform.exe that will be downloaded and used (If not specified latest version will be used)|
17
-
|Github Token|String| Github developer token to be used in order to download TF module|
18
-
|Cloud Provider|String| Reference to the CloudProvider resource that shall be used to create authentication|
19
-
|Branch|String| In case specified will override the branch in the Github Terraform Module URL |
20
-
|Terraform Outputs|String| Used by the system to place the non-sensitive execution outputs|
21
-
|Terraform Sensitive Outputs|String|Used by the system to place the sensitive execution outputs|
22
-
|Terraform Inputs|String|Comma separated values to specify TF inputs (e.g. varname1=varvalue1,varname2=varvalue2...)|
23
-
|Remote State Provider|String|Reference a Remote State provider resource to enable remote state file|
24
-
|Custom Tags|String|Comma separated name=value list to be used in case Auto Tagging is enabled|
25
-
|Apply Tags|Boolean|Specify whether TF resources will be auto-tagged|
26
-
27
-
## Commands
16
+
3. Configure the different attributes to match the requirement of the deployment.</br>
17
+
\* Please see below the documentation per attribute.
18
+
19
+
## Config Object (cloudshell-iac-terraform)
20
+
The shell proivdes a configuration mechanism enabling you to set the behavior of the shell
21
+
The object is 'TerraformShellConfig' and holds the following parameters:
|Github Terraform Module URL|String|path to target module. Can be provided in three formats: <br/> 1)https://github.com/ACCOUNT/REPO/tree/BRANCH/PATH_TO_FOLDER <br/> 2)https://github.com/ACCOUNT/REPO/blob/BRANCH/PATH_TO_FOLDER/FILENAME.tf<br/> 3)https://raw.githubusercontent.com/ACCOUNT/REPO/BRANCH/PATH_TO_FOLDER/FILENAME.tf| Yes |
34
+
|Terraform Version|String|The version of terraform.exe that will be downloaded and used (If not specified latest version will be used)| No |
35
+
|Github Token|String| Github developer token to be used in order to download TF module| Yes |
36
+
|Cloud Provider|String| Reference to the CloudProvider resource that shall be used to create authentication| Yes |
37
+
|Branch|String| In case specified will override the branch in the Github Terraform Module URL | No |
38
+
|Terraform Outputs|String| Used by the system to place the non-sensitive execution outputs| No |
39
+
|Terraform Sensitive Outputs|String|Used by the system to place the sensitive execution outputs| No |
|Remote State Provider|String|Reference a Remote State provider resource to enable remote state file</br> If not specified the statefile will be kept locally and a temp directory will remain present after execution and only removed after successful destroy| No |
42
+
|Custom Tags|String|Comma separated name=value list to be used in case Auto Tagging is enabled| No |
43
+
|Apply Tags|Boolean|Specify whether TF resources will be auto-tagged| N/A|
44
+
\* if required by the tf module
45
+
46
+
## Commands (generic_terraform_service)
28
47
|Command|Description|
29
48
|:-----|:-----|
30
49
|Execute Terraform module| Takes care of the full deployment cycle:<br/>INIT<br/>PLAN<br/>APPLY|
31
50
|Destroy Terraform module|Destroys the Terraform deployment previously done for this module.|
* Sensitive output will encrypted and appear in the UI as bullet dots
74
+
* Logs will not include sensitive data
75
+
* Executions history will not be accessible via Execution Server access
76
+
77
+
### Logging
78
+
79
+
80
+
81
+
34
82
- All of the shell commands are executed using python’s “Sub Process” package on the Execution Server that is running the Shell command.
35
83
- The Terraform Shell can run locally on the execution server – it requires that there’s access from the execution server to the path where Terraform.exe is located and to the path where the Terraform module is located.
36
84
- It is also possible to put the Terraform module on a shared network location (example: \\my-storage-server\terraform\module_name) and grant permission to that storage server to the System account (Host_Name$) of the execution server
0 commit comments