Skip to content

Commit

Permalink
🎨 style(lints): reslove lint output from tflint
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Aug 6, 2024
1 parent c983649 commit 6799f99
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 38 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
### 🎨🏗️ Style & Architecture

- **repo**: install repo features pre-commit and commitizen

# CHANGELOG
* 0.0.2 -- 2024-07-30
- update images module
- formatting
- fix for tags
* 0.0.1 -- 2024-07-22
- updated version.tf to 0.0.1
- included module.images in depends on helm charts
- created changelog
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ to loki.



# CHANGELOG
* 0.0.2 -- 2024-07-30
- update images module
- formatting
- fix for tags
* 0.0.1 -- 2024-07-22
- updated version.tf to 0.0.1
- included module.images in depends on helm charts
- created changelog


<!-- BEGIN_TF_DOCS -->
## Requirements
Expand All @@ -28,24 +20,22 @@ to loki.
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.14.0 |
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.11.0 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.23.0 |
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.2.1 |
| <a name="requirement_template"></a> [template](#requirement\_template) | >= 2.2.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.14.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.11.0 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.23.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.61.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | 2.14.0 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.31.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_images"></a> [images](#module\_images) | git@github.e.it.census.gov:terraform-modules/aws-ecr-copy-images.git/ | tf-upgrade |
| <a name="module_loki-irsa-role"></a> [loki-irsa-role](#module\_loki-irsa-role) | git@github.it.census.gov:SOA/tfmod-custom-iam-role-for-service-account-eks.git/ | n/a |
| <a name="module_loki-s3"></a> [loki-s3](#module\_loki-s3) | git@github.e.it.census.gov:terraform-modules/aws-s3.git//standard | tf-upgrade |
| <a name="module_loki_irsa_role"></a> [loki\_irsa\_role](#module\_loki\_irsa\_role) | terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks | n/a |
| <a name="module_loki_s3"></a> [loki\_s3](#module\_loki\_s3) | git@github.e.it.census.gov:terraform-modules/aws-s3.git//standard | tf-upgrade |

## Resources

Expand All @@ -55,13 +45,12 @@ to loki.
| [kubernetes_namespace.ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_s3_bucket.s3_server_access_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/s3_bucket) | data source |
| [kubernetes_namespace.existing-ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/namespace) | data source |
| [kubernetes_namespace.existing_ns](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/namespace) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_additional_tags"></a> [additional\_tags](#input\_additional\_tags) | Additional tags to add to resources created in AWS (s3 bucket, ...) | `map(string)` | `{}` | no |
| <a name="input_canary_tag"></a> [canary\_tag](#input\_canary\_tag) | The tag of the grafana/loki-canary image to use. | `string` | `"3.0.0"` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev) | `string` | n/a | yes |
| <a name="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace) | Indicates whether the `namespace` needs to be created ('true') or already exists (not `true`) | `string` | `"true"` | no |
Expand All @@ -78,6 +67,7 @@ to loki.
| <a name="input_rwo_storage_class"></a> [rwo\_storage\_class](#input\_rwo\_storage\_class) | Specify the storage class for read/write/once persistent volumes. | `string` | `"gp3-encrypted"` | no |
| <a name="input_sidecar_tag"></a> [sidecar\_tag](#input\_sidecar\_tag) | The version of kiwigrid/k8s-sidecar to use for the gateway. | `string` | `"1.24.3"` | no |
| <a name="input_tag_costallocation"></a> [tag\_costallocation](#input\_tag\_costallocation) | Tag CostAllocation (default) | `string` | `"csvd:infrastructure"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags to add to resources created in AWS (s3 bucket, ...) | `map(string)` | `{}` | no |

## Outputs

Expand Down
16 changes: 8 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "kubernetes_namespace" "ns" {
}
}

data "kubernetes_namespace" "existing-ns" {
data "kubernetes_namespace" "existing_ns" {
count = var.create_namespace == "true" ? 0 : 1

metadata {
Expand All @@ -26,18 +26,18 @@ data "kubernetes_namespace" "existing-ns" {
locals {
tags = merge({
"eks-cluster-name" = var.cluster_name
"boc:tf_module_name" = local._module_name
"boc:tf_module_version" = local._module_version
"boc:tf_module_name" = local.module_name
"boc:tf_module_version" = local.module_version
"boc:created_by" = "terraform"
CostAllocation = var.tag_costallocation
}, var.tags)

ns = try(kubernetes_namespace.ns[0].metadata[0].name, data.kubernetes_namespace.existing-ns[0].metadata[0].name)
ns = try(kubernetes_namespace.ns[0].metadata[0].name, data.kubernetes_namespace.existing_ns[0].metadata[0].name)
}

module "loki-irsa-role" {
#source = "git@github.it.census.gov:SOA/tfmod-custom-iam-role-for-service-account-eks.git/?ref=1.0.0"
source = "git@github.it.census.gov:SOA/tfmod-custom-iam-role-for-service-account-eks.git/"
# tflint-ignore: terraform_module_version
module "loki_irsa_role" {
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"

role_name = "${var.cluster_name}-loki"

Expand All @@ -49,7 +49,7 @@ module "loki-irsa-role" {
"${module.loki-s3.s3_bucket_arn}/*",
]
kms_key_arns = [
"${module.loki-s3.kms_key_arn}"
module.loki-s3.kms_key_arn
]

oidc_providers = {
Expand Down
8 changes: 0 additions & 8 deletions requirements.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,5 @@ terraform {
source = "hashicorp/kubernetes"
version = ">= 2.23.0"
}
null = {
source = "hashicorp/null"
version = ">= 3.2.1"
}
template = {
source = "hashicorp/template"
version = ">= 2.2.0"
}
}
}
2 changes: 1 addition & 1 deletion s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data "aws_s3_bucket" "s3_server_access_logs" {
bucket = format("inf-logs-%v-%v", local.account_id, var.region)
}

module "loki-s3" {
module "loki_s3" {
source = "git@github.e.it.census.gov:terraform-modules/aws-s3.git//standard?ref=tf-upgrade"

bucket_name = format("%v-loki", var.cluster_name)
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variable "tag_costallocation" {
default = "csvd:infrastructure"
}

variable "additional_tags" {
variable "tags" {
description = "Additional tags to add to resources created in AWS (s3 bucket, ...)"
type = map(string)
default = {}
Expand Down
4 changes: 2 additions & 2 deletions version.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
locals {
_module_name = "tfmod-loki"
_module_version = "0.0.2"
module_name = "tfmod-loki"
module_version = "0.0.2"
}

0 comments on commit 6799f99

Please sign in to comment.