Skip to content

Commit 1ea52a4

Browse files
Merge 'feat/ykf/sso' into 'main'
feat:v0.0.21 publish See merge request: !29
2 parents 6226a5d + 64fcc31 commit 1ea52a4

File tree

24 files changed

+480
-29
lines changed

24 files changed

+480
-29
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ PULUMI_MISSING_DOCS_ERROR := false
1717

1818
# Override during CI using `make [TARGET] PROVIDER_VERSION=""` or by setting a PROVIDER_VERSION environment variable
1919
# Local & branch builds will just used this fixed default version unless specified
20-
PROVIDER_VERSION ?= 0.0.20
20+
PROVIDER_VERSION ?= 0.0.21
2121

2222
# Check version doesn't start with a "v" - this is a common mistake
2323
ifeq ($(shell echo $(PROVIDER_VERSION) | cut -c1),v)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ provider configuration:
4747

4848
- `accessKey` (String) The Access Key for Volcengine Provider. It must be provided, but it can also be sourced from the `VOLCENGINE_ACCESS_KEY` environment variable
4949
- `secretKey` (String) he Secret Key for Volcengine Provider. It must be provided, but it can also be sourced from the `VOLCENGINE_SECRET_KEY` environment variable
50+
- `profile` (String) The Profile for Volcengine Provider. It can be used as an alternative authentication method to AK/SK, and can also be sourced from the `VOLCENGINE_PROFILE` environment variable
51+
- `file_path` (String) The File Path for Volcengine Provider. It specifies the path to the profile configuration file. If not specified, the default path `~/.volcengine` will be used, and can also be sourced from the `VOLCENGINE_FILE_PATH` environment variable
5052
- `assumeRole` (Attributes) An `assume_role` block (documented below). Only one `assume_role` block may be in the configuration. (see [below for nested schema](#nestedatt--assume_role))
5153
- `customerHeaders` (String) CUSTOMER HEADERS for Volcengine Provider. The customer_headers field uses commas (,) to separate multiple headers, and colons (:) to separate each header key from its corresponding value.
5254
- `disableSsl` (Boolean) Disable SSL for Volcengine Provider

docs/_index.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ import {ProviderEndpoints} from "../pulumi-volcenginecc/sdk/nodejs/types/input";
5656
const provider = new ve.Provider("volcengine-provider", {
5757
region: "cn-beijing", // REGION
5858
accessKey: "", // ACCESSKEY
59+
filePath: "", // if empty, default path is ~/.volcengine
60+
profile: "", //Profile name in filePath
5961
secretKey: "", // SECRET_ACCESS_KEY
6062
endpoints: {
6163
cloudcontrolapi: "cloudcontrol.cn-beijing.volcengineapi.com"
@@ -68,17 +70,17 @@ const user = new ve.iam.User("pulumi-node-user", {
6870
displayName: "pulumi-nodejs-display", // Optional
6971
groups: ["ccapi-test"], // Optional
7072
policies: [ // Optional
71-
{ policyName: "ReadOnlyAccess", policyType: "System" },
72-
{ policyName: "TOSReadOnlyAccess", policyType: "System" },
73-
{ policyName: "VPCFullAccess", policyType: "System" },
74-
{ policyName: "IAMFullAccess", policyType: "System" },
73+
{policyName: "ReadOnlyAccess", policyType: "System"},
74+
{policyName: "TOSReadOnlyAccess", policyType: "System"},
75+
{policyName: "VPCFullAccess", policyType: "System"},
76+
{policyName: "IAMFullAccess", policyType: "System"},
7577

7678
],
7779
tags: [ // Optional
78-
{ key: "env", value: "dev" },
79-
{ key: "team", value: "backend" },
80+
{key: "env", value: "dev"},
81+
{key: "team", value: "backend"},
8082
],
81-
}, { provider });
83+
}, {provider});
8284
```
8385
{{% /choosable %}}
8486
{{% choosable language python %}}
@@ -157,6 +159,8 @@ return await Deployment.RunAsync(() =>
157159
{
158160
AccessKey = "",
159161
SecretKey = "",
162+
Profile = "", //Profile name in filePath
163+
FilePath = "", // if empty, default path is ~/.volcengine
160164
Region = "cn-beijing",
161165
Endpoints =new ProviderEndpointsArgs
162166
{
@@ -226,6 +230,8 @@ func main() {
226230
prov, err := myprovider.NewProvider(ctx, "pulumi", &myprovider.ProviderArgs{
227231
AccessKey: pulumi.String(""),
228232
SecretKey: pulumi.String("=="),
233+
Profile: pulumi.String(""), //Profile name in filePath
234+
FilePath: pulumi.String(""), // if empty, default path is ~/.volcengine
229235
Region: pulumi.String("cn-beijing"),
230236
Endpoints: &myprovider.ProviderEndpointsArgs{
231237
Cloudcontrolapi: pulumi.String("cloudcontrol.cn-beijing.volcengineapi.com"),
@@ -326,6 +332,8 @@ public class App {
326332
Provider volcenginecc = new Provider("volcenginecc", ProviderArgs.builder()
327333
.accessKey("")
328334
.secretKey("")
335+
.profile("") //Profile name in filePath
336+
.filePath("") // if empty, default path is ~/.volcengine
329337
.region("cn-beijing")
330338
.endpoints(ProviderEndpointsArgs.builder()
331339
.cloudcontrolapi("cloudcontrol.cn-beijing.volcengineapi.com")
@@ -368,7 +376,7 @@ The following methods are supported, in this order, and explained below:
368376

369377
### Static credentials
370378

371-
Static credentials can be provided by adding `accessKey`, `secretKey` and `region` in-line in the
379+
Static credentials can be provided by adding `accessKey`, `secretKey`, `profile`, `filePath` and `region` in-line in the
372380
volcengine provider configuration:
373381

374382
Usage:
@@ -384,12 +392,16 @@ config:
384392
value: 'TODO: var.region'
385393
volcengine:secretKey:
386394
value: 'TODO: var.secret_key'
395+
volcengine:profile:
396+
value: 'TODO: var.profile'
397+
volcengine:filePath:
398+
value: 'TODO: var.file_path'
387399

388400
```
389401

390402
### Environment variables
391403

392-
You can provide your credentials via `VOLCENGINE_ACCESS_KEY`, `VOLCENGINE_SECRET_KEY` environment variables. The Region can be set using the `VOLCENGINE_REGION` environment variables.
404+
You can provide your credentials via VOLCENGINE_ACCESS_KEY and VOLCENGINE_SECRET_KEY environment variables, representing your volcengine public key and private key respectively. VOLCENGINE_REGION, VOLCENGINE_PROFILE, and VOLCENGINE_FILE_PATH are also used, if applicable:
393405

394406
Usage:
395407
```yaml
@@ -403,6 +415,8 @@ runtime:
403415
$ export VOLCENGINE_ACCESS_KEY="<Your-Access-Key-ID>"
404416
$ export VOLCENGINE_SECRET_KEY="<Your-Access-Key-Secret>"
405417
$ export VOLCENGINE_REGION="cn-beijing"
418+
$ export VOLCENGINE_PROFILE="your_profile"
419+
$ export VOLCENGINE_FILE_PATH="your_file_path" # if empty, default path is ~/.volcengine
406420
$ pulumi preview
407421
```
408422

@@ -416,6 +430,8 @@ provider configuration:
416430

417431
- `accessKey` (String) The Access Key for Volcengine Provider. It must be provided, but it can also be sourced from the `VOLCENGINE_ACCESS_KEY` environment variable
418432
- `secretKey` (String) he Secret Key for Volcengine Provider. It must be provided, but it can also be sourced from the `VOLCENGINE_SECRET_KEY` environment variable
433+
- `profile` (String) The Profile for Volcengine Provider. It can be used as an alternative authentication method to AK/SK, and can also be sourced from the `VOLCENGINE_PROFILE` environment variable
434+
- `file_path` (String) The File Path for Volcengine Provider. It specifies the path to the profile configuration file. If not specified, the default path `~/.volcengine` will be used, and can also be sourced from the `VOLCENGINE_FILE_PATH` environment variable
419435
- `assumeRole` (Attributes) An `assume_role` block (documented below). Only one `assume_role` block may be in the configuration. (see [below for nested schema](#nestedatt--assume_role))
420436
- `customerHeaders` (String) CUSTOMER HEADERS for Volcengine Provider. The customer_headers field uses commas (,) to separate multiple headers, and colons (:) to separate each header key from its corresponding value.
421437
- `disableSsl` (Boolean) Disable SSL for Volcengine Provider

provider/cmd/pulumi-resource-volcenginecc/schema.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,24 @@
9191
"$ref": "#/types/volcenginecc:config/endpoints:endpoints",
9292
"description": "An `endpoints` block (documented below). Only one `endpoints` block may be in the configuration.\n"
9393
},
94+
"filePath": {
95+
"type": "string",
96+
"description": "The file path for Volcengine Provider configuration. It can be sourced from the `VOLCENGINE_FILE_PATH` environment\nvariable\n",
97+
"defaultInfo": {
98+
"environment": [
99+
"VOLCENGINE_FILE_PATH"
100+
]
101+
}
102+
},
103+
"profile": {
104+
"type": "string",
105+
"description": "The profile for Volcengine Provider. It can be sourced from the `VOLCENGINE_PROFILE` environment variable\n",
106+
"defaultInfo": {
107+
"environment": [
108+
"VOLCENGINE_PROFILE"
109+
]
110+
}
111+
},
94112
"proxyUrl": {
95113
"type": "string",
96114
"description": "PROXY URL for Volcengine Provider\n",
@@ -24861,6 +24879,14 @@
2486124879
"$ref": "#/types/volcenginecc:index/ProviderEndpoints:ProviderEndpoints",
2486224880
"description": "An `endpoints` block (documented below). Only one `endpoints` block may be in the configuration.\n"
2486324881
},
24882+
"filePath": {
24883+
"type": "string",
24884+
"description": "The file path for Volcengine Provider configuration. It can be sourced from the `VOLCENGINE_FILE_PATH` environment\nvariable\n"
24885+
},
24886+
"profile": {
24887+
"type": "string",
24888+
"description": "The profile for Volcengine Provider. It can be sourced from the `VOLCENGINE_PROFILE` environment variable\n"
24889+
},
2486424890
"proxyUrl": {
2486524891
"type": "string",
2486624892
"description": "PROXY URL for Volcengine Provider\n"
@@ -24910,6 +24936,24 @@
2491024936
"$ref": "#/types/volcenginecc:index/ProviderEndpoints:ProviderEndpoints",
2491124937
"description": "An `endpoints` block (documented below). Only one `endpoints` block may be in the configuration.\n"
2491224938
},
24939+
"filePath": {
24940+
"type": "string",
24941+
"description": "The file path for Volcengine Provider configuration. It can be sourced from the `VOLCENGINE_FILE_PATH` environment\nvariable\n",
24942+
"defaultInfo": {
24943+
"environment": [
24944+
"VOLCENGINE_FILE_PATH"
24945+
]
24946+
}
24947+
},
24948+
"profile": {
24949+
"type": "string",
24950+
"description": "The profile for Volcengine Provider. It can be sourced from the `VOLCENGINE_PROFILE` environment variable\n",
24951+
"defaultInfo": {
24952+
"environment": [
24953+
"VOLCENGINE_PROFILE"
24954+
]
24955+
}
24956+
},
2491324957
"proxyUrl": {
2491424958
"type": "string",
2491524959
"description": "PROXY URL for Volcengine Provider\n",

provider/go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ require (
158158
github.com/ulikunitz/xz v0.5.11 // indirect
159159
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
160160
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
161-
github.com/volcengine/terraform-provider-volcenginecc v0.0.27 // indirect
161+
github.com/volcengine/terraform-provider-volcenginecc v0.0.28 // indirect
162162
github.com/volcengine/volc-sdk-golang v1.0.23 // indirect
163-
github.com/volcengine/volcengine-go-sdk v1.1.18 // indirect
163+
github.com/volcengine/volcengine-go-sdk v1.2.12 // indirect
164164
github.com/xanzy/ssh-agent v0.3.3 // indirect
165165
github.com/yuin/goldmark v1.7.4 // indirect
166166
github.com/zclconf/go-cty v1.16.2 // indirect
@@ -194,5 +194,3 @@ require (
194194
gopkg.in/yaml.v3 v3.0.1 // indirect
195195
lukechampine.com/frand v1.4.2 // indirect
196196
)
197-
198-
replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20250221232320-8d4cfd37a3cd

provider/go.sum

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T
573573
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
574574
github.com/hashicorp/terraform-plugin-sdk v1.7.0 h1:B//oq0ZORG+EkVrIJy0uPGSonvmXqxSzXe8+GhknoW0=
575575
github.com/hashicorp/terraform-plugin-sdk v1.7.0/go.mod h1:OjgQmey5VxnPej/buEhe+YqKm0KNvV3QqU4hkqHqPCY=
576+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 h1:NFPMacTrY/IdcIcnUB+7hsore1ZaRWU9cnB6jFoBnIM=
577+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0/go.mod h1:QYmYnLfsosrxjCnGY1p9c7Zj6n9thnEE+7RObeYs3fA=
576578
github.com/hashicorp/terraform-plugin-testing v1.13.1 h1:0nhSm8lngGTggqXptU4vunFI0S2XjLAhJg3RylC5aLw=
577579
github.com/hashicorp/terraform-plugin-testing v1.13.1/go.mod h1:b/hl6YZLm9fjeud/3goqh/gdqhZXbRfbHMkEiY9dZwc=
578580
github.com/hashicorp/terraform-registry-address v0.2.5 h1:2GTftHqmUhVOeuu9CW3kwDkRe4pcBDq0uuK5VJngU1M=
@@ -754,8 +756,6 @@ github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQK
754756
github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k=
755757
github.com/pulumi/terraform-diff-reader v0.0.2 h1:kTE4nEXU3/SYXESvAIem+wyHMI3abqkI3OhJ0G04LLI=
756758
github.com/pulumi/terraform-diff-reader v0.0.2/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ=
757-
github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20250221232320-8d4cfd37a3cd h1:+mioF0kwyl84ufR21U7OThZy001IpzJY9w5dNaxrR5A=
758-
github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20250221232320-8d4cfd37a3cd/go.mod h1:P6o64QS97plG44iFzSM6rAn6VJIC/Sy9a9IkEtl79K4=
759759
github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY=
760760
github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE=
761761
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
@@ -834,12 +834,12 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU
834834
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
835835
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
836836
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
837-
github.com/volcengine/terraform-provider-volcenginecc v0.0.27 h1:6zWO8STo3VgxPEOormtrVhHXUAJAbUHCynGNM4YzaFU=
838-
github.com/volcengine/terraform-provider-volcenginecc v0.0.27/go.mod h1:MiFbOqABmGHSDJnYfTyO03lCBqdozmL+paqUCrKHN9c=
837+
github.com/volcengine/terraform-provider-volcenginecc v0.0.28 h1:eqlIOmlzTTHPEjXkLpfIHpO/P6bIcwrs7qOKGgxLBkA=
838+
github.com/volcengine/terraform-provider-volcenginecc v0.0.28/go.mod h1:pnVLxo7hvzErGTHni4vdzafrgxgGxWwweTJ+E/mmXQk=
839839
github.com/volcengine/volc-sdk-golang v1.0.23 h1:anOslb2Qp6ywnsbyq9jqR0ljuO63kg9PY+4OehIk5R8=
840840
github.com/volcengine/volc-sdk-golang v1.0.23/go.mod h1:AfG/PZRUkHJ9inETvbjNifTDgut25Wbkm2QoYBTbvyU=
841-
github.com/volcengine/volcengine-go-sdk v1.1.18 h1:tVcp1m6R8fgwZFb/MaltrpZY7b2+vYNbmO1MHlDSXIs=
842-
github.com/volcengine/volcengine-go-sdk v1.1.18/go.mod h1:EyKoi6t6eZxoPNGr2GdFCZti2Skd7MO3eUzx7TtSvNo=
841+
github.com/volcengine/volcengine-go-sdk v1.2.12 h1:wz5Fqw9gWeKo5MPn0MZLwIgplY8remoBih/7MX6HLvE=
842+
github.com/volcengine/volcengine-go-sdk v1.2.12/go.mod h1:oxoVo+A17kvkwPkIeIHPVLjSw7EQAm+l/Vau1YGHN+A=
843843
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
844844
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
845845
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
@@ -1435,6 +1435,7 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
14351435
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
14361436
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
14371437
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
1438+
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
14381439
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
14391440
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
14401441
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

provider/resources.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ func Provider() tfbridge.ProviderInfo {
7878
EnvVars: []string{"VOLCENGINE_SECRET_KEY"},
7979
},
8080
},
81+
"file_path": {
82+
Default: &tfbridge.DefaultInfo{
83+
EnvVars: []string{"VOLCENGINE_FILE_PATH"},
84+
},
85+
},
86+
"profile": {
87+
Default: &tfbridge.DefaultInfo{
88+
EnvVars: []string{"VOLCENGINE_PROFILE"},
89+
},
90+
},
8191
"disable_ssl": {
8292
Default: &tfbridge.DefaultInfo{
8393
EnvVars: []string{"VOLCENGINE_DISABLE_SSL"},

provider/shim/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.23.0
44

55
require (
66
github.com/hashicorp/terraform-plugin-framework v1.15.0
7-
github.com/volcengine/terraform-provider-volcenginecc v0.0.27
7+
github.com/volcengine/terraform-provider-volcenginecc v0.0.28
88
)
99

1010
require (
@@ -24,7 +24,7 @@ require (
2424
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
2525
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
2626
github.com/volcengine/volc-sdk-golang v1.0.23 // indirect
27-
github.com/volcengine/volcengine-go-sdk v1.1.18 // indirect
27+
github.com/volcengine/volcengine-go-sdk v1.2.12 // indirect
2828
golang.org/x/sys v0.33.0 // indirect
2929
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect
3030
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)