Difference between revisions of "Assume role policy"

From wikieduonline
Jump to navigation Jump to search
Line 8: Line 8:
 
* [[Terraform resource: aws_iam_role]]
 
* [[Terraform resource: aws_iam_role]]
 
* [[aws_iam_policy_attachment]]
 
* [[aws_iam_policy_attachment]]
 +
 +
* [[sts:AssumeRole]]
 
* [[sts:AssumeRoleWithSAML]]
 
* [[sts:AssumeRoleWithSAML]]
  

Revision as of 15:51, 4 July 2024


resource "aws_iam_role" "test_role" {
 name = "test_role"

 # Terraform's "jsonencode" function converts a
 # Terraform expression result to valid JSON syntax.
 assume_role_policy = jsonencode({
   Version = "2012-10-17"
   Statement = [
     {
       Action = "sts:AssumeRole"
       Effect = "Allow"
       Sid    = ""
       Principal = {
         Service = "ec2.amazonaws.com"
       }
     },
   ]
 })

 tags = {
   tag-key = "tag-value"
 }
}


See also

Advertising: