-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathREADME.tfdoc.hcl
486 lines (421 loc) · 14.3 KB
/
README.tfdoc.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
header {
image = "https://raw.githubusercontent.com/mineiros-io/brand/3bffd30e8bdbbde32c143e2650b2faa55f1df3ea/mineiros-primary-logo.svg"
url = "https://mineiros.io/?ref=terraform-aws-iam-user"
badge "build" {
image = "https://github.com/mineiros-io/terraform-aws-iam-user/workflows/CI/CD%20Pipeline/badge.svg"
url = "https://github.com/mineiros-io/terraform-aws-iam-user/actions"
text = "Build Status"
}
badge "semver" {
image = "https://img.shields.io/github/v/tag/mineiros-io/terraform-aws-iam-user.svg?label=latest&sort=semver"
url = "https://github.com/mineiros-io/terraform-aws-iam-user/releases"
text = "GitHub tag (latest SemVer)"
}
badge "terraform" {
image = "https://img.shields.io/badge/terraform-1.x%20|%200.15%20|%200.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform"
url = "https://github.com/hashicorp/terraform/releases"
text = "Terraform Version"
}
badge "tf-aws-provider" {
image = "https://img.shields.io/badge/AWS-3%20and%202.0+-F8991D.svg?logo=terraform"
url = "https://github.com/terraform-providers/terraform-provider-aws/releases"
text = "AWS Provider Version"
}
badge "slack" {
image = "https://img.shields.io/badge/slack-@mineiros--community-f32752.svg?logo=slack"
url = "https://mineiros.io/slack"
text = "Join Slack"
}
}
section {
title = "terraform-aws-iam-user"
toc = true
content = <<-END
A [Terraform](https://www.terraform.io) base module for deploying and managing
[IAM Users][IAM-User-Docs] on [Amazon Web Services][AWS].
***This module supports Terraform v1.x, v0.15, v0.14, v0.13 as well as v0.12.20 and above
and is compatible with the terraform AWS provider v3 as well as v2.0 and above.***
END
section {
title = "Module Features"
content = <<-END
In contrast to the plain `aws_iam_user` resource, this module has extended features allowing you
to add custom & managed IAM and/or inline policies and adding user to groups.
While all security features can be disabled as needed, best practices
are pre-configured.
- **Standard Module Features**:
Add IAM users
- **Extended Module Features**:
Attach custom & managed IAM policies,
attach an inline policy,
add users to a set of groups
END
}
section {
title = "Getting Started"
content = <<-END
Most basic usage showing how to add three users and assigning two policies:
```hcl
module "iam-users" {
source = "mineiros-io/iam-user/aws"
version = "~> 0.5.0"
names = [
"user.one",
"user.two",
"user.three",
]
policy_arns = [
"arn:aws:iam::aws:policy/ReadOnlyAccess",
"arn:aws:iam::aws:policy/job-function/Billing",
]
}
```
END
}
section {
title = "Module Argument Reference"
content = <<-END
See
[variables.tf]
and
[examples]
for details and use-cases.
END
section {
title = "Module Configuration"
variable "module_enabled" {
type = bool
default = true
description = <<-END
Specifies whether resources in the module will be created.
END
}
variable "module_depends_on" {
type = set(any)
description = <<-END
A set of dependencies. Any object can be assigned to this list to define a hidden external dependency.
END
}
}
section {
title = "Top-level Arguments"
section {
title = "Main Resource Configuration"
variable "names" {
required = true
type = set(string)
description = <<-END
A set of names of IAM users that will be created. Forces new resource.
END
}
variable "groups" {
type = set(string)
default = []
description = <<-END
A set of IAM groups to add the user(s) to.
END
}
variable "force_destroy" {
type = bool
default = false
description = <<-END
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.
END
}
variable "path" {
type = string
default = "/"
description = <<-END
The path in which to create the user(s). See [IAM Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) for more information.
END
}
variable "permissions_boundary" {
type = string
description = <<-END
The ARN of the policy that is used to set the permissions boundary for the user.
Default is not to set any boundary.
END
}
variable "tags" {
type = map(string)
default = {}
description = <<-END
Key-value map of tags for the IAM user.
END
}
}
section {
title = "Extended Resource configuration"
section {
title = "Custom & Managed Policies"
variable "policy_arns" {
type = list(string)
default = []
description = <<-END
List of custom or managed IAM policy ARNs to attach to the user.
END
}
}
section {
title = "Inline Policy"
variable "policy_statements" {
type = list(statement)
default = []
description = <<-END
List of IAM policy statements to attach to the user as an inline policy.
END
readme_example = <<-END
policy_statements = [
{
sid = "FullS3Access"
effect = "Allow"
actions = ["s3:*"]
not_actions = []
resources = ["*"]
not_resources = []
conditions = [
{
test = "Bool"
variable = "aws:MultiFactorAuthPresent"
values = ["true"]
}
]
}
]
END
}
}
}
}
}
section {
title = "Module Outputs"
content = <<-END
The following attributes are exported by the module:
END
output "users" {
type = list(user)
description = <<-END
The `aws_iam_user` object(s).
END
}
output "user_policy" {
type = object(user_policy)
description = <<-END
The `aws_iam_user_policy` object(s).
END
}
output "user_policy_attachment" {
type = object(user_policy_attachment)
description = <<-END
The `aws_iam_user_policy_attachment` object(s).
END
}
output "names" {
type = set(string)
description = <<-END
The user names.
END
}
output "path" {
type = string
description = <<-END
Path in which to create the user.
END
}
output "permissions_boundary" {
type = string
description = <<-END
The ARN of the policy that is used to set the permissions boundary for
the user.
END
}
output "force_destroy" {
type = bool
description = <<-END
When destroying this user, destroy even if it has non-Terraform-managed
IAM access keys, login profile or MFA devices.
END
}
output "tags" {
type = map(string)
description = <<-END
Key-value map of tags for the IAM user.
END
}
output "policy_statements" {
type = list(policy_statement)
description = <<-END
List of IAM policy statements to attach to the User as an inline policy.
END
}
output "policy_arns" {
type = set(string)
description = <<-END
Set of IAM custom or managed policies ARNs attached to the User.
END
}
output "groups" {
type = list(string)
description = <<-END
List of IAM groups the users were added to.
END
}
}
section {
title = "External Documentation"
section {
title = "AWS Documentation IAM"
content = <<-END
- User: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html
- Policies: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
END
}
section {
title = "Terraform AWS Provider Documentation"
content = <<-END
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_policy_attachment
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user_group_membership
END
}
}
section {
title = "Module Versioning"
content = <<-END
This Module follows the principles of [Semantic Versioning (SemVer)].
Given a version number `MAJOR.MINOR.PATCH`, we increment the:
1. `MAJOR` version when we make incompatible changes,
2. `MINOR` version when we add functionality in a backwards compatible manner, and
3. `PATCH` version when we make backwards compatible bug fixes.
END
section {
title = "Backwards compatibility in `0.0.z` and `0.y.z` version"
content = <<-END
- Backwards compatibility in versions `0.0.z` is **not guaranteed** when `z` is increased. (Initial development)
- Backwards compatibility in versions `0.y.z` is **not guaranteed** when `y` is increased. (Pre-release)
END
}
}
section {
title = "About Mineiros"
content = <<-END
Mineiros is a [DevOps as a Service][homepage] company based in Berlin, Germany.
We offer commercial support for all of our projects and encourage you to reach out
if you have any questions or need help. Feel free to send us an email at [hello@mineiros.io] or join our [Community Slack channel][slack].
We can also help you with:
- Terraform modules for all types of infrastructure such as VPCs, Docker clusters, databases, logging and monitoring, CI, etc.
- Consulting & training on AWS, Terraform and DevOps
END
}
section {
title = "Reporting Issues"
content = <<-END
We use GitHub [Issues] to track community reported issues and missing features.
END
}
section {
title = "Contributing"
content = <<-END
Contributions are always encouraged and welcome! For the process of accepting changes, we use
[Pull Requests]. If you'd like more information, please see our [Contribution Guidelines].
END
}
section {
title = "Makefile Targets"
content = <<-END
This repository comes with a handy [Makefile].
Run `make help` to see details on each available target.
END
}
section {
title = "License"
content = <<-END
[![license][badge-license]][apache20]
This module is licensed under the Apache License Version 2.0, January 2004.
Please see [LICENSE] for full details.
Copyright © 2020-2022 [Mineiros GmbH][homepage]
END
}
}
references {
ref "homepage" {
value = "https://mineiros.io/?ref=terraform-aws-iam-user"
}
ref "hello@mineiros.io" {
value = "mailto:hello@mineiros.io"
}
ref "badge-build" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/workflows/CI/CD%20Pipeline/badge.svg"
}
ref "badge-semver" {
value = "https://img.shields.io/github/v/tag/mineiros-io/terraform-aws-iam-user.svg?label=latest&sort=semver"
}
ref "badge-license" {
value = "https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg"
}
ref "badge-terraform" {
value = "https://img.shields.io/badge/terraform-1.x%20|%200.15%20|%200.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform"
}
ref "badge-slack" {
value = "https://img.shields.io/badge/slack-@mineiros--community-f32752.svg?logo=slack"
}
ref "badge-tf-aws" {
value = "https://img.shields.io/badge/AWS-3%20and%202.0+-F8991D.svg?logo=terraform"
}
ref "releases-aws-provider" {
value = "https://github.com/terraform-providers/terraform-provider-aws/releases"
}
ref "build-status" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/actions"
}
ref "releases-github" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/releases"
}
ref "releases-terraform" {
value = "https://github.com/hashicorp/terraform/releases"
}
ref "apache20" {
value = "https://opensource.org/licenses/Apache-2.0"
}
ref "slack" {
value = "https://join.slack.com/t/mineiros-community/shared_invite/zt-ehidestg-aLGoIENLVs6tvwJ11w9WGg"
}
ref "Terraform" {
value = "https://www.terraform.io"
}
ref "AWS" {
value = "https://aws.amazon.com/"
}
ref "IAM-User-Docs" {
value = "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html"
}
ref "Semantic Versioning (SemVer)" {
value = "https://semver.org/"
}
ref "examples/example/main.tf" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/blob/master/examples/example/main.tf"
}
ref "variables.tf" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/blob/master/variables.tf"
}
ref "examples/" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/blob/master/examples"
}
ref "Issues" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/issues"
}
ref "LICENSE" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/blob/master/LICENSE"
}
ref "Makefile" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/blob/master/Makefile"
}
ref "Pull Requests" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/pulls"
}
ref "Contribution Guidelines" {
value = "https://github.com/mineiros-io/terraform-aws-iam-user/blob/master/CONTRIBUTING.md"
}
}