# Possible function

**URL:** <https://discuss.hashicorp.com/t/possible-function/61838>\
**Category:** Sentinel\
**Created:** [January 18, 2024, 3:00am UTC](https://discuss.hashicorp.com/t/possible-function/61838 "2024-01-18T03:00:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![f.nkeng](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/f.nkeng/32/27034_2.png) [@f.nkeng](https://discuss.hashicorp.com/u/f.nkeng)\
**Post date:** [January 18, 2024, 3:00am UTC](https://discuss.hashicorp.com/t/possible-function/61838/1 "2024-01-18T03:00:54Z")

</div>

Hello, l am trying to create a policy that ensures the assume\_role\_policy attribute, principal value is not a wildcard \* but not too sure how to go about this.  
resource “aws\_iam\_role” “this” {  
+ arn = (known after apply)  
+ assume\_role\_policy = jsonencode(  
{  
+ Statement = [  
+ {  
+ Action = “sts:AssumeRole”  
+ Effect = “Allow”  
+ Principal = {  
+ Service = “[lambda.amazonaws.com](http://lambda.amazonaws.com)”  
}  
+ Sid = “AllowLambda”  
},  
]

---

<div class="post-metadata">

**Author:** ![marcello.romo](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/marcello.romo/32/44060_2.png) [@marcello.romo](https://discuss.hashicorp.com/u/marcello.romo)\
**Post date:** [July 22, 2024, 4:27pm UTC](https://discuss.hashicorp.com/t/possible-function/61838/2 "2024-07-22T16:27:00Z")

</div>

Hi There, controls over IAM is alway a challange what datasources are you using? should be this: state.find\_datasources(“aws\_iam\_policy\_document”)  
let me know
