Skip to content

Commit c0f556d

Browse files
committed
doc: add docs for website, optimize existing documents.
1 parent 58bb303 commit c0f556d

File tree

78 files changed

+646
-388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+646
-388
lines changed

README.md

+35-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
# TencentCloud Resource Provider
1+
# Pulumi TencentCloud Resource Provider
22

3-
The TencentCloud Resource Provider lets you manage [TencentCloud](https://cloud.tencent.com/) resources.
3+
The Pulumi TencentCloud Resource Provider lets you manage [TencentCloud](https://www.tencentcloud.com/) resources.
44

55
## Installing
66

7+
### Install tencentcloud provider
8+
9+
The sdks installation will fully support package auto download in the future, but now we recommend downloading manually:
10+
11+
```bash
12+
pulumi plugin install resource tencentcloud --server github://api.github.com/tencentcloudstack
13+
```
14+
715
This package is available for several languages/platforms:
816

917
### Node.js (JavaScript/TypeScript)
@@ -40,11 +48,32 @@ go get github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/...
4048

4149
The following configuration points are available for the `tencentcloud` provider:
4250

43-
- `tencentcloud:secretId` (environment: `TENCENTCLOUD_SECRET_ID`) - the API Secret ID for `tencentcloud`
44-
- `tencentcloud:secretKey` (environment: `TENCENTCLOUD_SECRET_KEY`) - the API Secret Key for `tencentcloud`
45-
- `tencentcloud:region` (environment: `TENCENTCLOUD_REGION`) - the region in which to deploy resources
51+
#### Secret ID
52+
The API Secret ID, read from environment variable `TENCENTCLOUD_SECRET_ID` if not preset.
53+
54+
```bash
55+
pulumi config set tencentcloud:secretId [your-secret-id] --secret
56+
```
57+
#### Secret Key
58+
The API Secret Key, read from environment variable `TENCENTCLOUD_SECRET_KEY` if not preset.
59+
60+
```bash
61+
pulumi config set tencentcloud:secretKey [your-secret-key] --secret
62+
```
63+
64+
#### Region
65+
The region in which to deploy resources, read from environment variable `TENCENTCLOUD_REGION` if not preset.
4666

47-
Run `pulumi config set tencentcloud:*` to configure before applying.
67+
```bash
68+
pulumi config set tencentcloud:region ap-singapore
69+
```
70+
71+
#### Security Token (Optional)
72+
The Security Token for temporary access, read from environment variable `TENCENTCLOUD_SECURITY_TOKEN` if not preset.
73+
74+
```bash
75+
pulumi config set tencentcloud:securityToken [your-security-token] --secret
76+
```
4877

4978
## Reference
5079

docs/_index.md

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: TencentCloud
3+
meta_desc: Provides an overview of the Tencent Cloud Provider for Pulumi.
4+
layout: overview
5+
---
6+
7+
The Tencent Cloud provider for Pulumi can be used to provision any of the cloud resources available in [Tencent Cloud](https://tencentcloud.com).
8+
The Tencent Cloud provider must be configured with credentials to deploy and update resources in Tencent Cloud.
9+
10+
## Examples
11+
12+
These examples show how to use multi-language to create a COS Bucket.
13+
14+
{{< chooser language "javascript,typescript,python,go,csharp" >}}
15+
16+
{{% choosable language javascript %}}
17+
18+
```javascript
19+
const tencentcloud = require("@tencentcloud_iac/pulumi");
20+
21+
~async function () {
22+
const info = await tencentcloud.user.getInfo();
23+
const myBucket = new tencentcloud.cos.Bucket("myBucket", {
24+
acl: "private",
25+
bucket: `pulumi-created-${info.appId}`,
26+
});
27+
}()
28+
29+
```
30+
31+
{{% /choosable %}} {{% choosable language typescript %}}
32+
33+
```typescript
34+
import * as tencentcloud from "@tencentcloud_iac/pulumi";
35+
36+
~async function () {
37+
const info = await tencentcloud.user.getInfo();
38+
const myBucket = new tencentcloud.cos.Bucket("myBucket", {
39+
acl: "private",
40+
bucket: `pulumi-created-${info.appId}`,
41+
});
42+
}()
43+
```
44+
45+
{{% /choosable %}} {{% choosable language python %}}
46+
47+
```python
48+
import tencentcloud_iac_pulumi as tencentcloud
49+
50+
info = tencentcloud.user.get_info()
51+
my_bucket = tencentcloud.cos.Bucket("myBucket",
52+
acl="private",
53+
bucket=f"pulumi-created-{info.app_id}")
54+
55+
```
56+
57+
{{% /choosable %}} {{% choosable language go %}}
58+
59+
```go
60+
package main
61+
62+
import (
63+
"fmt"
64+
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
65+
"github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/cos"
66+
"github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/user"
67+
)
68+
69+
func main() {
70+
pulumi.Run(func(ctx *pulumi.Context) error {
71+
info, err := user.GetInfo(ctx, nil, nil)
72+
if err != nil {
73+
return err
74+
}
75+
_, err = cos.NewBucket(ctx, "myBucket", &Cos.BucketArgs{
76+
Acl: pulumi.String("private"),
77+
Bucket: pulumi.String(fmt.Sprintf("%v%v", "pulumi-created-", info.AppId)),
78+
})
79+
if err != nil {
80+
return err
81+
}
82+
return nil
83+
})
84+
}
85+
```
86+
87+
{{% /choosable %}} {{% choosable language csharp %}}
88+
89+
```csharp
90+
using Tencentcloud = TencentcloudIAC.PulumiPackage.TencentCloud;
91+
92+
class MyStack : Stack
93+
{
94+
public MyStack()
95+
{
96+
var info = Output.Create(Tencentcloud.User.GetInfo.InvokeAsync());
97+
var myBucket = new Tencentcloud.Cos.Bucket("myBucket", new Tencentcloud.Cos.BucketArgs
98+
{
99+
Acl = "private",
100+
Bucket = info.Apply(info => $"pulumi-created-{info.AppId}"),
101+
});
102+
}
103+
104+
}
105+
106+
```
107+
108+
{{% /choosable %}}
109+
110+
{{< /chooser >}}

docs/installation-configuration.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: TencentCloud Setup
3+
meta_desc: Provides an overview on how to configure credentials and region for the Pulumi Tencent Cloud Provider
4+
layout: installation
5+
---
6+
7+
The Pulumi Tencent Cloud Provider uses Tencent Cloud SDK to manage and provision resources.
8+
9+
## Installation
10+
11+
The Tencent Cloud provider is available as a package in the following Pulumi languages:
12+
13+
- JavaScript/TypeScript: [@tencentcloud_iac/pulumi](https://www.npmjs.com/package/@tencentcloud_iac/pulumi)
14+
- Python: [tencentcloud-iac-pulumi](https://pypi.org/manage/project/tencentcloud-iac-pulumi/releases)
15+
- Go: [github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go](github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go)
16+
- .Net: [TencentCloudIAC.PulumiPackage.Tencentcloud](https://www.nuget.org/packages/TencentCloudIAC.PulumiPackage.Tencentcloud)
17+
18+
## Configurations
19+
20+
The following configuration are available for the `tencentcloud` provider:
21+
- `secretId`: (Required) The API Secret ID.
22+
- `secretIKey`: (Required) The API Secret Key.
23+
- `region`: (Required) The region in which to deploy resources.
24+
- `securityToken`: (Optional) The Security Token for temporary access.
25+
26+
Run `pulumi config set` to configure:
27+
28+
```bash
29+
pulumi config set tencentcloud:secretId <your_secret_id> --secret
30+
pulumi config set tencentcloud:secretKey <your_secret_key> --secret
31+
pulumi config set tencentcloud:region ap-singapore
32+
33+
pulumi config set tencentcloud:securityToken <your_security_token_if_needed> --secret
34+
```
35+
36+
You can also configure these value by environment variables:
37+
38+
```bash
39+
export TENCENTCLOUD_SECRET_ID=<your_secret_id>
40+
export TENCENTCLOUD_SECRET_KEY=<your_secret_key>
41+
export TENCENTCLOUD_REGION=ap-singapore
42+
43+
export TENCENTCLOUD_SECURITY_TOKEN=<your_secret_token_if_needed>
44+
```

0 commit comments

Comments
 (0)