-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws_iam_role.ih-tf-aws-control-303467602807.tf
43 lines (39 loc) · 1.48 KB
/
aws_iam_role.ih-tf-aws-control-303467602807.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
# Roles for CI/CD in the aws-control-303467602807 repo
module "ih-tf-aws-control-303467602807-admin" {
source = "infrahouse/gha-admin/aws"
version = "~> 1.0"
providers = {
aws = aws.aws-303467602807-uw1
}
gh_identity_provider_arn = module.github-connector.gh_openid_connect_provider_arn
repo_name = "aws-control-303467602807"
state_bucket = "infrahouse-aws-control-303467602807"
gh_org_name = "infrahouse"
admin_allowed_arns = [
local.me_arn
]
}
data "aws_iam_policy_document" "ih-tf-aws-control-303467602807-read-only-assume" {
statement {
sid = "000"
actions = ["sts:AssumeRole"]
principals {
type = "AWS"
identifiers = [
"arn:aws:iam::990466748045:user/aleks",
"arn:aws:iam::493370826424:role/ih-tf-aws-control-493370826424-github"
]
}
}
}
resource "aws_iam_role" "ih-tf-aws-control-303467602807-read-only" {
provider = aws.aws-303467602807-uw1
name = "ih-tf-aws-control-303467602807-read-only"
description = "Role to provide read-only access to terraform in 493370826424 account"
assume_role_policy = data.aws_iam_policy_document.ih-tf-aws-control-303467602807-read-only-assume.json
}
resource "aws_iam_role_policy_attachment" "ih-tf-aws-control-303467602807-read-only" {
provider = aws.aws-303467602807-uw1
policy_arn = data.aws_iam_policy.read-only-access.arn
role = aws_iam_role.ih-tf-aws-control-303467602807-read-only.name
}