Difference between revisions of "Assume role policy"

From wikieduonline
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
  
 +
== Related ==
 +
* [[Terraform resource: aws_iam_role]]
 +
* <code>[[aws_iam_policy_attachment]]</code>
  
* [[Terraform resource: aws_iam_role]]
+
* <code>[[sts:AssumeRole]]</code>
 +
* <code>[[sts:AssumeRoleWithSAML]]</code>
 +
 
 +
== See also ==
 +
* {{aws_iam_role_resource}}
 +
* {{AWS roles}}
  
{{aws_iam_role}}
+
[[Category:AWS]]

Latest revision as of 10:02, 5 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"
 }
}


Related[edit]

See also[edit]

Advertising: