github.com/armen/terraform@v0.5.2-0.20150529052519-caa8117a08f1/website/source/docs/providers/aws/r/iam_role.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_iam_role"
     4  sidebar_current: "docs-aws-resource-iam-role"
     5  description: |-
     6    Provides an IAM role.
     7  ---
     8  
     9  # aws\_iam\_role
    10  
    11  Provides an IAM role.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "aws_iam_role" "test_role" {
    17      name = "test_role"
    18      assume_role_policy = <<EOF
    19  {
    20    "Version": "2012-10-17",
    21    "Statement": [
    22      {
    23        "Action": "sts:AssumeRole",
    24        "Principal": {
    25          "Service": "ec2.amazonaws.com"
    26        },
    27        "Effect": "Allow",
    28        "Sid": ""
    29      }
    30    ]
    31  }
    32  EOF
    33  }
    34  ```
    35  
    36  ## Argument Reference
    37  
    38  The following arguments are supported:
    39  
    40  * `name` - (Required) The name of the role.
    41  * `assume_role_policy` - (Required) The policy that grants an entity permission to assume the role.
    42  * `path` - (Optional) The path to the role.
    43    See [IAM Identifiers](http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) for more information.
    44  
    45  ## Attributes Reference
    46  
    47  * `arn` - The Amazon Resource Name (ARN) specifying the role.
    48  * `unique_id` - The stable and unique string identifying the role.