GetKey
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 Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var myApiKey = Output.Create(Aws.ApiGateway.GetKey.InvokeAsync(new Aws.ApiGateway.GetKeyArgs
{
Id = "ru3mpjgse6",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/apigateway"
"github.com/pulumi/pulumi/sdk/v2/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
})
}import pulumi
import pulumi_aws as aws
my_api_key = aws.apigateway.get_key(id="ru3mpjgse6")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const myApiKey = pulumi.output(aws.apigateway.getKey({
id: "ru3mpjgse6",
}, { async: true }));Using GetKey
function getKey(args: GetKeyArgs, opts?: InvokeOptions): Promise<GetKeyResult>function get_key(id=None, tags=None, opts=None)func GetKey(ctx *Context, args *GetKeyArgs, opts ...InvokeOption) (*GetKeyResult, error)public static class GetKey {
public static Task<GetKeyResult> InvokeAsync(GetKeyArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetKey Result
The following output properties are available:
- Created
Date string The date and time when the API Key was created.
- Description string
The description of the API Key.
- Enabled bool
Specifies whether the API Key is enabled.
- Id string
Set to the ID of the API Key.
- Last
Updated stringDate The date and time when the API Key was last updated.
- Name string
Set to the name of the API Key.
- Dictionary<string, string>
A map of tags for the resource.
- Value string
Set to the value of the API Key.
- Created
Date string The date and time when the API Key was created.
- Description string
The description of the API Key.
- Enabled bool
Specifies whether the API Key is enabled.
- Id string
Set to the ID of the API Key.
- Last
Updated stringDate The date and time when the API Key was last updated.
- Name string
Set to the name of the API Key.
- map[string]string
A map of tags for the resource.
- Value string
Set to the value of the API Key.
- created
Date string The date and time when the API Key was created.
- description string
The description of the API Key.
- enabled boolean
Specifies whether the API Key is enabled.
- id string
Set to the ID of the API Key.
- last
Updated stringDate The date and time when the API Key was last updated.
- name string
Set to the name of the API Key.
- {[key: string]: string}
A map of tags for the resource.
- value string
Set to the value of the API Key.
- created_
date str The date and time when the API Key was created.
- description str
The description of the API Key.
- enabled bool
Specifies whether the API Key is enabled.
- id str
Set to the ID of the API Key.
- last_
updated_ strdate The date and time when the API Key was last updated.
- name str
Set to the name of the API Key.
- Dict[str, str]
A map of tags for the resource.
- value str
Set to the value of the API Key.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.