diff --git a/.githooks/pre-commit b/.githooks/pre-commit
index 1d69abe..98253d7 100755
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -34,6 +34,14 @@ if command_exists typos; then
echo "$files" | xargs typos
fi
+if command_exists terraform-docs; then
+ pushd asset-account/terraform/stack-set
+ files="$files asset-account/terraform/stack-set/README.md"
+
+ terraform-docs markdown . --output-file README.md
+ popd
+fi
+
if command_exists ./node_modules/.bin/prettier; then
echo "$files" | xargs ./node_modules/.bin/prettier --ignore-unknown --write
fi
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c27df31..f1c2f66 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -47,6 +47,44 @@ jobs:
- run: terraform validate
working-directory: ${{ matrix.project }}
+ terraform-docs:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ terraform_module:
+ - asset-account/terraform/stack-set
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: "22"
+ cache: "npm"
+ - run: npm ci --ignore-scripts
+
+ - run: |
+ curl https://github.com/terraform-docs/terraform-docs/releases/download/v0.19.0/terraform-docs-v0.19.0-linux-amd64.tar.gz \
+ --location \
+ --silent \
+ --retry 5 \
+ --retry-all-errors \
+ --show-error \
+ | tar -xz terraform-docs > ./terraform-docs
+ working-directory: ${{ matrix.terraform_module }}
+
+ - run: chmod +x ./terraform-docs
+ working-directory: ${{ matrix.terraform_module }}
+
+ - run: ./terraform-docs markdown . --output-file README.md
+ working-directory: ${{ matrix.terraform_module }}
+
+ - run: npx prettier -w .
+
+ - run: >-
+ git diff --exit-code --color=always || ( echo "Terraform docs are
+ out-of-date. See the diff above." && exit 1 )
+
prettier:
runs-on: ubuntu-latest
steps:
diff --git a/.gitignore b/.gitignore
index f4c18be..bdebada 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
terraform.tfstate
terraform.tfstate.backup
terraform.tfvars
+/node_modules
diff --git a/asset-account/terraform/stack-set/README.md b/asset-account/terraform/stack-set/README.md
index 0383280..82ddbc0 100644
--- a/asset-account/terraform/stack-set/README.md
+++ b/asset-account/terraform/stack-set/README.md
@@ -21,3 +21,62 @@ module "elastio_asset_account" {
// Provide input parameters
}
```
+
+
+
+## Requirements
+
+| Name | Version |
+| ------------------------------------------------------------------------ | ------- |
+| [terraform](#requirement_terraform) | >= 1.0 |
+| [aws](#requirement_aws) | >= 5.0 |
+
+## Providers
+
+| Name | Version |
+| ------------------------------------------------ | ------- |
+| [aws](#provider_aws) | >= 5.0 |
+
+## Modules
+
+No modules.
+
+## Resources
+
+| Name | Type |
+| ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
+| [aws_cloudformation_stack_instances.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_instances) | resource |
+| [aws_cloudformation_stack_set.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set) | resource |
+
+## Inputs
+
+| Name | Description | Type | Default | Required |
+| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: |
+| [accounts](#input_accounts) | The IDs AWS accounts where you want to create stack instances.
Specify `accounts` only if you are using `SELF_MANAGED` permissions model.
If you are using the `SERVICE_MANAGED` permissions model specify `deployment_targets` instead. | `list(string)` | `null` | no |
+| [administration_role_arn](#input_administration_role_arn) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set#administration_role_arn-1) | `string` | `null` | no |
+| [auto_deployment](#input_auto_deployment) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set#auto_deployment-1) |
object({
enabled = optional(bool)
retain_stacks_on_account_removal = optional(bool)
}) | `null` | no |
+| [call_as](#input_call_as) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set#call_as-1) | `string` | `null` | no |
+| [deployment_targets](#input_deployment_targets) | The AWS Organizations accounts for which to create stack instances.object({
account_filter_type = optional(string)
accounts = optional(list(string))
accounts_url = optional(string)
organizational_unit_ids = optional(list(string))
}) | `null` | no |
+| [encrypt_with_cmk](#input_encrypt_with_cmk) | Provision an additional customer-managed KMS key to encrypt Lambda environment variables.object({
active = optional(bool)
}) | `null` | no |
+| [operation_preferences](#input_operation_preferences) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_instances#operation_preferences) | object({
concurrency_mode = optional(string)
failure_tolerance_count = optional(number)
failure_tolerance_percentage = optional(number)
max_concurrent_count = optional(number)
max_concurrent_percentage = optional(number)
# Region settings are not supported, because
# there must be at most one stack per account
# in a single region.
}) | `null` | no |
+| [permission_model](#input_permission_model) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set#permission_model-1) | `string` | `null` | no |
+| [region](#input_region) | The AWS region where the Elastio Asset Account stack instances will be deployed.