File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ resource "aws_iam_user" "this" {
2+ name = var. user_name
3+ }
4+
5+ resource "aws_iam_access_key" "this" {
6+ user = aws_iam_user. this . name
7+ }
8+
9+ resource "aws_iam_user_policy_attachment" "this" {
10+ user = aws_iam_user. this . name
11+ policy_arn = var. policy_arn
12+ }
Original file line number Diff line number Diff line change 1+ output "aws_iam_user" {
2+ value = aws_iam_user. this . name
3+ }
4+
5+ output "aws_iam_user_policy_arn" {
6+ value = aws_iam_user_policy_attachment. this . policy_arn
7+ }
8+
9+ output "access_key" {
10+ value = aws_iam_access_key. this . id
11+ }
12+
13+ output "secret_key" {
14+ value = aws_iam_access_key. this . secret
15+ }
Original file line number Diff line number Diff line change 1+ variable "user_name" {
2+ type = string
3+ description = " (Required) The user's name."
4+ }
5+
6+ variable "policy_arn" {
7+ type = string
8+ description = " (Required) The ARN of the policy you want to apply"
9+ }
You can’t perform that action at this time.
0 commit comments