Cloud Authentication
Create an HCP Terraform persona mapping
Changed onCreate an HCP Terraform persona mapping. The mapping associates a Datadog user or service account with workload identity tokens from an HCP Terraform issuer whose sub claim matches sub_pattern.
The response includes the audience value to set as the TFC_WORKLOAD_IDENTITY_AUDIENCE_DATADOG environment variable in HCP Terraform. The API returns a 409 error if the pattern duplicates an existing mapping, or if it can match the same token as an existing mapping for a different account.
post/api/v2/wif/terraform/persona_mapping
Request
- Base URLhttps://api.datadoghq.com
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code/oauth2/v1/authorizeToken URL/oauth2/v1/tokenScopesworkload_identity_federation_write
Request body
Example request
{
"data": {
"attributes": {
"account_identifier": "test@example.com",
"issuer_url": "https://app.terraform.io",
"sub_pattern": "organization:example-org:project:Default Project:workspace:example-workspace:run_phase:*"
},
"type": "terraform_cloud_auth_config"
}
}Response
Created
Example response
{
"data": {
"attributes": {
"account_identifier": "test@example.com",
"account_uuid": "12bbdc5c-5966-47e0-8733-285f9e44bcf4",
"audience": "datadog/abcdef12-3456-7890-abcd-ef1234567890",
"issuer_url": "https://app.terraform.io",
"sub_pattern": "organization:example-org:project:Default Project:workspace:example-workspace:run_phase:*"
},
"id": "6f1c7a52-3d2e-4f8b-9a41-0c5d8e7b2f19",
"type": "terraform_cloud_auth_config"
}
}Changes
- warning
the optional response header
X-RateLimit-Limitremoved for the status429 - warning
the optional response header
X-RateLimit-Periodremoved for the status429 - warning
the optional response header
X-RateLimit-Remainingremoved for the status429
1 more change in this revision
- warning