Skip to content

Commit fcd8958

Browse files
authored
Merge pull request #17 from tencentcloudstack/doc/improvement
doc: add docs for website, optimize existing documents.
2 parents 91c21ed + 0514d7a commit fcd8958

File tree

78 files changed

+628
-396
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

+628
-396
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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

77
### Install tencentcloud provider
88

9-
The sdks installation will fully support package auto download in the future, now we recommend downloading manually:
9+
The sdks installation will fully support package auto download in the future, but now we recommend downloading manually:
1010

1111
```bash
1212
pulumi plugin install resource tencentcloud --server github://api.github.com/tencentcloudstack
@@ -51,24 +51,27 @@ The following configuration points are available for the `tencentcloud` provider
5151
#### Secret ID
5252
The API Secret ID, read from environment variable `TENCENTCLOUD_SECRET_ID` if not preset.
5353

54-
$ pulumi config set tencentcloud:secretId [your-secret-id] --secret
55-
54+
```bash
55+
pulumi config set tencentcloud:secretId [your-secret-id] --secret
56+
```
5657
#### Secret Key
5758
The API Secret Key, read from environment variable `TENCENTCLOUD_SECRET_KEY` if not preset.
5859

59-
$ pulumi config set tencentcloud:secretKey [your-secret-key] --secret
60-
61-
#### Security Token
62-
The Security Token for temporary access, read from environment variable `TENCENTCLOUD_SECURITY_TOKEN` if not preset.
63-
64-
$ pulumi config set tencentcloud:securityToken [your-security-token] --secret
60+
```bash
61+
pulumi config set tencentcloud:secretKey [your-secret-key] --secret
62+
```
6563

6664
#### Region
6765
The region in which to deploy resources, read from environment variable `TENCENTCLOUD_REGION` if not preset.
6866

69-
$ pulumi config set tencentcloud:region ap-singapore
67+
```bash
68+
pulumi config set tencentcloud:region ap-singapore
69+
```
7070

71+
#### Security Token (Optional)
72+
The Security Token for temporary access, read from environment variable `TENCENTCLOUD_SECURITY_TOKEN` if not preset.
7173

72-
## Reference
74+
```bash
75+
pulumi config set tencentcloud:securityToken [your-security-token] --secret
76+
```
7377

74-
For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/tencentcloud/api-docs/).

docs/_index.md

Lines changed: 110 additions & 0 deletions
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

Lines changed: 44 additions & 0 deletions
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)