Created
November 6, 2019 23:47
-
-
Save joaquinclearmetal/8d2d6a0e9c798dca968c3883a88889c6 to your computer and use it in GitHub Desktop.
iam-user.main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "label" { | |
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.14.1" | |
namespace = var.namespace | |
stage = var.stage | |
name = var.name | |
attributes = var.attributes | |
delimiter = var.delimiter | |
tags = var.tags | |
enabled = var.enabled | |
} | |
# Defines a user that should be able to write to you test bucket | |
resource "aws_iam_user" "default" { | |
count = var.enabled ? 1 : 0 | |
name = module.label.id | |
path = var.path | |
force_destroy = var.force_destroy | |
} | |
# Generate API credentials | |
resource "aws_iam_access_key" "default" { | |
count = var.enabled ? 1 : 0 | |
user = aws_iam_user.default[0].name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment