-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
30 lines (24 loc) · 962 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
resource "aws_iam_openid_connect_provider" "this" {
count = var.create_identity_provider ? 1 : 0
url = var.url
client_id_list = var.client_id_list
thumbprint_list = var.thumbprint_list
tags = var.tags
}
module "iam_assumable_role_admin" {
source = "terraform-aws-modules/iam/aws//modules/iam-assumable-role-with-oidc"
version = "3.6.0"
create_role = true
role_name = var.name
provider_url = var.url
role_policy_arns = [aws_iam_policy.iam_policy.arn]
oidc_fully_qualified_subjects = var.validate_conditions
oidc_subjects_with_wildcards = var.validate_wildcard_conditions
tags = var.tags
}
resource "aws_iam_policy" "iam_policy" {
name_prefix = var.name
description = "IAM Policy for the Github OIDC Federation permissions"
policy = var.aws_policy_json
tags = var.tags
}