https://github.com/camptocamp/devops-stack-module-template
A DevOps Stack module to use as a template when creating modules
https://github.com/camptocamp/devops-stack-module-template
Last synced: 5 months ago
JSON representation
A DevOps Stack module to use as a template when creating modules
- Host: GitHub
- URL: https://github.com/camptocamp/devops-stack-module-template
- Owner: camptocamp
- License: apache-2.0
- Created: 2023-03-13T07:47:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-19T13:28:30.000Z (about 1 year ago)
- Last Synced: 2024-08-03T22:19:34.301Z (8 months ago)
- Language: HCL
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- jimsghstars - camptocamp/devops-stack-module-template - A DevOps Stack module to use as a template when creating modules (HCL)
README
= devops-stack-module-template
// Document attributes to replace along the document
// Here you can define variables for something that keeps repeating along the text
:CHART-DEPENDENCY-1-NAME-chart-version: 1.2.3
:CHART-DEPENDENCY-2-NAME-chart-version: 1.2.3
:original-repo-url: https://github.com/path/to/some/repositoryA https://devops-stack.io[DevOps Stack] module to deploy *_something_*.
The *_something_* chart used by this module is shipped in this repository as well, in order to avoid any unwanted behaviors caused by unsupported versions.
[cols="1,1,1",options="autowidth,header"]
|===
|Current Chart Version |Original Repository |Default Values
|*{CHART-DEPENDENCY-1-NAME-chart-version}* |{original-repo-url}/subpath/to/the/chart[Chart] |{original-repo-url}/subpath/to/the/values.yaml[`values.yaml`] (_here you can also use artifacthub.io_)
|===== Usage
_Here you will show examples of how to call this module on your code. Note that the `depends_on` needs to be adapted to your use case._
_You can start by giving a simple example and then show some others with increasing complexity and/or for specific use cases._
[source,terraform]
----
module "template" {
source = "git::https://github.com/camptocamp/devops-stack-module-template.git?ref="cluster_name = local.cluster_name
argocd_namespace = local.argocd_namespacedependency_ids = {
argocd = module.argocd_bootstrap.id
}
}
----=== Something Explained Better
_If there is some part of the module's configuration that needs more specific explanations, such as a very particular output on which every other module depends on, maybe consider creating a subsection to improve readability._
NOTE: _The AsciiDoc syntax provides a way to write admonitions such as this one, so use it if you think it is useful. The https://docs.antora.org/antora/latest/asciidoc/admonitions/[official documentation] for Antora Docs provides more examples._
== Technical Reference
_This section will contain the more technical details of the module. It is mainly generated automatically by Terraform Docs (everything that is between the comments `BEGIN_TF_DOCS` / `END_TF_DOCS`). However, it is recommended to, at the bare minimum, add a dependencies section to explain the reason on why this module could depend on another one from the DevOps Stack._
_You can safely delete the content between the comments `BEGIN_TF_DOCS` / `END_TF_DOCS` and `BEGIN_TF_TABLES` / `END_TF_TABLES` when creating your on module._
=== Dependencies
==== `module.argocd_bootstrap`
This module must be one of the first ones to be deployed and consequently it needs to be deployed after the module `argocd_bootstrap`.
// BEGIN_TF_DOCS
=== RequirementsThe following requirements are needed by this module:
- [[requirement_argocd]] <> (>= 6)
- [[requirement_null]] <> (>= 3)
- [[requirement_utils]] <> (>= 1)
=== Providers
The following providers are used by this module:
- [[provider_utils]] <> (>= 1)
- [[provider_argocd]] <> (>= 6)
- [[provider_null]] <> (>= 3)
=== Resources
The following resources are used by this module:
- https://registry.terraform.io/providers/argoproj-labs/argocd/latest/docs/resources/application[argocd_application.this] (resource)
- https://registry.terraform.io/providers/argoproj-labs/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_cluster_name]] <>
Description: Name given to the cluster. Value used for naming some the resources created by the module.
Type: `string`
==== [[input_base_domain]] <>
Description: Base domain of the cluster. Value used for the ingress' URL of the application.
Type: `string`
=== Optional Inputs
The following input variables are optional (have default values):
==== [[input_argocd_project]] <>
Description: Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application.
Type: `string`
Default: `null`
==== [[input_argocd_labels]] <>
Description: Labels to attach to the Argo CD Application resource.
Type: `map(string)`
Default: `{}`
==== [[input_destination_cluster]] <>
Description: Destination cluster where the application should be deployed.
Type: `string`
Default: `"in-cluster"`
==== [[input_target_revision]] <>
Description: Override of target revision of the application chart.
Type: `string`
Default: `"v1.0.0"`
==== [[input_cluster_issuer]] <>
Description: SSL certificate issuer to use. Usually you would configure this value as `letsencrypt-staging` or `letsencrypt-prod` on your root `*.tf` files.
Type: `string`
Default: `"selfsigned-issuer"`
==== [[input_helm_values]] <>
Description: Helm chart value overrides. They should be passed as a list of HCL structures.
Type: `any`
Default: `[]`
==== [[input_deep_merge_append_list]] <>
Description: A boolean flag to enable/disable appending lists instead of overwriting them.
Type: `bool`
Default: `false`
==== [[input_app_autosync]] <>
Description: Automated sync options for the Argo CD Application resource.
Type:
[source,hcl]
----
object({
allow_empty = optional(bool)
prune = optional(bool)
self_heal = optional(bool)
})
----Default:
[source,json]
----
{
"allow_empty": false,
"prune": true,
"self_heal": true
}
----==== [[input_dependency_ids]] <>
Description: IDs of the other modules on which this module depends on.
Type: `map(string)`
Default: `{}`
=== Outputs
The following outputs are exported:
==== [[output_id]] <>
Description: ID to pass other modules in order to refer to this module as a dependency.
// END_TF_DOCS=== Reference in table format
.Show tables
[%collapsible]
====
// BEGIN_TF_TABLES
= Requirements[cols="a,a",options="header,autowidth"]
|===
|Name |Version
|[[requirement_argocd]] <> |>= 6
|[[requirement_null]] <> |>= 3
|[[requirement_utils]] <> |>= 1
|==== Providers
[cols="a,a",options="header,autowidth"]
|===
|Name |Version
|[[provider_null]] <> |>= 3
|[[provider_argocd]] <> |>= 6
|[[provider_utils]] <> |>= 1
|==== Resources
[cols="a,a",options="header,autowidth"]
|===
|Name |Type
|https://registry.terraform.io/providers/argoproj-labs/argocd/latest/docs/resources/application[argocd_application.this] |resource
|https://registry.terraform.io/providers/argoproj-labs/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_cluster_name]] <>
|Name given to the cluster. Value used for naming some the resources created by the module.
|`string`
|n/a
|yes|[[input_base_domain]] <>
|Base domain of the cluster. Value used for the ingress' URL of the application.
|`string`
|n/a
|yes|[[input_argocd_project]] <>
|Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application.
|`string`
|`null`
|no|[[input_argocd_labels]] <>
|Labels to attach to the Argo CD Application resource.
|`map(string)`
|`{}`
|no|[[input_destination_cluster]] <>
|Destination cluster where the application should be deployed.
|`string`
|`"in-cluster"`
|no|[[input_target_revision]] <>
|Override of target revision of the application chart.
|`string`
|`"v1.0.0"`
|no|[[input_cluster_issuer]] <>
|SSL certificate issuer to use. Usually you would configure this value as `letsencrypt-staging` or `letsencrypt-prod` on your root `*.tf` files.
|`string`
|`"selfsigned-issuer"`
|no|[[input_helm_values]] <>
|Helm chart value overrides. They should be passed as a list of HCL structures.
|`any`
|`[]`
|no|[[input_deep_merge_append_list]] <>
|A boolean flag to enable/disable appending lists instead of overwriting them.
|`bool`
|`false`
|no|[[input_app_autosync]] <>
|Automated sync options for the Argo CD Application resource.
|[source]
----
object({
allow_empty = optional(bool)
prune = optional(bool)
self_heal = optional(bool)
})
----|
[source]
----
{
"allow_empty": false,
"prune": true,
"self_heal": true
}
----|no
|[[input_dependency_ids]] <>
|IDs of the other modules on which this module depends on.
|`map(string)`
|`{}`
|no|===
= Outputs
[cols="a,a",options="header,autowidth"]
|===
|Name |Description
|[[output_id]] <> |ID to pass other modules in order to refer to this module as a dependency.
|===
// END_TF_TABLES
====