
    <!-- IAM role partial -->
    <script id="services.iam.roles.partial" type="text/x-handlebars-template">
        <div id="resource-name" class="list-group-item active">
          <h4 class="list-group-item-heading">{{name}}</h4>
        </div>
        <div class="list-group-item">
            <h4 class="list-group-item-heading">Information</h4>
            <div class="list-group-item-text item-margin">ID: <span id="iam.roles.{{@key}}.id"><samp>{{value_or_none id}}</samp></span></div>
            <div class="list-group-item-text item-margin">Arn: <span id="iam.roles.{{@key}}.arn"><samp>{{value_or_none arn}}</samp></span></div>
            <div class="list-group-item-text item-margin">Description: <span id="iam.roles.{{@key}}.description"><samp>{{value_or_none description}}</samp></span></div>
            <div class="list-group-item-text item-margin">Creation Date: <span id="iam.roles.{{@key}}.create_date">{{format_date create_date}}</span></div>
            <div class="list-group-item-text item-margin">Path: <span id="iam.roles.{{@key}}.path"><samp>{{value_or_none path}}</samp></span></div>
            <div class="list-group-item-text item-margin">Max Session Duration: <span id="iam.roles.{{@key}}.max_session_duration"><samp>{{value_or_none max_session_duration}}</samp></span></div>
        </div>
        <div class="list-group-item">
            {{> accordion_policy name = 'Role Trust Policy' policy_path = (concat 'iam.roles' @key 'assume_role_policy.PolicyDocument') document = assume_role_policy.PolicyDocument}}
        </div>
        <div class="list-group-item">
          <div class="accordion">
            <h4 class="list-group-item-heading accordion-heading">Instances
                {{> count_badge count=instances_count target=(concat '#iam.roles' id 'instances')}}
            </h4>
            <div id="iam.roles.{{id}}.instances" class="accordion-body">
              <div class="accordion-inner">
                <ul class="no-bullet">
                  {{#each instance_profiles}}
                    {{#each instances}}
                      <li><a href="javascript:findAndShowEC2Object('regions.vpcs.instances', '{{this}}')">{{this}}</a></li>
                    {{/each}}
                  {{/each}}
                </ul>
              </div>
            </div>
          </div>
        </div>
        <div class="list-group-item">
          <div class="accordion">
            <h4 class="list-group-item-heading accordion-heading"> Lambda functions
              {{> count_badge count=awslambdas_count target=(concat '#iam.roles' id 'awslambdas')}}
            </h4>
            <div id="iam.roles.{{id}}.awslambdas" class="accordion-body">
              <div class="accordion-inner">
                <ul class="no-bullet">
                  {{#each awslambdas}}
                    <li><a href="javascript:showObject('services.awslambda.regions.{{this.region}}.functions.{{this.name}}')">{{this.name}}</a></li>
                  {{/each}}
                </ul>
              </div>
            </div>
          </div>
        </div>
        {{> services.iam.inline_policies resource_type = 'roles' resource_id = id}}
        {{> services.iam.policies_list resource_type = 'roles' resource_id = id}}
        {{#if Tags}}
        <div class="list-group-item">
          <h4>Tags</h4>
          <ul>
            {{#each Tags}}
            <li class="list-group-item-text"><samp>{{Key}}</samp>: <samp>{{Value}}</samp></li>
            {{/each}}
          </ul>
        </div>
        {{/if}}
    </script>
    <script>
      Handlebars.registerPartial("services.iam.roles", $("#services\\.iam\\.roles\\.partial").html());
    </script>

    <!-- Single IAM role template -->
    <script id="services.iam.roles.template" type="text/x-handlebars-template">
        {{> modal-template template='services.iam.roles'}}
    </script>
    <script>
        var single_iam_role_template = Handlebars.compile($("#services\\.iam\\.roles\\.template").html());
    </script>

