mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-13 10:01:08 -04:00
1.2 KiB
1.2 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 orfilefunction is helpful here.name- (Optional) The name of the policy. If omitted, Terraform will assign a random, unique name.name_prefix- (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts withname.user- (Required) IAM user to which to attach this policy.
Attributes Reference
This resource has no attributes.