Skip to content

Commit 265c3ed

Browse files
authoredDec 1, 2023
Feat/support login mgt (#10)
* tips options demo * add github workflow2 * 0.0.19 * feat: update json * support example and update example json * support login status * support logout * fix login out issue * 1.adjust log out logic. 2.support input region * 0.0.22 * 0.0.23 release * 0.0.23
1 parent 1edac75 commit 265c3ed

27 files changed

+1244
-391
lines changed
 

‎README.md

+53-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
# TencentCloud Terraform
22

3-
The VSCode TIAT(Tencent Infrastructure Automation for Terraform)Terraform extension is designed to increase developer productivity authoring, testing and using Terraform with Tencent Cloud. The extension provides terraform command support, resource graph visualization and CloudShell integration inside VSCode.
3+
The VSCode TIAT(Tencent Infrastructure Automation for Terraform)Terraform extension is designed to improve the efficiency of DevOps when using Terraform with Tencent Cloud. The extension provides TencentCloud Account login, resource explorer, code auto-complete, argument tips, and command support inside VSCode.
44

55
## Features
66

77
This extension supports the following features:
88

9-
- Terraform commands: init, plan, apply, validate, refresh and destroy.
10-
- Auto complete: Autocomplete resource types, parameters, and resource definitions.
11-
- Import resource: display the existing `CVM` resource and then import it as a tf file by [Terraformer](https://github.com/GoogleCloudPlatform/terraformer).
9+
- Login: log in Tencent Cloud with AKSK.
10+
- Terraform Commands: init, plan, apply, and destroy through the VSCode command Palette.
11+
- Auto Complete: provides code suggestions and auto-complete resource types, arguments, and options. Provides ways to go to resource documents.
12+
- Code Snippets/Example: provides a completed example code when typing the specified resource type.
13+
- Import Resource: display the existing `CVM` resource and then import it as a tf file by [Terraformer](https://github.com/GoogleCloudPlatform/terraformer).
1214

1315
*TO-DO(Features to be supported in the future):*
1416
- Visualize: graph the terraform resources and modules.
15-
- Autocomplete: provider code snippets of the specified resource.
16-
- Connect to Tencent Cloud: login to Tencent Cloud and sync your account info(eg: obtain AKSK/Token automatically).
17+
- Autocomplete: provider code snippets explorer of the specified resource.
18+
- Validate: code check under security and compliance.
1719

18-
## Commands
20+
## Quick Start
21+
### 1.Login Tencent Cloud
22+
Provide Log in entry to Tencent Cloud.
23+
![login](./images/readme/login.png)
24+
After logged, you can see your account and detail when hovering the status bar.
25+
![account_status](./images/readme/account_status.png)
1926

27+
### 2.Terraform Commands
2028
Open the Command Palette (`Command`+`Shift`+`P` on macOS and `Ctrl`+`Shift`+`P` on Windows/Linux) and type in one of the following commands:
2129

2230
<table>
@@ -34,38 +42,61 @@ Open the Command Palette (`Command`+`Shift`+`P` on macOS and `Ctrl`+`Shift`+`P`
3442
<li>TencentCloud Terraform: init</li>
3543
<li>TencentCloud Terraform: plan</li>
3644
<li>TencentCloud Terraform: apply</li>
37-
<li>TencentCloud Terraform: validate</li>
3845
<li>TencentCloud Terraform: refresh</li>
3946
<li>TencentCloud Terraform: destroy</li>
4047
</ul>
4148
</td>
4249
<td>
4350
Execute terraform command against the current project workspace.
44-
If run with terminal set to Cloud Shell, will run the command in Cloud Shell.
4551
</td>
4652
</tr>
4753
<tr>
48-
<td>TencentCloud Terraform: visualize(TO-DO)</td>
49-
<td>Create a visual representation of the components of the module and save it in <code>graph.png</code>.</td>
50-
</tr>
51-
<tr>
52-
<td>TencentCloud Terraform: push(TO-DO)</td>
53-
<td>Push workspace files that meet the filter <code>azureTerraform.files</code> setting in your configuration to Cloud Shell.</td>
54-
</tr>
55-
<tr>
56-
<td>TencentCloud Terraform: Execute Test(TO-DO)</td>
57-
<td>
58-
Run one of the following test against the current module using a test container: <br>
54+
<td width="35%">
55+
Login commands:<br>
5956
<ul>
60-
<li>lint: This command will check the formating of the code of the Terraform module.</li>
61-
<li>e2e: This command will deploy the current module with the settings specified in the .tfvars file, verify that the deployment pass the controls and destroy the resources that have been created.</li>
57+
<li>TencentCloud Terraform: Login</li>
58+
<li>TencentCloud Terraform: Logout</li>
6259
</ul>
6360
</td>
61+
<td>
62+
The shortcut of log in and log out with Tencent Cloud.
63+
</td>
6464
</tr>
6565
</tbody>
6666
</table>
6767

6868

69+
### 3.Auto Complete
70+
When you typing the resource type, attribute, and options, there is a suggestions dialog.
71+
#### Resource Type
72+
![auto_complete_resourcetype](./images/readme/auto_complete_resourcetype.png)
73+
#### Attribute
74+
![auto_complete_resourcetype](./images/readme/auto_complete_attr.png)
75+
#### Options(demo)
76+
> NOTE: only support on `tencentcloud_instance` resource.
77+
![auto_complete_resourcetype](./images/readme/auto_complete_attr_options.png)
78+
79+
### 4.Code Snippets/Example
80+
When you typing the `{` after a resource type and name, there is a example suggestions.
81+
![example](./images/readme/example.png)
82+
83+
Press `Enter` to insert the whole example.
84+
85+
### 5.Import Resource(demo)
86+
> NOTE: only support on `tencentcloud_instance` resource.
87+
When you logged into Tencent Cloud Account, you may see the resources under this account.
88+
![import](./images/readme/import.png)
89+
90+
Choose one resource to import it.
91+
After a few minutes, the import resource will be in the `generated` folder.
92+
93+
### 6.Resource definition
94+
When you place the cursor on a resource type, use the `go to definition` (`Command` on macOS) button to jump to this resource document of the terraform provider website.
95+
96+
![doc_definition](./images/readme/doc_definition.png)
97+
Or, put cursor under the resource type, press `Command`.
98+
![doc](./images/readme/doc.png)
99+
69100
## Requirements
70101

71102
This extension requires:

0 commit comments

Comments
 (0)
Please sign in to comment.