Viewing docs for Alibaba Cloud v3.106.0
published on Monday, Aug 24, 2026 by Pulumi
published on Monday, Aug 24, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.106.0
published on Monday, Aug 24, 2026 by Pulumi
published on Monday, Aug 24, 2026 by Pulumi
This data source provides Gpdb Api Key available to the user.What is Api Key
NOTE: Available since v1.286.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const workspaceId = config.get("workspaceId") || "ws-xxxxxxx";
const _default = alicloud.gpdb.getApiKeys({
workspaceId: workspaceId,
});
export const gpdbApiKeyId = _default.then(_default => _default.keys?.[0]?.keyId);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
workspace_id = config.get("workspaceId")
if workspace_id is None:
workspace_id = "ws-xxxxxxx"
default = alicloud.gpdb.get_api_keys(workspace_id=workspace_id)
pulumi.export("gpdbApiKeyId", default.keys[0].key_id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gpdb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
workspaceId := "ws-xxxxxxx"
if param := cfg.Get("workspaceId"); param != "" {
workspaceId = param
}
_default, err := gpdb.GetApiKeys(ctx, &gpdb.GetApiKeysArgs{
WorkspaceId: workspaceId,
}, nil)
if err != nil {
return err
}
ctx.Export("gpdbApiKeyId", _default.Keys[0].KeyId)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var workspaceId = config.Get("workspaceId") ?? "ws-xxxxxxx";
var @default = AliCloud.Gpdb.GetApiKeys.Invoke(new()
{
WorkspaceId = workspaceId,
});
return new Dictionary<string, object?>
{
["gpdbApiKeyId"] = @default.Apply(@default => @default.Apply(getApiKeysResult => getApiKeysResult.Keys[0]?.KeyId)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.gpdb.GpdbFunctions;
import com.pulumi.alicloud.gpdb.inputs.GetApiKeysArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var workspaceId = config.get("workspaceId").orElse("ws-xxxxxxx");
final var default = GpdbFunctions.getApiKeys(GetApiKeysArgs.builder()
.workspaceId(workspaceId)
.build());
ctx.export("gpdbApiKeyId", default_.keys()[0].keyId());
}
}
configuration:
workspaceId:
type: string
default: ws-xxxxxxx
variables:
default:
fn::invoke:
function: alicloud:gpdb:getApiKeys
arguments:
workspaceId: ${workspaceId}
outputs:
gpdbApiKeyId: ${default.keys[0].keyId}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_gpdb_getapikeys" "default" {
workspace_id = var.workspaceId
}
variable "workspaceId" {
type = string
default = "ws-xxxxxxx"
}
output "gpdbApiKeyId" {
value = data.alicloud_gpdb_getapikeys.default.keys[0].key_id
}
Using getApiKeys
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getApiKeys(args: GetApiKeysArgs, opts?: InvokeOptions): Promise<GetApiKeysResult>
function getApiKeysOutput(args: GetApiKeysOutputArgs, opts?: InvokeOutputOptions): Output<GetApiKeysResult>def get_api_keys(ids: Optional[Sequence[str]] = None,
output_file: Optional[str] = None,
workspace_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetApiKeysResult
def get_api_keys_output(ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
output_file: pulumi.Input[Optional[str]] = None,
workspace_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetApiKeysResult]func GetApiKeys(ctx *Context, args *GetApiKeysArgs, opts ...InvokeOption) (*GetApiKeysResult, error)
func GetApiKeysOutput(ctx *Context, args *GetApiKeysOutputArgs, opts ...InvokeOption) GetApiKeysResultOutput> Note: This function is named GetApiKeys in the Go SDK.
public static class GetApiKeys
{
public static Task<GetApiKeysResult> InvokeAsync(GetApiKeysArgs args, InvokeOptions? opts = null)
public static Output<GetApiKeysResult> Invoke(GetApiKeysInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetApiKeysResult> Invoke(GetApiKeysInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetApiKeysResult> getApiKeys(GetApiKeysArgs args, InvokeOptions options)
public static Output<GetApiKeysResult> getApiKeys(GetApiKeysArgs args, InvokeOptions options)
public static Output<GetApiKeysResult> getApiKeys(GetApiKeysArgs args, InvokeOutputOptions options)
fn::invoke:
function: alicloud:gpdb/getApiKeys:getApiKeys
arguments:
# arguments dictionarydata "alicloud_gpdb_get_api_keys" "name" {
# arguments
}The following arguments are supported:
- Workspace
Id string - The ID of the workspace.
- Ids List<string>
- A list of Api Key IDs. The value is formulated as
<workspace_id>:<key_id>. - Output
File string - File name where to save data source results (after running
pulumi preview).
- Workspace
Id string - The ID of the workspace.
- Ids []string
- A list of Api Key IDs. The value is formulated as
<workspace_id>:<key_id>. - Output
File string - File name where to save data source results (after running
pulumi preview).
- workspace_
id string - The ID of the workspace.
- ids list(string)
- A list of Api Key IDs. The value is formulated as
<workspace_id>:<key_id>. - output_
file string - File name where to save data source results (after running
pulumi preview).
- workspace
Id String - The ID of the workspace.
- ids List<String>
- A list of Api Key IDs. The value is formulated as
<workspace_id>:<key_id>. - output
File String - File name where to save data source results (after running
pulumi preview).
- workspace
Id string - The ID of the workspace.
- ids string[]
- A list of Api Key IDs. The value is formulated as
<workspace_id>:<key_id>. - output
File string - File name where to save data source results (after running
pulumi preview).
- workspace_
id str - The ID of the workspace.
- ids Sequence[str]
- A list of Api Key IDs. The value is formulated as
<workspace_id>:<key_id>. - output_
file str - File name where to save data source results (after running
pulumi preview).
- workspace
Id String - The ID of the workspace.
- ids List<String>
- A list of Api Key IDs. The value is formulated as
<workspace_id>:<key_id>. - output
File String - File name where to save data source results (after running
pulumi preview).
getApiKeys Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of Api Key IDs.
- Keys
List<Pulumi.
Ali Cloud. Gpdb. Outputs. Get Api Keys Key> - A list of Api Key Entries. Each element contains the following attributes:
- Workspace
Id string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of Api Key IDs.
- Keys
[]Get
Api Keys Key - A list of Api Key Entries. Each element contains the following attributes:
- Workspace
Id string - Output
File string
- id string
- The provider-assigned unique ID for this managed resource.
- ids list(string)
- A list of Api Key IDs.
- keys list(object)
- A list of Api Key Entries. Each element contains the following attributes:
- workspace_
id string - output_
file string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Api Key IDs.
- keys
List<Get
Api Keys Key> - A list of Api Key Entries. Each element contains the following attributes:
- workspace
Id String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of Api Key IDs.
- keys
Get
Api Keys Key[] - A list of Api Key Entries. Each element contains the following attributes:
- workspace
Id string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of Api Key IDs.
- keys
Sequence[Get
Api Keys Key] - A list of Api Key Entries. Each element contains the following attributes:
- workspace_
id str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Api Key IDs.
- keys List<Property Map>
- A list of Api Key Entries. Each element contains the following attributes:
- workspace
Id String - output
File String
Supporting Types
GetApiKeysKey
- Create
Time string - The creation time of the resource.
- Description string
- The description of the API key.
- Id string
- The ID of the resource supplied above.
- Key
Id string - The ID of the API key.
- Key
Name string - The name of the API key.
- Key
Prefix string - The prefix of the API key.
- Create
Time string - The creation time of the resource.
- Description string
- The description of the API key.
- Id string
- The ID of the resource supplied above.
- Key
Id string - The ID of the API key.
- Key
Name string - The name of the API key.
- Key
Prefix string - The prefix of the API key.
- create_
time string - The creation time of the resource.
- description string
- The description of the API key.
- id string
- The ID of the resource supplied above.
- key_
id string - The ID of the API key.
- key_
name string - The name of the API key.
- key_
prefix string - The prefix of the API key.
- create
Time String - The creation time of the resource.
- description String
- The description of the API key.
- id String
- The ID of the resource supplied above.
- key
Id String - The ID of the API key.
- key
Name String - The name of the API key.
- key
Prefix String - The prefix of the API key.
- create
Time string - The creation time of the resource.
- description string
- The description of the API key.
- id string
- The ID of the resource supplied above.
- key
Id string - The ID of the API key.
- key
Name string - The name of the API key.
- key
Prefix string - The prefix of the API key.
- create_
time str - The creation time of the resource.
- description str
- The description of the API key.
- id str
- The ID of the resource supplied above.
- key_
id str - The ID of the API key.
- key_
name str - The name of the API key.
- key_
prefix str - The prefix of the API key.
- create
Time String - The creation time of the resource.
- description String
- The description of the API key.
- id String
- The ID of the resource supplied above.
- key
Id String - The ID of the API key.
- key
Name String - The name of the API key.
- key
Prefix String - The prefix of the API key.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.106.0
published on Monday, Aug 24, 2026 by Pulumi
published on Monday, Aug 24, 2026 by Pulumi