Skip to main content

dt-access-token

This role creates DT access tokens on the user's behalf. In order to do so, a initial token needs to be provided that has the permissions (apiTokens.read and apiTokens.write) to create other API tokens. Each role that requires access to the DT API is responsible for managing its own access token and scopes.

Required variables

Variable nameCommentExample
dynatrace_tenant_urlURL for your DT environment. This is usually provided and sourced by default.https://your-id.dynatrace.com
dynatrace_api_tokenInitial API token with scopes apiTokens.read and apiTokens.writedt0c01. ...
access_token_var_nameName of variable the access token will be stored in. This variable can be used in any playbook. Variables must start with a letter or underscore character, and contain only letters, numbers and underscores.ace_box_gitlab_api_token
access_token_scopeList of scopes that will be added to the access token. For a list of available scopes please see the official docs.["slo.read","slo.write"]

Example

An access token can be created/sourced in any task by adding:

- include_role:
name: dt-access-token
vars:
access_token_var_name: "ace_box_my_access_token"
access_token_scope: ["slo.read","slo.write"]