chore(infrastructure): bootstrap CI
All checks were successful
main / test (push) Successful in 1m47s
All checks were successful
main / test (push) Successful in 1m47s
This commit is contained in:
parent
51bdcc5fc0
commit
959edc9d00
6 changed files with 115 additions and 0 deletions
38
infrastructure/tofu/main.tf
Normal file
38
infrastructure/tofu/main.tf
Normal file
|
@ -0,0 +1,38 @@
|
|||
locals {
|
||||
name = "tofu-module-aws-iam-user"
|
||||
}
|
||||
|
||||
module "aws_iam_ci_user" {
|
||||
providers = {
|
||||
aws.core = aws.all["core"]
|
||||
aws.root = aws.all["root"]
|
||||
aws.tests = aws.all["tests"]
|
||||
}
|
||||
source = "git::ssh://git@git.adyxax.org/adyxax/tofu-module-aws-iam-ci-user?depth=1&ref=1.0.1"
|
||||
|
||||
name = local.name
|
||||
}
|
||||
|
||||
resource "aws_iam_policy" "tftest" {
|
||||
provider = aws.all["root"]
|
||||
|
||||
name = "${local.name}-tftest"
|
||||
policy = jsonencode({
|
||||
Statement = [{
|
||||
Action = "iam:*"
|
||||
Effect = "Allow"
|
||||
Resource = [
|
||||
"arn:aws:iam::*:user/tftest-user",
|
||||
"arn:aws:iam::*:policy/${local.name}-tftest",
|
||||
]
|
||||
}]
|
||||
Version = "2012-10-17"
|
||||
})
|
||||
}
|
||||
|
||||
resource "aws_iam_user_policy_attachment" "tftest" {
|
||||
provider = aws.all["root"]
|
||||
|
||||
policy_arn = aws_iam_policy.tftest.arn
|
||||
user = local.name
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue