-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathmain.tf
58 lines (44 loc) · 1.36 KB
/
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
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
provider "aws" {
region = "eu-west-1"
}
resource "aws_iam_saml_provider" "idp_saml" {
name = "idp_saml"
saml_metadata_document = file("saml-metadata.xml")
}
resource "aws_iam_saml_provider" "second_idp_saml" {
name = "second_idp_saml"
saml_metadata_document = file("saml-metadata.xml")
}
###############################
# IAM assumable role for admin
###############################
module "iam_assumable_role_admin" {
source = "../../modules/iam-assumable-role-with-saml"
create_role = true
role_name = "role-with-saml"
tags = {
Role = "role-with-saml"
}
provider_id = aws_iam_saml_provider.idp_saml.id
provider_ids = [aws_iam_saml_provider.second_idp_saml.id]
role_policy_arns = [
"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
]
}
#####################################
# IAM assumable role with self assume
#####################################
module "iam_assumable_role_self_assume" {
source = "../../modules/iam-assumable-role-with-saml"
create_role = true
allow_self_assume_role = true
role_name = "role-with-saml-self-assume"
tags = {
Role = "role-with-saml-self-assume"
}
provider_id = aws_iam_saml_provider.idp_saml.id
provider_ids = [aws_iam_saml_provider.second_idp_saml.id]
role_policy_arns = [
"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
]
}