Using vault_aws_engine in data block

Hello,

I’m having an issue while using the vault_aws_engine parameter in the data block:

data "amazon-ami" "amazon-linux-2-arm" {
  filters = {
    name                = "amzn2-ami-hvm-2.*-arm64-gp2"
    root-device-type    = "ebs"
    virtualization-type = "hvm"
  }
  most_recent = true
  owners      = ["amazon"]
  region      = var.region
  
  vault_aws_engine {
    name = "my-role"
  }

Packer validation runs just fine, however I run into this error:

*Error: Datasource.Execute failed: Error querying AMI: AuthFailure: AWS was not able to validate the provided access credentials*

I can’t find any docs to confirm if vault_aws_engine is supported in a data block.

I works just fine when using it in a build block, so I’m wondering if this is an issue with support in data block.

Thanks,