Terraform will read from a data resource during the plan phase if and only if the entire configuration of the data resource is known during the planning phase.
In your case you have references to both aws_s3_bucket.some-bucket.arn
and aws_cloudwatch_log_group.some_lambda.arn
, and I suspect that neither of those values are known during planning because the remote API decides the ARN for an object as part of creating it.
Therefore the only way to see this policy during planning would be for those two objects to have already been created and so their ARNs already be known from a previous run.
One way to achieve that would be to initially apply only part of your configuration just to get those objects created:
terraform apply -target=aws_s3_bucket.some-bucket -target=aws_cloudwatch_log_group.some_lambda
Terraform should propose to create those two objects and anything else they depend on, but will not yet read the data resource or anything else that depends on it. If you accept that plan and allow Terraform to create those objects, then you can subsequently run terraform apply
as normal and Terraform should then be able to read this data resource during the second planning step and so show you the final value of this policy with the two ARNs already inserted.