Skip to content

Commit c1dc7d5

Browse files
committed
fixing tags
1 parent d85c06a commit c1dc7d5

File tree

7 files changed

+14
-52
lines changed

7 files changed

+14
-52
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# 0.1.0
22
- Initial Release
3+
4+
# 0.1.1
5+
- Fixing Tags

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ module "aws_iam_user" {
3737
name = "test"
3838
force_destroy = true
3939
pgp_key = "keybase:test" # keybase user name
40-
owned_by = "example"
41-
managed_by = "terraform"
42-
pipeline_id = "123456" # this value is usually generated by your CI tool eg: Circle CI, Travis CI, Gitlab, etc.
4340
4441
tags = {
4542
BusinessUnit = "tools"
@@ -65,18 +62,15 @@ module "aws_iam_user" {
6562
| create_iam_user_login_profile | Whether to create IAM user login profile. | `bool` | `true` | no |
6663
| create_user | Whether to create the IAM user. | `bool` | `true` | no |
6764
| force_destroy | When destroying this user, destroy even if it has non-Terraform-managed IAM access keys, login profile or MFA devices. Without force_destroy a user with non-Terraform-managed access keys and login profile will fail to be destroyed. | `bool` | `false` | no |
68-
| managed_by | The name of the tool that manages the resources. | `string` | `""` | yes |
6965
| name | Desired name for the IAM user. | `string` | `n/a` | yes |
70-
| owned_by | The name of the company who owns the resources. | `string` | `""` | yes |
7166
| password_length | The length of the generated password. | `number` | `20` | no |
7267
| password_reset_required | Whether the user should be forced to reset the generated password on first login. | `bool` | `true` | no |
7368
| path | Desired path for the IAM user. | `string` | `"/"` | no |
7469
| permissions_boundary | The ARN of the policy that is used to set the permissions boundary for the user. | `string` | `""` | no |
7570
| pgp_key | Either a base-64 encoded PGP public key, or a keybase username in the form `keybase:username`. Used to encrypt password and access key. | `string` | `""` | yes |
76-
| pipeline_id | The CI pipeline id number. | `number` | `n/a` | no |
7771
| ssh_key_encoding | Specifies the public key encoding format to use in the response. To retrieve the public key in ssh-rsa format, use SSH. To retrieve the public key in PEM format, use PEM. | `string` | `"SSH"` | no |
7872
| ssh_public_key | The SSH public key. The public key must be encoded in ssh-rsa format or PEM format. | `string` | `""` | no |
79-
| tags | Additional tags. | `map(string)` | `{}` | no |
73+
| tags | A map of tags for the resources. | `map(string)` | `{}` | no |
8074
| upload_iam_user_ssh_key | Whether to upload a public ssh key to the IAM user. | `bool` | `false` | no |
8175

8276
## Outputs

examples/main.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ provider "aws" {
1515
module "aws_iam_user" {
1616
source = "../"
1717

18-
owned_by = var.owned_by
19-
managed_by = var.managed_by
2018
name = var.name
2119
force_destroy = var.force_destroy
2220
pgp_key = var.pgp_key
23-
pipeline_id = var.pipeline_id
21+
tags = var.tags
2422
}

examples/terraform.tfvars

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
region = "us-east-1"
2-
owned_by = "example"
3-
managed_by = "terraform"
4-
pipeline_id = 123456
52
name = "test"
63
force_destroy = true
74
pgp_key = "keybase:test"
5+
tags = {
6+
BusinessUnit = "tools"
7+
Application = "cicd"
8+
}

examples/variables.tf

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,7 @@ variable "pgp_key" {
1818
type = string
1919
}
2020

21-
variable "owned_by" {
22-
description = "The name of the company who owns the resources."
23-
type = string
24-
}
25-
26-
variable "managed_by" {
27-
description = "The name of the tool that manages the resources."
28-
type = string
29-
}
30-
31-
variable "pipeline_id" {
32-
description = "The CI pipeline id number."
33-
type = number
21+
variable "tags" {
22+
description = "A map of tags for the resources."
23+
type = map(string)
3424
}

main.tf

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ resource "aws_iam_user" "this" {
44
path = var.path
55
force_destroy = var.force_destroy
66
permissions_boundary = var.permissions_boundary
7-
tags = merge(
8-
{
9-
OwnedBy = var.owned_by
10-
ManagedBy = var.managed_by
11-
Pipeline_Id = var.pipeline_id
12-
},
13-
var.tags,
14-
)
7+
tags = var.tags
158
}
169

1710
resource "aws_iam_user_login_profile" "this" {

variables.tf

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,8 @@ variable "permissions_boundary" {
7575
default = ""
7676
}
7777

78-
variable "owned_by" {
79-
description = "The name of the company who owns the resources."
80-
type = string
81-
default = ""
82-
}
83-
84-
variable "managed_by" {
85-
description = "The name of the tool that manages the resources."
86-
type = string
87-
default = ""
88-
}
89-
90-
variable "pipeline_id" {
91-
description = "The CI pipeline id number."
92-
type = number
93-
}
94-
9578
variable "tags" {
96-
description = "Additional tags."
79+
description = "A map of tags for the resources."
9780
type = map(string)
9881
default = {}
9982
}

0 commit comments

Comments
 (0)