Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi
published on Tuesday, Mar 10, 2026 by Pulumi
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi
published on Tuesday, Mar 10, 2026 by Pulumi
Use this data source to get the name and value of a pre-existing API Key, for example to supply credentials for a dependency microservice.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var myApiKey = Aws.ApiGateway.GetKey.Invoke(new()
{
Id = "ru3mpjgse6",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apigateway.GetKey(ctx, &apigateway.GetKeyArgs{
Id: "ru3mpjgse6",
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.ApigatewayFunctions;
import com.pulumi.aws.apigateway.inputs.GetKeyArgs;
import java.util.List;
import java.util.ArrayList;
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 myApiKey = ApigatewayFunctions.getKey(GetKeyArgs.builder()
.id("ru3mpjgse6")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const myApiKey = aws.apigateway.getKey({
id: "ru3mpjgse6",
});
import pulumi
import pulumi_aws as aws
my_api_key = aws.apigateway.get_key(id="ru3mpjgse6")
variables:
myApiKey:
fn::invoke:
Function: aws:apigateway:getKey
Arguments:
id: ru3mpjgse6
Using getKey
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 getKey(args: GetKeyArgs, opts?: InvokeOptions): Promise<GetKeyResult>
function getKeyOutput(args: GetKeyOutputArgs, opts?: InvokeOptions): Output<GetKeyResult>def get_key(id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetKeyResult
def get_key_output(id: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKeyResult]func GetKey(ctx *Context, args *GetKeyArgs, opts ...InvokeOption) (*GetKeyResult, error)
func GetKeyOutput(ctx *Context, args *GetKeyOutputArgs, opts ...InvokeOption) GetKeyResultOutput> Note: This function is named GetKey in the Go SDK.
public static class GetKey
{
public static Task<GetKeyResult> InvokeAsync(GetKeyArgs args, InvokeOptions? opts = null)
public static Output<GetKeyResult> Invoke(GetKeyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
public static Output<GetKeyResult> getKey(GetKeyArgs args, InvokeOptions options)
fn::invoke:
function: aws:apigateway/getKey:getKey
arguments:
# arguments dictionaryThe following arguments are supported:
- Id string
- ID of the API Key to look up.
- Dictionary<string, string>
- Map of tags for the resource.
- Id string
- ID of the API Key to look up.
- map[string]string
- Map of tags for the resource.
- id String
- ID of the API Key to look up.
- Map<String,String>
- Map of tags for the resource.
- id string
- ID of the API Key to look up.
- {[key: string]: string}
- Map of tags for the resource.
- id str
- ID of the API Key to look up.
- Mapping[str, str]
- Map of tags for the resource.
- id String
- ID of the API Key to look up.
- Map<String>
- Map of tags for the resource.
getKey Result
The following output properties are available:
- Created
Date string - Date and time when the API Key was created.
- Description string
- Description of the API Key.
- Enabled bool
- Whether the API Key is enabled.
- Id string
- Set to the ID of the API Key.
- Last
Updated stringDate - Date and time when the API Key was last updated.
- Name string
- Set to the name of the API Key.
- Dictionary<string, string>
- Map of tags for the resource.
- Value string
- Set to the value of the API Key.
- Created
Date string - Date and time when the API Key was created.
- Description string
- Description of the API Key.
- Enabled bool
- Whether the API Key is enabled.
- Id string
- Set to the ID of the API Key.
- Last
Updated stringDate - Date and time when the API Key was last updated.
- Name string
- Set to the name of the API Key.
- map[string]string
- Map of tags for the resource.
- Value string
- Set to the value of the API Key.
- created
Date String - Date and time when the API Key was created.
- description String
- Description of the API Key.
- enabled Boolean
- Whether the API Key is enabled.
- id String
- Set to the ID of the API Key.
- last
Updated StringDate - Date and time when the API Key was last updated.
- name String
- Set to the name of the API Key.
- Map<String,String>
- Map of tags for the resource.
- value String
- Set to the value of the API Key.
- created
Date string - Date and time when the API Key was created.
- description string
- Description of the API Key.
- enabled boolean
- Whether the API Key is enabled.
- id string
- Set to the ID of the API Key.
- last
Updated stringDate - Date and time when the API Key was last updated.
- name string
- Set to the name of the API Key.
- {[key: string]: string}
- Map of tags for the resource.
- value string
- Set to the value of the API Key.
- created_
date str - Date and time when the API Key was created.
- description str
- Description of the API Key.
- enabled bool
- Whether the API Key is enabled.
- id str
- Set to the ID of the API Key.
- last_
updated_ strdate - Date and time when the API Key was last updated.
- name str
- Set to the name of the API Key.
- Mapping[str, str]
- Map of tags for the resource.
- value str
- Set to the value of the API Key.
- created
Date String - Date and time when the API Key was created.
- description String
- Description of the API Key.
- enabled Boolean
- Whether the API Key is enabled.
- id String
- Set to the ID of the API Key.
- last
Updated StringDate - Date and time when the API Key was last updated.
- name String
- Set to the name of the API Key.
- Map<String>
- Map of tags for the resource.
- value String
- Set to the value of the API Key.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi
published on Tuesday, Mar 10, 2026 by Pulumi
