From ed95108e9590d08e1d887e90d177b31b861ff1e5 Mon Sep 17 00:00:00 2001 From: michaeljguarino Date: Sun, 22 Sep 2024 15:02:35 -0400 Subject: [PATCH] add s3 bucket module --- terraform/modules/blob/s3/bucket.tf | 13 +++++++++++++ terraform/modules/blob/s3/variables.tf | 8 ++++++++ terraform/modules/blob/s3/versions.tf | 13 +++++++++++++ terraform/modules/clusters/aws/addons.tf | 7 ++++++- 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 terraform/modules/blob/s3/bucket.tf create mode 100644 terraform/modules/blob/s3/variables.tf create mode 100644 terraform/modules/blob/s3/versions.tf diff --git a/terraform/modules/blob/s3/bucket.tf b/terraform/modules/blob/s3/bucket.tf new file mode 100644 index 0000000..8662c71 --- /dev/null +++ b/terraform/modules/blob/s3/bucket.tf @@ -0,0 +1,13 @@ +module "s3_bucket" { + source = "terraform-aws-modules/s3-bucket/aws" + + bucket = var.bucket_name + acl = "private" + + control_object_ownership = true + object_ownership = "ObjectWriter" + + versioning = { + enabled = true + } +} \ No newline at end of file diff --git a/terraform/modules/blob/s3/variables.tf b/terraform/modules/blob/s3/variables.tf new file mode 100644 index 0000000..22cd958 --- /dev/null +++ b/terraform/modules/blob/s3/variables.tf @@ -0,0 +1,8 @@ +variable "bucket_name" { + type = string +} + +variable "region" { + type = string + default = "us-east-2" +} \ No newline at end of file diff --git a/terraform/modules/blob/s3/versions.tf b/terraform/modules/blob/s3/versions.tf new file mode 100644 index 0000000..8ffcdee --- /dev/null +++ b/terraform/modules/blob/s3/versions.tf @@ -0,0 +1,13 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + } + } +} + +provider "aws" { + region = var.region +} diff --git a/terraform/modules/clusters/aws/addons.tf b/terraform/modules/clusters/aws/addons.tf index 2daa324..02164d0 100644 --- a/terraform/modules/clusters/aws/addons.tf +++ b/terraform/modules/clusters/aws/addons.tf @@ -69,11 +69,16 @@ module "externaldns_irsa_role" { role_name = "${module.eks.cluster_name}-externaldns" attach_external_dns_policy = true + attach_cert_manager_policy = true oidc_providers = { main = { provider_arn = module.eks.oidc_provider_arn - namespace_service_accounts = ["plural-runtime:external-dns"] + namespace_service_accounts = [ + "plural-runtime:external-dns", + "external-dns:external-dns", + "cert-manager:cert-manager" + ] } } } \ No newline at end of file