Resource: awsIamUserPolicyAttachment
Attaches a Managed IAM Policy to an IAM user
\~> NOTE: The usage of this resource conflicts with the awsIamPolicyAttachment
resource and will permanently show a difference if both are defined.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsIamPolicyPolicy = new aws.iamPolicy.IamPolicy(this, "policy", {
description: "A test policy",
name: "test-policy",
policy: "{ ... policy JSON ... }",
});
const awsIamUserUser = new aws.iamUser.IamUser(this, "user", {
name: "test-user",
});
new aws.iamUserPolicyAttachment.IamUserPolicyAttachment(this, "test-attach", {
policyArn: awsIamPolicyPolicy.arn,
user: awsIamUserUser.name,
});
Argument Reference
The following arguments are supported:
user
(Required) - The user the policy should be applied topolicyArn
(Required) - The ARN of the policy you want to apply
Attributes Reference
No additional attributes are exported.
Import
IAM user policy attachments can be imported using the user name and policy arn separated by /
.