Description
Is your feature request related to a problem? Please describe.
The Elastic Fleet Agent Policy supports setting an "Inactive agent unenrollment timeout" to be configured with a timeout in seconds.
From the Elastic Fleet UI > Agent Policy > Settings tab,
Inactive agent unenrollment timeout
An optional timeout in seconds. If configured, inactive agents will be automatically unenrolled and their API keys will be invalidated after they've been inactive for this value in seconds. This can be useful for policies containing ephemeral agents, such as those in a Docker or Kubernetes environment.
This is useful in ephemeral environments like Kubernetes, where there is constant churn of agents going offline/inactive as they get replaced.
However, the Fleet Agent Policy prevents itself from being deleted if there any number of agents (active or inactive/offline) associated with the policy, which poses a problem when trying to clean up resources (i.e. delete the Agent Policy) since terraform fails to delete the resource.
Describe the resource you would like to have implemented.
Add an option to pass the timeout value via the fleet_agent_policy
resource.
Describe the solution you'd like
The ask is to add a field to the agentPolicyModel
that gets propagated to UnenrollTimeout
exposed in the generated API models.
Describe alternatives you've considered
The only other alternative is to manually cleanup the offline agents and also their associated API Keys.
Additional context
Add any other context or screenshots about the feature request here.