Skip to content

Commit 78ab79e

Browse files
committed
first draft
1 parent a2f9bf5 commit 78ab79e

2 files changed

Lines changed: 36 additions & 5 deletions

File tree

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
1-
# CloudShell Terraform Shell
2-
TBD
1+
# CloudShell-Terraform-Shell
2+
Purpose: allow execution of Terraform deployment from CloudShell. Multiple “Terraform Service” services can be added to a Blueprint or Sandbox, and these can be executed from CloudShell Portal UI by the user that is reserving the Blueprint.
3+
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+
6+
## Shell Usage Instructions
7+
1. Import Shell to CloudShell “Shells” screen.
8+
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) <br/> 2) <br/> 3) |
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
28+
|Command|Description|
29+
|:-----|:-----|
30+
|Execute Terraform module| Takes care of the full deployment cycle:<br/>INIT<br/>PLAN<br/>APPLY|
31+
|Destroy Terraform module|Destroys the Terraform deployment previously done for this module.|
32+
33+
## Additional Notes
34+
- All of the shell commands are executed using python’s “Sub Process” package on the Execution Server that is running the Shell command.
35+
- 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+
- 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
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<Driver Description="Describe the purpose of your CloudShell shell" MainClass="driver.GenericTerraformServiceDriver"
22
Name="GenericTerraformServiceDriver" Version="1.0.0" PythonVersion="3">
33
<Layout>
4-
<Command Description="Deploy Terraform module." Name="run_terraform" DisplayName="Deploy Terraform"/>
54
<Command Description="Execute Terraform module." Name="execute_terraform" DisplayName="Execute Terraform"/>
65
<Command Description="Destroy Terraform module." Name="destroy_terraform" DisplayName="Destroy Terraform"/>
7-
<Command Description="Plan Terraform deployment." Name="plan_terraform" DisplayName="Plan Terraform"/>
8-
<Command Description="Get Terraform state." Name="show_terraform_state" DisplayName="Show Terraform State"/>
96
</Layout>
107
</Driver>

0 commit comments

Comments
 (0)