Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ if command_exists ./node_modules/.bin/prettier; then
echo "$files" | xargs ./node_modules/.bin/prettier --ignore-unknown --write
fi

if command_exists tflint; then
tflint --init
tflint --config "$(pwd)/.tflint.hcl" --color --recursive
fi

# Add the modified/prettified files to staging
echo "$files" | xargs git add

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ jobs:
git diff --exit-code --color=always || ( echo "Terraform docs are
out-of-date. See the diff above." && exit 1 )

tflint:
runs-on: ubuntu-latest

env:
TFLINT_CONFIG_FILE: "${{ github.workspace }}/.tflint.hcl"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If TFLint runs in less than a second, consider adding it to the .githooks/pre-commit


steps:
- uses: actions/checkout@v4
- uses: terraform-linters/setup-tflint@v4
with:
tflint_version: "latest"

- run: tflint --init
- run: tflint --color --recursive

prettier:
runs-on: ubuntu-latest
steps:
Expand Down
25 changes: 25 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
tflint {
required_version = ">= 0.53.0"
}

config {
plugin_dir = "~/.tflint.d/plugins"
call_module_type = "local"
}

plugin "terraform" {
enabled = true
preset = "all"
}

plugin "aws" {
enabled = true
version = "0.38.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}

plugin "azurerm" {
enabled = true
version = "0.27.0"
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
}
6 changes: 3 additions & 3 deletions asset-account/terraform/stack-set/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ No modules.
| <a name="input_managed_execution"></a> [managed_execution](#input_managed_execution) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set#managed_execution-1) | <pre>object({<br/> active = optional(bool)<br/> })</pre> | `null` | no |
| <a name="input_operation_preferences"></a> [operation_preferences](#input_operation_preferences) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_instances#operation_preferences) | <pre>object({<br/> concurrency_mode = optional(string)<br/> failure_tolerance_count = optional(number)<br/> failure_tolerance_percentage = optional(number)<br/> max_concurrent_count = optional(number)<br/> max_concurrent_percentage = optional(number)<br/><br/> # Region settings are not supported, because<br/> # there must be at most one stack per account<br/> # in a single region.<br/> })</pre> | `null` | no |
| <a name="input_permission_model"></a> [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 |
| <a name="input_region"></a> [region](#input_region) | The AWS region where the Elastio Asset Account stack instances will be deployed.<br/>It is just a single region because this stack is deployed only once per AWS account. | `string` | `"us-east-1"` | no |
| <a name="input_retain_stacks"></a> [retain_stacks](#input_retain_stacks) | [See docs here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_instances#retain_stacks-1) | `bool` | `null` | no |
| <a name="input_stack_set_description"></a> [stack_set_description](#input_stack_set_description) | n/a | `string` | `"Elastio Asset Account StackSet creates IAM roles to link the AWS accounts with\nthe Elastio Connector. This allows the Elastio Connector to scan the assets\navailable in the account where the Elastio Asset Account stack instances are\ndeployed.\n"` | no |
| <a name="input_stack_set_name"></a> [stack_set_name](#input_stack_set_name) | n/a | `string` | `"ElastioAssetAccount"` | no |
| <a name="input_stack_instances_region"></a> [stack_instances_region](#input_stack_instances_region) | The AWS region where the Elastio Asset Account stack instances will be deployed.<br/>It is just a single region because this stack is deployed only once per AWS account. | `string` | `"us-east-1"` | no |
| <a name="input_stack_set_description"></a> [stack_set_description](#input_stack_set_description) | The description of the CloudFormation StackSet. | `string` | `"Elastio Asset Account StackSet creates IAM roles to link the AWS accounts with\nthe Elastio Connector. This allows the Elastio Connector to scan the assets\navailable in the account where the Elastio Asset Account stack instances are\ndeployed.\n"` | no |
| <a name="input_stack_set_name"></a> [stack_set_name](#input_stack_set_name) | The name of the CloudFormation StackSet. | `string` | `"ElastioAssetAccount"` | no |
| <a name="input_tags"></a> [tags](#input_tags) | Additional tags to apply to all resources created by this stack. | `map(string)` | `{}` | no |
| <a name="input_template_url"></a> [template_url](#input_template_url) | The URL of the Elastio Asset Account CloudFormation template obtained from<br/>the Elastio Portal.<br/><br/>This parameter is sensitive, because anyone who knows this URL can deploy<br/>Elastio Account stack and linking it to your Elastio tenant. | `string` | n/a | yes |

Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ variable "template_url" {
}

variable "admin_account_aws_profile" {
description = "The AWS CLI profile name for the admin account."
type = string
default = null
}

variable "asset_account_aws_profile" {
description = "The AWS CLI profile name for the asset account."
type = string
default = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 1.0"
}
1 change: 1 addition & 0 deletions asset-account/terraform/stack-set/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ resource "aws_cloudformation_stack_instances" "this" {
stack_set_name = aws_cloudformation_stack_set.this.name

accounts = var.accounts
regions = [var.stack_instances_region]

dynamic "deployment_targets" {
for_each = var.deployment_targets[*]
Expand Down
4 changes: 3 additions & 1 deletion asset-account/terraform/stack-set/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ variable "deployment_targets" {
## Optional parameters ##
#########################

variable "region" {
variable "stack_instances_region" {
description = <<-DESCR
The AWS region where the Elastio Asset Account stack instances will be deployed.
It is just a single region because this stack is deployed only once per AWS account.
Expand Down Expand Up @@ -82,12 +82,14 @@ variable "auto_deployment" {
}

variable "stack_set_name" {
description = "The name of the CloudFormation StackSet."
type = string
nullable = false
default = "ElastioAssetAccount"
}

variable "stack_set_description" {
description = "The description of the CloudFormation StackSet."
type = string
nullable = false
default = <<-DESCR
Expand Down