diff --git a/connector/terraform/.module.toml b/connector/terraform/.module.toml index f8a1f40..4e61ad1 100644 --- a/connector/terraform/.module.toml +++ b/connector/terraform/.module.toml @@ -2,4 +2,4 @@ name = "aws-elastio-connector" description = "Terraform module for creating the Elastio Connector Account and Region stacks" type = "terraform" -version = "0.33.0" +version = "0.33.1" diff --git a/connector/terraform/README.md b/connector/terraform/README.md index c35e9f5..b735ae3 100644 --- a/connector/terraform/README.md +++ b/connector/terraform/README.md @@ -36,9 +36,9 @@ Add this terraform module to your terraform project and specify the necessary in Here is the basic example usage of the module that deploys Elastio Connectors in several regions allowing you to scan your assets in these regions. ```tf -module "elastio_connectors" { +module "elastio_connector" { source = "terraform.cloudsmith.io/public/elastio-connector/aws" - version = "0.33.0" + version = "0.33.1" elastio_tenant = var.elastio_tenant elastio_pat = var.elastio_pat diff --git a/connector/terraform/modules/account/.module.toml b/connector/terraform/modules/account/.module.toml index 8f5ad36..7bfffbf 100644 --- a/connector/terraform/modules/account/.module.toml +++ b/connector/terraform/modules/account/.module.toml @@ -2,4 +2,4 @@ name = "aws-elastio-connector-account" description = "Terraform module for creating the Elastio Connector Account stack" type = "terraform" -version = "0.33.0" +version = "0.33.1" diff --git a/connector/terraform/modules/account/README.md b/connector/terraform/modules/account/README.md index d8b96f5..869bf1c 100644 --- a/connector/terraform/modules/account/README.md +++ b/connector/terraform/modules/account/README.md @@ -11,7 +11,7 @@ See the [`elastio-connector` module implementation](../../main.tf) for an exampl ```tf module "elastio_connector_account" { source = "terraform.cloudsmith.io/public/elastio-conenctor-account/aws" - version = "0.33.0" + version = "0.33.1" // Provide input parameters } @@ -56,7 +56,7 @@ No modules. | [elastio_pat](#input_elastio_pat) | Personal Access Token generated by the Elastio Portal | `string` | n/a | yes | | [elastio_tenant](#input_elastio_tenant) | Name of your Elastio tenant. For example `mycompany.app.elastio.com` | `string` | n/a | yes | | [encrypt_with_cmk](#input_encrypt_with_cmk) | Provision additional customer-managed KMS keys to encrypt
Lambda environment variables, DynamoDB tables, S3. Note that
by default data is encrypted with AWS-managed keys.

Enable this option only if your compliance requirements mandate the usage of CMKs.

If this option is disabled Elastio creates only 1 CMK per region where
the Elastio Connector stack is deployed. If this option is enabled then
Elastio creates 1 KMS key per AWS account and 2 KMS keys per every AWS
region where Elastio is deployed in your AWS account.

If you have `elastio_nat_provision_stack` enabled as well, then 1 more KMS key
will be created as part of that stack as well (for a total of 3 KMS keys per region). | `bool` | `null` | no | -| [global_managed_policies](#input_global_managed_policies) | List of IAM managed policies ARNs to attach to all Elastio IAM roles | `list(string)` | `null` | no | +| [global_managed_policies](#input_global_managed_policies) | List of IAM managed policies ARNs to attach to all Elastio IAM roles | `set(string)` | `null` | no | | [global_permission_boundary](#input_global_permission_boundary) | The ARN of the IAM managed policy to use as a permission boundary for all Elastio IAM roles | `string` | `null` | no | | [iam_resource_names_prefix](#input_iam_resource_names_prefix) | Add a custom prefix to names of all IAM resources deployed by this stack.
The sum of the length of the prefix and suffix must not exceed 14 characters. | `string` | `null` | no | | [iam_resource_names_static](#input_iam_resource_names_static) | If enabled, the stack will use static resource names without random characters in them.

This parameter is set to `true` by default, and it shouldn't be changed. The older
versions of Elastio stack used random names generated by Cloudformation for IAM
resources, which is inconvenient to work with. New deployments that use the terraform
automation should have this set to `true` for easier management of IAM resources. | `bool` | `true` | no | diff --git a/connector/terraform/modules/account/variables.tf b/connector/terraform/modules/account/variables.tf index 968e782..ca846c4 100644 --- a/connector/terraform/modules/account/variables.tf +++ b/connector/terraform/modules/account/variables.tf @@ -96,14 +96,30 @@ variable "lambda_tracing" { variable "global_managed_policies" { description = "List of IAM managed policies ARNs to attach to all Elastio IAM roles" - type = list(string) + type = set(string) default = null + + validation { + condition = alltrue([ + for policy in coalesce(var.global_managed_policies, []) : + can(regex("^arn:[^:]*:iam::[0-9]+:policy/.+$", policy)) + ]) + error_message = "global_managed_policies must be a list of ARNs" + } } variable "global_permission_boundary" { description = "The ARN of the IAM managed policy to use as a permission boundary for all Elastio IAM roles" type = string default = null + + validation { + condition = ( + var.global_permission_boundary == null || + can(regex("^arn:[^:]*:iam::[0-9]+:policy/.+$", var.global_permission_boundary)) + ) + error_message = "global_permission_boundary must be an ARN" + } } variable "iam_resource_names_prefix" {