1. Packages
  2. Datadog Provider
  3. API Docs
  4. getApiKey
Datadog v4.49.1 published on Saturday, Apr 26, 2025 by Pulumi

datadog.getApiKey

Explore with Pulumi AI

Datadog v4.49.1 published on Saturday, Apr 26, 2025 by Pulumi

Use this data source to retrieve information about an existing api key. Deprecated. This will be removed in a future release with prior notice. Securely store your API keys using a secret management system or use the datadog.ApiKey resource to manage API keys in your Datadog account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

const foo = datadog.getApiKey({
    name: "foo-application",
});
Copy
import pulumi
import pulumi_datadog as datadog

foo = datadog.get_api_key(name="foo-application")
Copy
package main

import (
	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datadog.LookupApiKey(ctx, &datadog.LookupApiKeyArgs{
			Name: pulumi.StringRef("foo-application"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;

return await Deployment.RunAsync(() => 
{
    var foo = Datadog.GetApiKey.Invoke(new()
    {
        Name = "foo-application",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.DatadogFunctions;
import com.pulumi.datadog.inputs.GetApiKeyArgs;
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 foo = DatadogFunctions.getApiKey(GetApiKeyArgs.builder()
            .name("foo-application")
            .build());

    }
}
Copy
variables:
  foo:
    fn::invoke:
      function: datadog:getApiKey
      arguments:
        name: foo-application
Copy

Using getApiKey

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 getApiKey(args: GetApiKeyArgs, opts?: InvokeOptions): Promise<GetApiKeyResult>
function getApiKeyOutput(args: GetApiKeyOutputArgs, opts?: InvokeOptions): Output<GetApiKeyResult>
Copy
def get_api_key(exact_match: Optional[bool] = None,
                id: Optional[str] = None,
                name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetApiKeyResult
def get_api_key_output(exact_match: Optional[pulumi.Input[bool]] = None,
                id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetApiKeyResult]
Copy
func LookupApiKey(ctx *Context, args *LookupApiKeyArgs, opts ...InvokeOption) (*LookupApiKeyResult, error)
func LookupApiKeyOutput(ctx *Context, args *LookupApiKeyOutputArgs, opts ...InvokeOption) LookupApiKeyResultOutput
Copy

> Note: This function is named LookupApiKey in the Go SDK.

public static class GetApiKey 
{
    public static Task<GetApiKeyResult> InvokeAsync(GetApiKeyArgs args, InvokeOptions? opts = null)
    public static Output<GetApiKeyResult> Invoke(GetApiKeyInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetApiKeyResult> getApiKey(GetApiKeyArgs args, InvokeOptions options)
public static Output<GetApiKeyResult> getApiKey(GetApiKeyArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: datadog:index/getApiKey:getApiKey
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ExactMatch bool
Whether to use exact match when searching by name.
Id string
The ID of this resource.
Name string
Name for API Key.
ExactMatch bool
Whether to use exact match when searching by name.
Id string
The ID of this resource.
Name string
Name for API Key.
exactMatch Boolean
Whether to use exact match when searching by name.
id String
The ID of this resource.
name String
Name for API Key.
exactMatch boolean
Whether to use exact match when searching by name.
id string
The ID of this resource.
name string
Name for API Key.
exact_match bool
Whether to use exact match when searching by name.
id str
The ID of this resource.
name str
Name for API Key.
exactMatch Boolean
Whether to use exact match when searching by name.
id String
The ID of this resource.
name String
Name for API Key.

getApiKey Result

The following output properties are available:

Key string
The value of the API Key.
RemoteConfigReadEnabled bool
Whether the API key is used for remote config.
ExactMatch bool
Whether to use exact match when searching by name.
Id string
The ID of this resource.
Name string
Name for API Key.
Key string
The value of the API Key.
RemoteConfigReadEnabled bool
Whether the API key is used for remote config.
ExactMatch bool
Whether to use exact match when searching by name.
Id string
The ID of this resource.
Name string
Name for API Key.
key String
The value of the API Key.
remoteConfigReadEnabled Boolean
Whether the API key is used for remote config.
exactMatch Boolean
Whether to use exact match when searching by name.
id String
The ID of this resource.
name String
Name for API Key.
key string
The value of the API Key.
remoteConfigReadEnabled boolean
Whether the API key is used for remote config.
exactMatch boolean
Whether to use exact match when searching by name.
id string
The ID of this resource.
name string
Name for API Key.
key str
The value of the API Key.
remote_config_read_enabled bool
Whether the API key is used for remote config.
exact_match bool
Whether to use exact match when searching by name.
id str
The ID of this resource.
name str
Name for API Key.
key String
The value of the API Key.
remoteConfigReadEnabled Boolean
Whether the API key is used for remote config.
exactMatch Boolean
Whether to use exact match when searching by name.
id String
The ID of this resource.
name String
Name for API Key.

Package Details

Repository
Datadog pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.
Datadog v4.49.1 published on Saturday, Apr 26, 2025 by Pulumi