Resource: aws_rolesanywhere_profile

Terraform resource for managing a Roles Anywhere Profile.

Example Usage

resource "aws_iam_role" "test" {
  name = "test"
  path = "/"

  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Action = [
        "sts:AssumeRole",
        "sts:TagSession",
        "sts:SetSourceIdentity"
      ]
      Principal = {
        Service = "rolesanywhere.amazonaws.com",
      }
      Effect = "Allow"
      Sid    = ""
    }]
  })
}

resource "aws_rolesanywhere_profile" "test" {

  name      = "example"
  role_arns = [aws_iam_role.test.arn]
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import aws_rolesanywhere_profile using its id. For example:

import {
  to = aws_rolesanywhere_profile.example
  id = "db138a85-8925-4f9f-a409-08231233cacf"
}

Using terraform import, import aws_rolesanywhere_profile using its id. For example:

% terraform import aws_rolesanywhere_profile.example db138a85-8925-4f9f-a409-08231233cacf