diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml new file mode 100644 index 00000000..36c624bc --- /dev/null +++ b/.github/workflows/linters.yaml @@ -0,0 +1,9 @@ +--- +name: "Linters" + +on: + pull_request: + +jobs: + linters: + uses: camptocamp/devops-stack/.github/workflows/modules-linters.yaml@master diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 00000000..d2cd8e84 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,11 @@ +--- +name: "Release" + +on: + push: + branches: + - "main" + +jobs: + release: + uses: camptocamp/devops-stack/.github/workflows/modules-release-please.yaml@master diff --git a/.github/workflows/terraform-docs.yaml b/.github/workflows/terraform-docs.yaml new file mode 100644 index 00000000..6e00a348 --- /dev/null +++ b/.github/workflows/terraform-docs.yaml @@ -0,0 +1,11 @@ +--- +name: "Terraform Docs" + +on: + pull_request: + +jobs: + terraform-docs: + uses: camptocamp/devops-stack/.github/workflows/modules-terraform-docs.yaml@master + with: + variants: "aks,eks,k3s" diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..84efb577 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @camptocamp/is-devops-stack diff --git a/README.adoc b/README.adoc new file mode 100644 index 00000000..87e088e0 --- /dev/null +++ b/README.adoc @@ -0,0 +1,177 @@ +// BEGIN_TF_DOCS +=== Requirements + +No requirements. + +=== Providers + +The following providers are used by this module: + +- [[provider_argocd]] <> + +- [[provider_null]] <> + +- [[provider_utils]] <> + +=== Modules + +No modules. + +=== Resources + +The following resources are used by this module: + +- https://registry.terraform.io/providers/oboukili/argocd/latest/docs/resources/application[argocd_application.this] (resource) +- https://registry.terraform.io/providers/oboukili/argocd/latest/docs/resources/project[argocd_project.this] (resource) +- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.dependencies] (resource) +- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.this] (resource) +- https://registry.terraform.io/providers/cloudposse/utils/latest/docs/data-sources/deep_merge_yaml[utils_deep_merge_yaml.values] (data source) + +=== Required Inputs + +The following input variables are required: + +==== [[input_argocd_namespace]] <> + +Description: n/a + +Type: `string` + +==== [[input_base_domain]] <> + +Description: n/a + +Type: `string` + +==== [[input_cluster_name]] <> + +Description: n/a + +Type: `string` + +=== Optional Inputs + +The following input variables are optional (have default values): + +==== [[input_dependency_ids]] <> + +Description: n/a + +Type: `map(string)` + +Default: `{}` + +==== [[input_helm_values]] <> + +Description: Helm values, passed as a list of HCL structures. + +Type: `any` + +Default: `[]` + +==== [[input_namespace]] <> + +Description: n/a + +Type: `string` + +Default: `"loki-stack"` + +==== [[input_target_revision]] <> + +Description: Override of target revision of the application chart. + +Type: `string` + +Default: `"v1.0.0"` + +=== Outputs + +The following outputs are exported: + +==== [[output_id]] <> + +Description: n/a +// END_TF_DOCS +// BEGIN_TF_TABLES + + += Providers + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Version +|[[provider_argocd]] <> |n/a +|[[provider_null]] <> |n/a +|[[provider_utils]] <> |n/a +|=== + += Resources + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Type +|https://registry.terraform.io/providers/oboukili/argocd/latest/docs/resources/application[argocd_application.this] |resource +|https://registry.terraform.io/providers/oboukili/argocd/latest/docs/resources/project[argocd_project.this] |resource +|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.dependencies] |resource +|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.this] |resource +|https://registry.terraform.io/providers/cloudposse/utils/latest/docs/data-sources/deep_merge_yaml[utils_deep_merge_yaml.values] |data source +|=== + += Inputs + +[cols="a,a,a,a,a",options="header,autowidth"] +|=== +|Name |Description |Type |Default |Required +|[[input_argocd_namespace]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_base_domain]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_cluster_name]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_dependency_ids]] <> +|n/a +|`map(string)` +|`{}` +|no + +|[[input_helm_values]] <> +|Helm values, passed as a list of HCL structures. +|`any` +|`[]` +|no + +|[[input_namespace]] <> +|n/a +|`string` +|`"loki-stack"` +|no + +|[[input_target_revision]] <> +|Override of target revision of the application chart. +|`string` +|`"v1.0.0"` +|no + +|=== + += Outputs + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Description +|[[output_id]] <> |n/a +|=== +// END_TF_TABLES \ No newline at end of file diff --git a/aks/README.adoc b/aks/README.adoc new file mode 100644 index 00000000..f5347dda --- /dev/null +++ b/aks/README.adoc @@ -0,0 +1,228 @@ +// BEGIN_TF_DOCS +=== Requirements + +No requirements. + +=== Providers + +The following providers are used by this module: + +- [[provider_azurerm]] <> + +- [[provider_random]] <> + +=== Modules + +The following Modules are called: + +==== [[module_loki-stack]] <> + +Source: ../ + +Version: + +=== Resources + +The following resources are used by this module: + +- https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account[azurerm_storage_account.this] (resource) +- https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container[azurerm_storage_container.loki] (resource) +- https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string[random_string.storage_account] (resource) +- https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group[azurerm_resource_group.this] (data source) +- https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription[azurerm_subscription.primary] (data source) + +=== Required Inputs + +The following input variables are required: + +==== [[input_argocd_namespace]] <> + +Description: n/a + +Type: `string` + +==== [[input_base_domain]] <> + +Description: n/a + +Type: `string` + +==== [[input_cluster_name]] <> + +Description: n/a + +Type: `string` + +==== [[input_resource_group_name]] <> + +Description: The Resource Group where the Managed Kubernetes Cluster should exist. + +Type: `string` + +=== Optional Inputs + +The following input variables are optional (have default values): + +==== [[input_dependency_ids]] <> + +Description: n/a + +Type: `map(string)` + +Default: `{}` + +==== [[input_helm_values]] <> + +Description: Helm values, passed as a list of HCL structures. + +Type: `any` + +Default: `[]` + +==== [[input_namespace]] <> + +Description: n/a + +Type: `string` + +Default: `"loki-stack"` + +==== [[input_storage_account_replication_type]] <> + +Description: Storage account replication type for storing loki logs + +Type: `string` + +Default: `"LRS"` + +==== [[input_storage_account_tier]] <> + +Description: Storage account tier used for storing loki logs + +Type: `string` + +Default: `"Standard"` + +==== [[input_target_revision]] <> + +Description: Override of target revision of the application chart. + +Type: `string` + +Default: `"v1.0.0"` + +=== Outputs + +The following outputs are exported: + +==== [[output_id]] <> + +Description: n/a +// END_TF_DOCS +// BEGIN_TF_TABLES + + += Providers + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Version +|[[provider_azurerm]] <> |n/a +|[[provider_random]] <> |n/a +|=== + += Modules + +[cols="a,a,a",options="header,autowidth"] +|=== +|Name |Source |Version +|[[module_loki-stack]] <> |../ | +|=== + += Resources + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Type +|https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account[azurerm_storage_account.this] |resource +|https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container[azurerm_storage_container.loki] |resource +|https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string[random_string.storage_account] |resource +|https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group[azurerm_resource_group.this] |data source +|https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription[azurerm_subscription.primary] |data source +|=== + += Inputs + +[cols="a,a,a,a,a",options="header,autowidth"] +|=== +|Name |Description |Type |Default |Required +|[[input_argocd_namespace]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_base_domain]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_cluster_name]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_dependency_ids]] <> +|n/a +|`map(string)` +|`{}` +|no + +|[[input_helm_values]] <> +|Helm values, passed as a list of HCL structures. +|`any` +|`[]` +|no + +|[[input_namespace]] <> +|n/a +|`string` +|`"loki-stack"` +|no + +|[[input_resource_group_name]] <> +|The Resource Group where the Managed Kubernetes Cluster should exist. +|`string` +|n/a +|yes + +|[[input_storage_account_replication_type]] <> +|Storage account replication type for storing loki logs +|`string` +|`"LRS"` +|no + +|[[input_storage_account_tier]] <> +|Storage account tier used for storing loki logs +|`string` +|`"Standard"` +|no + +|[[input_target_revision]] <> +|Override of target revision of the application chart. +|`string` +|`"v1.0.0"` +|no + +|=== + += Outputs + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Description +|[[output_id]] <> |n/a +|=== +// END_TF_TABLES \ No newline at end of file diff --git a/eks/README.adoc b/eks/README.adoc new file mode 100644 index 00000000..8e2af90a --- /dev/null +++ b/eks/README.adoc @@ -0,0 +1,202 @@ +// BEGIN_TF_DOCS +=== Requirements + +No requirements. + +=== Providers + +The following providers are used by this module: + +- [[provider_aws]] <> + +=== Modules + +The following Modules are called: + +==== [[module_iam_assumable_role_loki]] <> + +Source: terraform-aws-modules/iam/aws//modules/iam-assumable-role-with-oidc + +Version: 4.0.0 + +==== [[module_loki-stack]] <> + +Source: ../ + +Version: + +=== Resources + +The following resources are used by this module: + +- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy[aws_iam_policy.loki] (resource) +- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket[aws_s3_bucket.loki] (resource) +- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document[aws_iam_policy_document.loki] (data source) +- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region[aws_region.current] (data source) + +=== Required Inputs + +The following input variables are required: + +==== [[input_argocd_namespace]] <> + +Description: n/a + +Type: `string` + +==== [[input_base_domain]] <> + +Description: n/a + +Type: `string` + +==== [[input_cluster_name]] <> + +Description: n/a + +Type: `string` + +==== [[input_cluster_oidc_issuer_url]] <> + +Description: n/a + +Type: `string` + +=== Optional Inputs + +The following input variables are optional (have default values): + +==== [[input_dependency_ids]] <> + +Description: n/a + +Type: `map(string)` + +Default: `{}` + +==== [[input_helm_values]] <> + +Description: Helm values, passed as a list of HCL structures. + +Type: `any` + +Default: `[]` + +==== [[input_namespace]] <> + +Description: n/a + +Type: `string` + +Default: `"loki-stack"` + +==== [[input_target_revision]] <> + +Description: Override of target revision of the application chart. + +Type: `string` + +Default: `"v1.0.0"` + +=== Outputs + +The following outputs are exported: + +==== [[output_id]] <> + +Description: n/a +// END_TF_DOCS +// BEGIN_TF_TABLES + + += Providers + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Version +|[[provider_aws]] <> |n/a +|=== + += Modules + +[cols="a,a,a",options="header,autowidth"] +|=== +|Name |Source |Version +|[[module_iam_assumable_role_loki]] <> |terraform-aws-modules/iam/aws//modules/iam-assumable-role-with-oidc |4.0.0 +|[[module_loki-stack]] <> |../ | +|=== + += Resources + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Type +|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy[aws_iam_policy.loki] |resource +|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket[aws_s3_bucket.loki] |resource +|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document[aws_iam_policy_document.loki] |data source +|https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region[aws_region.current] |data source +|=== + += Inputs + +[cols="a,a,a,a,a",options="header,autowidth"] +|=== +|Name |Description |Type |Default |Required +|[[input_argocd_namespace]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_base_domain]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_cluster_name]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_cluster_oidc_issuer_url]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_dependency_ids]] <> +|n/a +|`map(string)` +|`{}` +|no + +|[[input_helm_values]] <> +|Helm values, passed as a list of HCL structures. +|`any` +|`[]` +|no + +|[[input_namespace]] <> +|n/a +|`string` +|`"loki-stack"` +|no + +|[[input_target_revision]] <> +|Override of target revision of the application chart. +|`string` +|`"v1.0.0"` +|no + +|=== + += Outputs + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Description +|[[output_id]] <> |n/a +|=== +// END_TF_TABLES \ No newline at end of file diff --git a/k3s/README.adoc b/k3s/README.adoc new file mode 100644 index 00000000..ce428c02 --- /dev/null +++ b/k3s/README.adoc @@ -0,0 +1,169 @@ +// BEGIN_TF_DOCS +=== Requirements + +No requirements. + +=== Providers + +No providers. + +=== Modules + +The following Modules are called: + +==== [[module_loki-stack]] <> + +Source: ../ + +Version: + +=== Resources + +No resources. + +=== Required Inputs + +The following input variables are required: + +==== [[input_argocd_namespace]] <> + +Description: n/a + +Type: `string` + +==== [[input_base_domain]] <> + +Description: n/a + +Type: `string` + +==== [[input_cluster_name]] <> + +Description: n/a + +Type: `string` + +==== [[input_minio]] <> + +Description: n/a + +Type: `any` + +=== Optional Inputs + +The following input variables are optional (have default values): + +==== [[input_dependency_ids]] <> + +Description: n/a + +Type: `map(string)` + +Default: `{}` + +==== [[input_helm_values]] <> + +Description: Helm values, passed as a list of HCL structures. + +Type: `any` + +Default: `[]` + +==== [[input_namespace]] <> + +Description: n/a + +Type: `string` + +Default: `"loki-stack"` + +==== [[input_target_revision]] <> + +Description: Override of target revision of the application chart. + +Type: `string` + +Default: `"v1.0.0"` + +=== Outputs + +The following outputs are exported: + +==== [[output_id]] <> + +Description: n/a +// END_TF_DOCS +// BEGIN_TF_TABLES + + += Modules + +[cols="a,a,a",options="header,autowidth"] +|=== +|Name |Source |Version +|[[module_loki-stack]] <> |../ | +|=== + += Inputs + +[cols="a,a,a,a,a",options="header,autowidth"] +|=== +|Name |Description |Type |Default |Required +|[[input_argocd_namespace]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_base_domain]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_cluster_name]] <> +|n/a +|`string` +|n/a +|yes + +|[[input_dependency_ids]] <> +|n/a +|`map(string)` +|`{}` +|no + +|[[input_helm_values]] <> +|Helm values, passed as a list of HCL structures. +|`any` +|`[]` +|no + +|[[input_minio]] <> +|n/a +|`any` +|n/a +|yes + +|[[input_namespace]] <> +|n/a +|`string` +|`"loki-stack"` +|no + +|[[input_target_revision]] <> +|Override of target revision of the application chart. +|`string` +|`"v1.0.0"` +|no + +|=== + += Outputs + +[cols="a,a",options="header,autowidth"] +|=== +|Name |Description +|[[output_id]] <> |n/a +|=== +// END_TF_TABLES \ No newline at end of file diff --git a/main.tf b/main.tf index 24f39966..0b89de95 100644 --- a/main.tf +++ b/main.tf @@ -49,7 +49,7 @@ resource "argocd_application" "this" { source { repo_url = "https://github.com/camptocamp/devops-stack-module-loki-stack.git" path = "charts/loki-stack" - target_revision = "main" + target_revision = var.target_revision helm { values = data.utils_deep_merge_yaml.values.output } diff --git a/variables.tf b/variables.tf index f5199ae4..9267e3d9 100644 --- a/variables.tf +++ b/variables.tf @@ -14,6 +14,12 @@ variable "argocd_namespace" { type = string } +variable "target_revision" { + description = "Override of target revision of the application chart." + type = string + default = "v1.0.0" # x-release-please-version +} + variable "namespace" { type = string default = "loki-stack" diff --git a/version.txt b/version.txt new file mode 100644 index 00000000..3eefcb9d --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.0.0