1. Packages
  2. Datadog Provider
  3. API Docs
  4. ApiKey
Datadog v4.48.1 published on Saturday, Apr 5, 2025 by Pulumi

datadog.ApiKey

Explore with Pulumi AI

Provides a Datadog API Key resource. This can be used to create and manage Datadog API Keys. Import functionality for this resource is deprecated and will be removed in a future release with prior notice. Securely store your API keys using a secret management system or use this resource to create and manage new API keys.

Example Usage

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

// Create a new Datadog API Key
const foo = new datadog.ApiKey("foo", {name: "foo-application"});
Copy
import pulumi
import pulumi_datadog as datadog

# Create a new Datadog API Key
foo = datadog.ApiKey("foo", 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 {
		// Create a new Datadog API Key
		_, err := datadog.NewApiKey(ctx, "foo", &datadog.ApiKeyArgs{
			Name: pulumi.String("foo-application"),
		})
		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(() => 
{
    // Create a new Datadog API Key
    var foo = new Datadog.ApiKey("foo", 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.ApiKey;
import com.pulumi.datadog.ApiKeyArgs;
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) {
        // Create a new Datadog API Key
        var foo = new ApiKey("foo", ApiKeyArgs.builder()
            .name("foo-application")
            .build());

    }
}
Copy
resources:
  # Create a new Datadog API Key
  foo:
    type: datadog:ApiKey
    properties:
      name: foo-application
Copy

Create ApiKey Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);
@overload
def ApiKey(resource_name: str,
           args: ApiKeyArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def ApiKey(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           name: Optional[str] = None,
           remote_config_read_enabled: Optional[bool] = None)
func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)
public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: datadog:ApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ApiKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ApiKeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ApiKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ApiKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ApiKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var apiKeyResource = new Datadog.ApiKey("apiKeyResource", new()
{
    Name = "string",
    RemoteConfigReadEnabled = false,
});
Copy
example, err := datadog.NewApiKey(ctx, "apiKeyResource", &datadog.ApiKeyArgs{
	Name:                    pulumi.String("string"),
	RemoteConfigReadEnabled: pulumi.Bool(false),
})
Copy
var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
    .name("string")
    .remoteConfigReadEnabled(false)
    .build());
Copy
api_key_resource = datadog.ApiKey("apiKeyResource",
    name="string",
    remote_config_read_enabled=False)
Copy
const apiKeyResource = new datadog.ApiKey("apiKeyResource", {
    name: "string",
    remoteConfigReadEnabled: false,
});
Copy
type: datadog:ApiKey
properties:
    name: string
    remoteConfigReadEnabled: false
Copy

ApiKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ApiKey resource accepts the following input properties:

Name This property is required. string
Name for API Key.
RemoteConfigReadEnabled bool
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
Name This property is required. string
Name for API Key.
RemoteConfigReadEnabled bool
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
name This property is required. String
Name for API Key.
remoteConfigReadEnabled Boolean
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
name This property is required. string
Name for API Key.
remoteConfigReadEnabled boolean
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
name This property is required. str
Name for API Key.
remote_config_read_enabled bool
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
name This property is required. String
Name for API Key.
remoteConfigReadEnabled Boolean
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.

Outputs

All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Key string
The value of the API Key.
Id string
The provider-assigned unique ID for this managed resource.
Key string
The value of the API Key.
id String
The provider-assigned unique ID for this managed resource.
key String
The value of the API Key.
id string
The provider-assigned unique ID for this managed resource.
key string
The value of the API Key.
id str
The provider-assigned unique ID for this managed resource.
key str
The value of the API Key.
id String
The provider-assigned unique ID for this managed resource.
key String
The value of the API Key.

Look up Existing ApiKey Resource

Get an existing ApiKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ApiKeyState, opts?: CustomResourceOptions): ApiKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        key: Optional[str] = None,
        name: Optional[str] = None,
        remote_config_read_enabled: Optional[bool] = None) -> ApiKey
func GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)
public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)
public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)
resources:  _:    type: datadog:ApiKey    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Key string
The value of the API Key.
Name string
Name for API Key.
RemoteConfigReadEnabled bool
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
Key string
The value of the API Key.
Name string
Name for API Key.
RemoteConfigReadEnabled bool
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
key String
The value of the API Key.
name String
Name for API Key.
remoteConfigReadEnabled Boolean
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
key string
The value of the API Key.
name string
Name for API Key.
remoteConfigReadEnabled boolean
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
key str
The value of the API Key.
name str
Name for API Key.
remote_config_read_enabled bool
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.
key String
The value of the API Key.
name String
Name for API Key.
remoteConfigReadEnabled Boolean
Whether the API key is used for remote config. Set to true only if remote config is enabled in /organization-settings/remote-config.

Import

$ pulumi import datadog:index/apiKey:ApiKey foo 11111111-2222-3333-4444-555555555555
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Datadog pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.