generated from pulumi/pulumi-tf-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from tencentcloudstack/doc/improvement
doc: add docs for website, optimize existing documents.
- Loading branch information
Showing
78 changed files
with
628 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
--- | ||
title: TencentCloud | ||
meta_desc: Provides an overview of the Tencent Cloud Provider for Pulumi. | ||
layout: overview | ||
--- | ||
|
||
The Tencent Cloud provider for Pulumi can be used to provision any of the cloud resources available in [Tencent Cloud](https://tencentcloud.com). | ||
The Tencent Cloud provider must be configured with credentials to deploy and update resources in Tencent Cloud. | ||
|
||
## Examples | ||
|
||
These examples show how to use multi-language to create a COS Bucket. | ||
|
||
{{< chooser language "javascript,typescript,python,go,csharp" >}} | ||
|
||
{{% choosable language javascript %}} | ||
|
||
```javascript | ||
const tencentcloud = require("@tencentcloud_iac/pulumi"); | ||
|
||
~async function () { | ||
const info = await tencentcloud.user.getInfo(); | ||
const myBucket = new tencentcloud.cos.Bucket("myBucket", { | ||
acl: "private", | ||
bucket: `pulumi-created-${info.appId}`, | ||
}); | ||
}() | ||
|
||
``` | ||
|
||
{{% /choosable %}} {{% choosable language typescript %}} | ||
|
||
```typescript | ||
import * as tencentcloud from "@tencentcloud_iac/pulumi"; | ||
|
||
~async function () { | ||
const info = await tencentcloud.user.getInfo(); | ||
const myBucket = new tencentcloud.cos.Bucket("myBucket", { | ||
acl: "private", | ||
bucket: `pulumi-created-${info.appId}`, | ||
}); | ||
}() | ||
``` | ||
|
||
{{% /choosable %}} {{% choosable language python %}} | ||
|
||
```python | ||
import tencentcloud_iac_pulumi as tencentcloud | ||
|
||
info = tencentcloud.user.get_info() | ||
my_bucket = tencentcloud.cos.Bucket("myBucket", | ||
acl="private", | ||
bucket=f"pulumi-created-{info.app_id}") | ||
|
||
``` | ||
|
||
{{% /choosable %}} {{% choosable language go %}} | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
"github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/cos" | ||
"github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/user" | ||
) | ||
|
||
func main() { | ||
pulumi.Run(func(ctx *pulumi.Context) error { | ||
info, err := user.GetInfo(ctx, nil, nil) | ||
if err != nil { | ||
return err | ||
} | ||
_, err = cos.NewBucket(ctx, "myBucket", &Cos.BucketArgs{ | ||
Acl: pulumi.String("private"), | ||
Bucket: pulumi.String(fmt.Sprintf("%v%v", "pulumi-created-", info.AppId)), | ||
}) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
}) | ||
} | ||
``` | ||
|
||
{{% /choosable %}} {{% choosable language csharp %}} | ||
|
||
```csharp | ||
using Tencentcloud = TencentcloudIAC.PulumiPackage.TencentCloud; | ||
|
||
class MyStack : Stack | ||
{ | ||
public MyStack() | ||
{ | ||
var info = Output.Create(Tencentcloud.User.GetInfo.InvokeAsync()); | ||
var myBucket = new Tencentcloud.Cos.Bucket("myBucket", new Tencentcloud.Cos.BucketArgs | ||
{ | ||
Acl = "private", | ||
Bucket = info.Apply(info => $"pulumi-created-{info.AppId}"), | ||
}); | ||
} | ||
|
||
} | ||
|
||
``` | ||
|
||
{{% /choosable %}} | ||
|
||
{{< /chooser >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: TencentCloud Setup | ||
meta_desc: Provides an overview on how to configure credentials and region for the Pulumi Tencent Cloud Provider | ||
layout: installation | ||
--- | ||
|
||
The Pulumi Tencent Cloud Provider uses Tencent Cloud SDK to manage and provision resources. | ||
|
||
## Installation | ||
|
||
The Tencent Cloud provider is available as a package in the following Pulumi languages: | ||
|
||
- JavaScript/TypeScript: [@tencentcloud_iac/pulumi](https://www.npmjs.com/package/@tencentcloud_iac/pulumi) | ||
- Python: [tencentcloud-iac-pulumi](https://pypi.org/manage/project/tencentcloud-iac-pulumi/releases) | ||
- Go: [github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go](github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go) | ||
- .Net: [TencentCloudIAC.PulumiPackage.Tencentcloud](https://www.nuget.org/packages/TencentCloudIAC.PulumiPackage.Tencentcloud) | ||
|
||
## Configurations | ||
|
||
The following configuration are available for the `tencentcloud` provider: | ||
- `secretId`: (Required) The API Secret ID. | ||
- `secretIKey`: (Required) The API Secret Key. | ||
- `region`: (Required) The region in which to deploy resources. | ||
- `securityToken`: (Optional) The Security Token for temporary access. | ||
|
||
Run `pulumi config set` to configure: | ||
|
||
```bash | ||
pulumi config set tencentcloud:secretId <your_secret_id> --secret | ||
pulumi config set tencentcloud:secretKey <your_secret_key> --secret | ||
pulumi config set tencentcloud:region ap-singapore | ||
|
||
pulumi config set tencentcloud:securityToken <your_security_token_if_needed> --secret | ||
``` | ||
|
||
You can also configure these value by environment variables: | ||
|
||
```bash | ||
export TENCENTCLOUD_SECRET_ID=<your_secret_id> | ||
export TENCENTCLOUD_SECRET_KEY=<your_secret_key> | ||
export TENCENTCLOUD_REGION=ap-singapore | ||
|
||
export TENCENTCLOUD_SECURITY_TOKEN=<your_secret_token_if_needed> | ||
``` |
Oops, something went wrong.