Dynatrace v0.27.0 published on Friday, Mar 21, 2025 by Pulumiverse
dynatrace.getApiTokens
Explore with Pulumi AI
The API tokens data source allows all access tokens to be retrieved, note the token value is not included in the response.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as dynatrace from "@pulumi/dynatrace";
const exampleApiTokens = dynatrace.getApiTokens({});
export const example = exampleApiTokens;
import pulumi
import pulumi_dynatrace as dynatrace
example_api_tokens = dynatrace.get_api_tokens()
pulumi.export("example", example_api_tokens)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-dynatrace/sdk/go/dynatrace"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleApiTokens, err := dynatrace.GetApiTokens(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
ctx.Export("example", exampleApiTokens)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Dynatrace = Pulumi.Dynatrace;
return await Deployment.RunAsync(() =>
{
var exampleApiTokens = Dynatrace.GetApiTokens.Invoke();
return new Dictionary<string, object?>
{
["example"] = exampleApiTokens,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dynatrace.DynatraceFunctions;
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 exampleApiTokens = DynatraceFunctions.getApiTokens();
ctx.export("example", exampleApiTokens.applyValue(getApiTokensResult -> getApiTokensResult));
}
}
variables:
exampleApiTokens:
fn::invoke:
function: dynatrace:getApiTokens
arguments: {}
outputs:
example: ${exampleApiTokens}
Using getApiTokens
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 getApiTokens(opts?: InvokeOptions): Promise<GetApiTokensResult>
function getApiTokensOutput(opts?: InvokeOptions): Output<GetApiTokensResult>
def get_api_tokens(opts: Optional[InvokeOptions] = None) -> GetApiTokensResult
def get_api_tokens_output(opts: Optional[InvokeOptions] = None) -> Output[GetApiTokensResult]
func GetApiTokens(ctx *Context, opts ...InvokeOption) (*GetApiTokensResult, error)
func GetApiTokensOutput(ctx *Context, opts ...InvokeOption) GetApiTokensResultOutput
> Note: This function is named GetApiTokens
in the Go SDK.
public static class GetApiTokens
{
public static Task<GetApiTokensResult> InvokeAsync(InvokeOptions? opts = null)
public static Output<GetApiTokensResult> Invoke(InvokeOptions? opts = null)
}
public static CompletableFuture<GetApiTokensResult> getApiTokens(InvokeOptions options)
public static Output<GetApiTokensResult> getApiTokens(InvokeOptions options)
fn::invoke:
function: dynatrace:index/getApiTokens:getApiTokens
arguments:
# arguments dictionary
getApiTokens Result
The following output properties are available:
- Api
Tokens List<Pulumiverse.Dynatrace. Outputs. Get Api Tokens Api Token> - Id string
- The provider-assigned unique ID for this managed resource.
- Api
Tokens []GetApi Tokens Api Token - Id string
- The provider-assigned unique ID for this managed resource.
- api
Tokens List<GetApi Tokens Api Token> - id String
- The provider-assigned unique ID for this managed resource.
- api
Tokens GetApi Tokens Api Token[] - id string
- The provider-assigned unique ID for this managed resource.
- api_
tokens Sequence[GetApi Tokens Api Token] - id str
- The provider-assigned unique ID for this managed resource.
- api
Tokens List<Property Map> - id String
- The provider-assigned unique ID for this managed resource.
Supporting Types
GetApiTokensApiToken
- Creation
Date This property is required. string - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used Date This property is required. string - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used Ip Address This property is required. string - Token last used IP address.
- Modified
Date This property is required. string - Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
- Name
This property is required. string - The name of the token.
- Owner
This property is required. string - The owner of the token
- Scopes
This property is required. List<string> - A list of the scopes to be assigned to the token.
- Token
This property is required. string - The secret of the token.
- Enabled bool
- The token is enabled (true) or disabled (false), default disabled (false).
- Expiration
Date string - The expiration date of the token.
- Personal
Access boolToken - The token is a personal access token (true) or an API token (false).
- Creation
Date This property is required. string - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used Date This property is required. string - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used Ip Address This property is required. string - Token last used IP address.
- Modified
Date This property is required. string - Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
- Name
This property is required. string - The name of the token.
- Owner
This property is required. string - The owner of the token
- Scopes
This property is required. []string - A list of the scopes to be assigned to the token.
- Token
This property is required. string - The secret of the token.
- Enabled bool
- The token is enabled (true) or disabled (false), default disabled (false).
- Expiration
Date string - The expiration date of the token.
- Personal
Access boolToken - The token is a personal access token (true) or an API token (false).
- creation
Date This property is required. String - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used Date This property is required. String - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used Ip Address This property is required. String - Token last used IP address.
- modified
Date This property is required. String - Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
- name
This property is required. String - The name of the token.
- owner
This property is required. String - The owner of the token
- scopes
This property is required. List<String> - A list of the scopes to be assigned to the token.
- token
This property is required. String - The secret of the token.
- enabled Boolean
- The token is enabled (true) or disabled (false), default disabled (false).
- expiration
Date String - The expiration date of the token.
- personal
Access BooleanToken - The token is a personal access token (true) or an API token (false).
- creation
Date This property is required. string - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used Date This property is required. string - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used Ip Address This property is required. string - Token last used IP address.
- modified
Date This property is required. string - Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
- name
This property is required. string - The name of the token.
- owner
This property is required. string - The owner of the token
- scopes
This property is required. string[] - A list of the scopes to be assigned to the token.
- token
This property is required. string - The secret of the token.
- enabled boolean
- The token is enabled (true) or disabled (false), default disabled (false).
- expiration
Date string - The expiration date of the token.
- personal
Access booleanToken - The token is a personal access token (true) or an API token (false).
- creation_
date This property is required. str - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last_
used_ date This property is required. str - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last_
used_ ip_ address This property is required. str - Token last used IP address.
- modified_
date This property is required. str - Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
- name
This property is required. str - The name of the token.
- owner
This property is required. str - The owner of the token
- scopes
This property is required. Sequence[str] - A list of the scopes to be assigned to the token.
- token
This property is required. str - The secret of the token.
- enabled bool
- The token is enabled (true) or disabled (false), default disabled (false).
- expiration_
date str - The expiration date of the token.
- personal_
access_ booltoken - The token is a personal access token (true) or an API token (false).
- creation
Date This property is required. String - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used Date This property is required. String - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used Ip Address This property is required. String - Token last used IP address.
- modified
Date This property is required. String - Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
- name
This property is required. String - The name of the token.
- owner
This property is required. String - The owner of the token
- scopes
This property is required. List<String> - A list of the scopes to be assigned to the token.
- token
This property is required. String - The secret of the token.
- enabled Boolean
- The token is enabled (true) or disabled (false), default disabled (false).
- expiration
Date String - The expiration date of the token.
- personal
Access BooleanToken - The token is a personal access token (true) or an API token (false).
Package Details
- Repository
- dynatrace pulumiverse/pulumi-dynatrace
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
dynatrace
Terraform Provider.