awscc_iam_user (Resource)

Creates a new IAM user for your AWS-account. For information about quotas for the number of IAM users you can create, see IAM and quotas in the IAM User Guide.

Example Usage

IAM user with one time password reset

The following example creates an IAM user with predefined password, password reset and sample inline policy.

resource "awscc_iam_user" "sample_user" {
  user_name = "sample-user"

  login_profile = {
    password                = "MyRandomPassword123$!"
    password_reset_required = true
  }

  policies = [
    {
      policy_name = "sample-policy"
      policy_document = jsonencode({
        "Version" : "2012-10-17",
        "Statement" : [
          {
            "Effect" : "Allow",
            "Action" : [
              "s3:ListAllMyBuckets",
            ],
            "Resource" : "arn:aws:s3:::*"
          }
        ]
      })
    }
  ]

  tags = [
    {
      key   = "Environment"
      value = "Dev"
    },
    {
      key   = "Team"
      value = "DevOps"
    }
  ]
}

Schema

Optional

Read-Only

Nested Schema for login_profile

Required:

Optional:

Nested Schema for policies

Required:

Nested Schema for tags

Required:

Import

Import is supported using the following syntax:

$ terraform import awscc_iam_user.example <resource ID>