Difference between revisions of "Template:Aws iam role test role"

From wikieduonline
Jump to navigation Jump to search
(Created page with " resource "aws_iam_role" "test_role" { name = "test_role" # Terraform's "jsonencode" function converts a # Terraform expression result to valid JSON syntax. assume_r...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
  resource "aws_iam_role" "test_role" {
+
  resource "[[aws_iam_role]]" "test_role" {
 
   name = "test_role"
 
   name = "test_role"
 
   
 
   
 
   # Terraform's "jsonencode" function converts a
 
   # Terraform's "jsonencode" function converts a
 
   # Terraform expression result to valid JSON syntax.
 
   # Terraform expression result to valid JSON syntax.
   assume_role_policy = jsonencode({
+
   [[assume_role_policy]] = jsonencode({
 
     Version = "2012-10-17"
 
     Version = "2012-10-17"
 
     Statement = [
 
     Statement = [

Latest revision as of 16:21, 29 May 2023

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"
 }
}

Advertising: