Receive a provisioning callback Experimental; added in 9.6.0

POST /api/fleet/iac_provisioner/callbacks/{callbackId}

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/iac_provisioner/callbacks/{callbackId}

Refer to Spaces for more information.

Called by the CloudFormation stack launched from Kibana to report the IAM role ARN and stack ARN it created. The request is not authenticated: present the one-time token issued when the callback was created in the x-elastic-callback-token header. The token is not an Elasticsearch credential and admits nothing but this report. role_arn and stack_arn must be in the same AWS account. While the record is pending, a repeat report with the same values succeeds and different values return 409; an expired or cancelled record returns 410.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • callbackId string Required

    ID of the callback record, as issued to the stack.

    Minimum length is 1, maximum length is 128.

application/json

Body

  • role_arn string Required

    ARN of the IAM role the stack created.

    Minimum length is 1, maximum length is 2048.

  • stack_arn string Required

    ARN (StackId) of the CloudFormation stack.

    Minimum length is 1, maximum length is 2048.

Responses

  • 200 application/json

    The values were stored, or were already stored

    Hide response attribute Show response attribute object
    • status string Required

      State of the callback record. pending: waiting for the stack. receiving: a report is being applied. received: values stored and the identity exists. cancelled: the form stopped waiting and the token is refused.

      Values are pending, receiving, received, or cancelled.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
  • 404 application/json

    Not Found

    Hide response attribute Show response attribute object
    • message string Required
  • 409 application/json

    Conflict

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
  • 410 application/json

    Gone

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
POST /api/fleet/iac_provisioner/callbacks/{callbackId}
curl \
 --request POST 'https://localhost:5601/api/fleet/iac_provisioner/callbacks/{callbackId}' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{
  "role_arn": "arn:aws:iam::123456789012:role/ElasticWorkloadIdentity-abc123",
  "stack_arn": "arn:aws:cloudformation:us-east-1:123456789012:stack/elastic-identity/11111111-2222-3333-4444-555555555555"
}'
Request example
The report the launched CloudFormation stack sends once its IAM role exists
{
  "role_arn": "arn:aws:iam::123456789012:role/ElasticWorkloadIdentity-abc123",
  "stack_arn": "arn:aws:cloudformation:us-east-1:123456789012:stack/elastic-identity/11111111-2222-3333-4444-555555555555"
}
Response examples (200)
The report was applied and the federated identity exists
{
  "status": "received"
}
Response examples (400)
The role and the stack are in different AWS accounts
{
  "error": "Bad Request",
  "message": "role_arn and stack_arn must be in the same AWS account",
  "statusCode": 400
}
Response examples (404)
No record has this ID, or the token is not the one issued for it
{
  "error": "Not Found",
  "message": "Callback not found",
  "statusCode": 404
}
Response examples (409)
A report with different values was already received
{
  "error": "Conflict",
  "message": "Callback already received with different values",
  "statusCode": 409
}
Response examples (410)
The record expired or was cancelled before the report arrived
{
  "error": "Gone",
  "message": "Callback is no longer accepting values",
  "statusCode": 410
}