-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain.tf
31 lines (26 loc) · 934 Bytes
/
main.tf
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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# CREATE MULTIPLE IAM USERS AT ONCE
# This example shows how to create multiple users at once by passing a list
# of desired usernames to the module. We also attach some default IAM Policies
# to the created users.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
provider "aws" {
version = "~> 2.0"
region = "eu-west-1"
}
# ------------------------------------------------------------------------------
# CREATE THE IAM USERS AND ATTACH DEFAULT IAM POLICIES
# ------------------------------------------------------------------------------
module "iam-users" {
source = "mineiros-io/iam-user/aws"
version = "~> 0.1.0"
names = [
"user.one",
"user.two",
"user.three",
]
policy_arns = [
"arn:aws:iam::aws:policy/ReadOnlyAccess",
"arn:aws:iam::aws:policy/job-function/Billing",
]
}