Files
opentf/website/source/docs/providers/aws/r/iam_user_policy.html.markdown
Tomohiro TAIRA 405ed57544 Remove status argument from aws_iam_access_key
`aws_iam_access_key` resource is not supported `status` field.

Example from https://www.terraform.io/docs/providers/aws/r/iam_access_key.html:

    resource "aws_iam_access_key" "lb" {
        user = "${aws_iam_user.lb.name}"
        status = "Active"
    }

    resource "aws_iam_user" "lb" {
        name = "loadbalancer"
        path = "/system/"
    }

Result:

    $ terraform plan
    There are warnings and/or errors related to your configuration. Please
    fix these before continuing.

    Errors:

      * aws_iam_access_key.lb: "status": this field cannot be set
2015-07-01 13:07:31 +09:00

1.1 KiB

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
aws AWS: aws_iam_user_policy docs-aws-resource-iam-user-policy Provides an IAM policy attached to a user.

aws_iam_user_policy

Provides an IAM policy attached to a user.

Example Usage

resource "aws_iam_user_policy" "lb_ro" {
    name = "test"
    user = "${aws_iam_user.lb.name}"
    policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "ec2:Describe*"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}
EOF
}

resource "aws_iam_user" "lb" {
    name = "loadbalancer"
    path = "/system/"
}

resource "aws_iam_access_key" "lb" {
    user = "${aws_iam_user.lb.name}"
}

Argument Reference

The following arguments are supported:

  • policy - (Required) The policy document. This is a JSON formatted string. The heredoc syntax or file function is helpful here.
  • name - (Required) Name of the policy.
  • user - (Required) IAM user to which to attach this policy.

Attributes Reference

This resource has no attributes.