fix: flattened variables for terraform
This commit is contained in:
@@ -1,24 +1,24 @@
|
|||||||
data "aws_s3_bucket" "storage_bucket" {
|
data "aws_s3_bucket" "storage_bucket" {
|
||||||
bucket = var.gitea_boot.bucket
|
bucket = var.boot_bucket
|
||||||
}
|
}
|
||||||
|
|
||||||
data "aws_iam_policy_document" "gitea_bool_policy" {
|
data "aws_iam_policy_document" "gitea_bool_policy" {
|
||||||
statement {
|
statement {
|
||||||
effect = "Allow"
|
effect = "Allow"
|
||||||
actions = ["s3:*", "s3-object-lambda:*"]
|
actions = ["s3:*", "s3-object-lambda:*"]
|
||||||
resources = ["${data.aws_s3_bucket.storage_bucket.arn}/${var.gitea_boot.key}"]
|
resources = ["${data.aws_s3_bucket.storage_bucket.arn}/${var.boot_key}"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_iam_policy" "gitea_boot_policy" {
|
resource "aws_iam_policy" "gitea_boot_policy" {
|
||||||
name = "${var.gitea_boot.role}Policy"
|
name = "${var.boot_role}Policy"
|
||||||
description = "The policy that manages the Gitea Boot."
|
description = "The policy that manages the Gitea Boot."
|
||||||
|
|
||||||
policy = data.aws_iam_policy_document.gitea_bool_policy.json
|
policy = data.aws_iam_policy_document.gitea_bool_policy.json
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_iam_user" "gitea_boot_user" {
|
resource "aws_iam_user" "gitea_boot_user" {
|
||||||
name = "${var.gitea_boot.role}User"
|
name = "${var.boot_role}User"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_iam_user_policy_attachment" "attachment" {
|
resource "aws_iam_user_policy_attachment" "attachment" {
|
||||||
|
|||||||
@@ -3,11 +3,17 @@ variable "region" {
|
|||||||
description = "The AWS region things are created in."
|
description = "The AWS region things are created in."
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "gitea_boot" {
|
variable "boot_bucket" {
|
||||||
type = object({
|
type = string
|
||||||
bucket = string
|
description = "The name of the bucket to store the boot in."
|
||||||
key = string
|
}
|
||||||
role = string
|
|
||||||
})
|
variable "boot_key" {
|
||||||
description = "The storage for the Gitea instance."
|
type = string
|
||||||
|
description = "The path that will hold the boot data."
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "boot_role" {
|
||||||
|
type = string
|
||||||
|
description = "The name of the role for boot access."
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user