diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 119cfd2..9e4f2d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: # args: [--branch, main] - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.101.1 + rev: v1.108.0 hooks: - id: tfupdate name: Autoupdate Terraform versions @@ -62,6 +62,10 @@ repos: name: Autoupdate pass provider versions args: - --args=provider mecodia/pass --version ">= 3.1.0, < 4.0.0" + - id: tfupdate + name: Autoupdate null provider versions + args: + - --args=provider hashicorp/null --version ">= 3.3.0, < 4.0.0" # This hook is configured to run only in manual stage to avoid unnecessary provider lock file updates on every commit. # Run this hook manually when you need to update the provider lock file across all supported platforms. - id: terraform_providers_lock diff --git a/misc/null/.tflint.hcl b/misc/null/.tflint.hcl new file mode 100644 index 0000000..427121c --- /dev/null +++ b/misc/null/.tflint.hcl @@ -0,0 +1,4 @@ +plugin "terraform" { + enabled = true + preset = "recommended" +} diff --git a/misc/null/README.md b/misc/null/README.md new file mode 100644 index 0000000..2f8a8ea --- /dev/null +++ b/misc/null/README.md @@ -0,0 +1,44 @@ +# template module + +A terraform module for creating "null resources". +Using . + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | ~> 1.3 | +| [null](#requirement\_null) | ~> 3.3.0 | +| [time](#requirement\_time) | ~> 0.9.1 | + +## Providers + +| Name | Version | +|------|---------| +| [null](#provider\_null) | ~> 3.3.0 | +| [time](#provider\_time) | ~> 0.9.1 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [null_resource.main](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | +| [time_static.last_update](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/static) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [customer](#input\_customer) | Customer for the current deployment | `string` | `""` | no | +| [name](#input\_name) | The name of the template resource | `string` | `"my-template"` | no | +| [tags](#input\_tags) | Default tags to add to resources | `map(any)` | `{}` | no | + +## Outputs + +No outputs. + diff --git a/misc/null/main.tf b/misc/null/main.tf new file mode 100644 index 0000000..b5f8ba8 --- /dev/null +++ b/misc/null/main.tf @@ -0,0 +1,14 @@ +locals { + # tflint-ignore: terraform_unused_declarations + interpolated_tags = merge({ + "Name" = var.name, + "Customer" = var.customer, + "ManagedBy" = "Terraform", + "LastModifiedAt" = time_static.last_update.rfc3339, + }, + var.tags + ) +} + +resource "time_static" "last_update" { +} diff --git a/misc/null/null.tf b/misc/null/null.tf new file mode 100644 index 0000000..7f319f4 --- /dev/null +++ b/misc/null/null.tf @@ -0,0 +1,3 @@ +resource "null_resource" "main" { + +} diff --git a/misc/null/outputs.tf b/misc/null/outputs.tf new file mode 100644 index 0000000..e69de29 diff --git a/misc/null/providers.tf b/misc/null/providers.tf new file mode 100644 index 0000000..3984487 --- /dev/null +++ b/misc/null/providers.tf @@ -0,0 +1,13 @@ +terraform { + required_version = "~> 1.3" + required_providers { + null = { + source = "hashicorp/null" + version = "~> 3.3.0" + } + time = { + source = "hashicorp/time" + version = "~> 0.9.1" + } + } +} diff --git a/misc/null/variables.tf b/misc/null/variables.tf new file mode 100644 index 0000000..e540b69 --- /dev/null +++ b/misc/null/variables.tf @@ -0,0 +1,19 @@ +variable "name" { + description = "The name of the template resource" + type = string + default = "my-template" +} + +variable "customer" { + description = "Customer for the current deployment" + type = string + default = "" +} + +variable "tags" { + description = "Default tags to add to resources" + type = map(any) + default = {} +} + +# module specific variables