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
2 changes: 1 addition & 1 deletion connector/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ No resources.
| <a name="input_elastio_pat"></a> [elastio_pat](#input_elastio_pat) | Personal Access Token generated by the Elastio Portal | `string` | n/a | yes |
| <a name="input_elastio_tenant"></a> [elastio_tenant](#input_elastio_tenant) | Name of your Elastio tenant. For example `mycompany.app.elastio.com` | `string` | n/a | yes |
| <a name="input_encrypt_with_cmk"></a> [encrypt_with_cmk](#input_encrypt_with_cmk) | Provision additional customer-managed KMS keys to encrypt<br/> Lambda environment variables, DynamoDB tables, S3. Note that<br/> by default data is encrypted with AWS-managed keys.<br/><br/> Enable this option only if your compliance requirements mandate the usage of CMKs.<br/><br/> If this option is disabled Elastio creates only 1 CMK per region where<br/> the Elastio Connector stack is deployed. If this option is enabled then<br/> Elastio creates 1 KMS key per AWS account and 2 KMS keys per every AWS<br/> region where Elastio is deployed in your AWS account.<br/><br/> If you have `elastio_nat_provision_stack` enabled as well, then 1 more KMS key<br/> will be created as part of that stack as well (for a total of 3 KMS keys per region). | `bool` | `null` | no |
| <a name="input_global_managed_policies"></a> [global_managed_policies](#input_global_managed_policies) | List of IAM managed policies ARNs to attach to all Elastio IAM roles | `list(string)` | `null` | no |
| <a name="input_global_managed_policies"></a> [global_managed_policies](#input_global_managed_policies) | List of IAM managed policies ARNs to attach to all Elastio IAM roles | `set(string)` | `null` | no |
| <a name="input_global_permission_boundary"></a> [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 |
| <a name="input_iam_resource_names_prefix"></a> [iam_resource_names_prefix](#input_iam_resource_names_prefix) | Add a custom prefix to names of all IAM resources deployed by this stack.<br/> The sum of the length of the prefix and suffix must not exceed 14 characters. | `string` | `null` | no |
| <a name="input_iam_resource_names_static"></a> [iam_resource_names_static](#input_iam_resource_names_static) | If enabled, the stack will use static resource names without random characters in them.<br/><br/> This parameter is set to `true` by default, and it shouldn't be changed. The older<br/> versions of Elastio stack used random names generated by Cloudformation for IAM<br/> resources, which is inconvenient to work with. New deployments that use the terraform<br/> automation should have this set to `true` for easier management of IAM resources. | `bool` | `true` | no |
Expand Down
45 changes: 45 additions & 0 deletions connector/terraform/examples/advanced/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions connector/terraform/examples/advanced/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module "elastio_connectors" {
source = "../../"

elastio_tenant = var.elastio_tenant
elastio_pat = var.elastio_pat

elastio_cloud_connectors = [
{
region = "us-east-1"
},
{
region = "us-east-2",
}
]

global_managed_policies = var.global_managed_policies
}
18 changes: 18 additions & 0 deletions connector/terraform/examples/advanced/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
variable "elastio_pat" {
description = "Personal Access Token generated by the Elastio Portal"
sensitive = true
type = string
nullable = false
}

variable "elastio_tenant" {
description = "Name of your Elastio tenant. For example `mycompany.app.elastio.com`"
type = string
nullable = false
}

variable "global_managed_policies" {
description = "List of IAM managed policies ARNs to attach to all Elastio IAM roles"
type = set(string)
default = null
}
3 changes: 3 additions & 0 deletions connector/terraform/examples/advanced/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = "~> 1.0"
}
2 changes: 1 addition & 1 deletion connector/terraform/modules/region/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "terraform_data" "elastio_cloud_connector" {
input = local.connector_config
triggers_replace = {
connector = local.connector_config,
account_stack = var.connector_account_stack.name,
account_stack = var.connector_account_stack,
}

provisioner "local-exec" {
Expand Down
18 changes: 17 additions & 1 deletion connector/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,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" {
Expand Down