• Home
  • Dynatrace API
  • Configuration
  • AWS credentials
  • POST new credentials

AWS credentials API - POST new credentials

Creates a new AWS credentials configuration. Check the connection status for these credentials after 10 minutes with the GET credentials request.

The body must not provide an ID. The Dynatrace server automatically assigns an ID.

The request consumes and produces an application/json payload.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/aws/credentials
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/aws/credentials
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/aws/credentials

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyAwsCredentialsConfig

The JSON body of the request. Contains parameters of the new AWS credentials configuration.

bodyoptional

Request body objects

The AwsCredentialsConfig object

Configuration of an AWS credentials.

ElementTypeDescription
metadataConfigurationMetadata

Metadata useful for debugging

Can be null.

idstring

The unique ID of the credentials.

Can be null.

connectionStatusstring

The status of the connection to the AWS environment.

  • CONNECTED: There was a connection within last 10 minutes.
  • DISCONNECTED: A problem occurred with establishing connection using these credentials. Check whether the data is correct.
  • UNINITIALIZED: The successful connection has never been established for these credentials.
The element can hold these values
  • CONNECTED
  • DISCONNECTED
  • UNINITIALIZED

Can be null.

labelstring

The name of the credentials.

partitionTypestring

The type of the AWS partition.

The element can hold these values
  • AWS_CN
  • AWS_DEFAULT
  • AWS_US_GOV
authenticationDataAwsAuthenticationData

A credentials for the AWS authentication.

taggedOnlyboolean

Monitor only resources which have specified AWS tags (true) or all resources (false).

tagsToMonitorAwsConfigTag[]

A list of AWS tags to be monitored.

You can specify up to 10 tags.

Only applicable when the taggedOnly parameter is set to true.

supportingServicesToMonitorAwsSupportingServiceConfig[]

A list of supporting services to be monitored.

Can be null.

The ConfigurationMetadata object

Metadata useful for debugging

ElementTypeDescription
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

Can be null.

currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

Can be null.

clusterVersionstring

Dynatrace version.

Can be null.

The AwsAuthenticationData object

A credentials for the AWS authentication.

ElementTypeDescription
typestring

The type of the authentication: role-based or key-based.

The element can hold these values
  • KEYS
  • ROLE
keyBasedAuthenticationKeyBasedAuthentication

The credentials for the key-based authentication.

Can be null.

roleBasedAuthenticationRoleBasedAuthentication

The credentials for the role-based authentication.

Can be null.

The KeyBasedAuthentication object

The credentials for the key-based authentication.

ElementTypeDescription
accessKeystring

The ID of the access key.

secretKeystring

The secret access key.

The RoleBasedAuthentication object

The credentials for the role-based authentication.

ElementTypeDescription
iamRolestring

The IAM role to be used by Dynatrace to get monitoring data.

accountIdstring

The ID of the Amazon account.

externalIdstring

The external ID token for setting an IAM role.

You can obtain it with the GET /aws/iamExternalId request.

Can be null.

The AwsConfigTag object

An AWS tag of the resource to be monitored.

ElementTypeDescription
namestring

The key of the AWS tag.

valuestring

The value of the AWS tag.

The AwsSupportingServiceConfig object

A supporting service to be monitored.

ElementTypeDescription
namestring

The name of the supporting service. Valid supported service names can be discovered using /aws/supportedServices restAPI

monitoredMetricsAwsSupportingServiceMetric[]

A list of metrics to be monitored for this service. If the list is null then recommended list of metrics for this service will be monitored.

Can be null.

The AwsSupportingServiceMetric object

A metric of supporting service to be monitored.

ElementTypeDescription
namestring

The name of the metric of the supporting service.

statisticstring

The statistic (aggregation) to be used for the metric. AVG_MIN_MAX value is 3 statistics at once: AVERAGE, MINIMUM and MAXIMUM

The element can hold these values
  • AVERAGE
  • AVG_MIN_MAX
  • MAXIMUM
  • MINIMUM
  • SAMPLE_COUNT
  • SUM
dimensionsstring[]

A list of metric's dimensions names.

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

json
{ "metadata": { "configurationVersions": [ 4, 2 ], "currentConfigurationVersions": [ "1.0.4", "1.23" ], "clusterVersion": "1.192.1" }, "id": "string", "connectionStatus": "CONNECTED", "label": "string", "partitionType": "AWS_CN", "authenticationData": { "type": "KEYS", "keyBasedAuthentication": { "accessKey": "string", "secretKey": "string" }, "roleBasedAuthentication": { "iamRole": "string", "accountId": "string", "externalId": "string" } }, "taggedOnly": true, "tagsToMonitor": [ { "name": "string", "value": "string" } ], "supportingServicesToMonitor": [ { "name": "string", "monitoredMetrics": [ { "name": "string", "statistic": "AVERAGE", "dimensions": [ "string" ] } ] } ] }

Response

Response codes

CodeTypeDescription
201EntityShortRepresentation

Success. The new AWS credentials configuration has been created. The response body contains the ID of the configuration.

Check the connection status for these credentials after 10 minutes with the GET /aws/credentials/{id} request.

400ErrorEnvelope

Failed. The input is invalid.

Response body objects

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

ElementTypeDescription
idstring

The ID of the Dynatrace entity.

namestring

The name of the Dynatrace entity.

Can be null.

descriptionstring

A short description of the Dynatrace entity.

Can be null.

Response body JSON model

json
{ "id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a", "name": "Dynatrace entity", "description": "Dynatrace entity for the REST API example" }

GET the external ID token

Gets the external ID token for setting an IAM role.

The request produces an application/json payload.

GETManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/aws/iamExternalId
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/aws/iamExternalId
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/aws/iamExternalId

Authentication

To execute this request, you need an access token with Read configuration (ReadConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

CodeTypeDescription
200AwsIamToken

Success

Response body objects

The AwsIamToken object

The external ID token for setting IAM Role in AWS.

ElementTypeDescription
tokenstring

The external ID token for setting IAM Role in AWS.

Response body JSON model

json
{ "token": "string" }

Validate payload

We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.

The request consumes an application/json payload.

The request consumes an application/json payload.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/aws/credentials/validator
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/aws/credentials/validator
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/aws/credentials/validator

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

CodeTypeDescription
204-

Validated. The submitted configuration is valid. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid.

Related topics
  • Set up Dynatrace on Amazon Web Services

    Set up and configure Dynatrace on AWS.