Using AWS Cli Statement in locals block

Hey all,

I want store the result of an aws cli statement in locals variable. My actual code looks like this:

locals {
  vpnendpointid = "$${aws ec2 describe-client-vpn-endpoints --filters Name=tag:Name,Values=endpoint --query 'ClientVpnEndpoints[*].[ClientVpnEndpointId]' --output text --region eu-central-1}"
}

I need to store this to execute later a delete statement…

Can anyone help me?

Friendly regards,
Samir