### prefix Input Example (String) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'prefix' input variable, used to define a prefix for resources. ```string "apps-" ``` -------------------------------- ### capacity Input Example (String) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'capacity' input variable, specifying the instance capacity type. ```string "t3.medium" ``` -------------------------------- ### eks_version Input Example (String) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'eks_version' input variable, defining the EKS version. ```string "1.24" ``` -------------------------------- ### max_spot_price Input Example (String) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'max_spot_price' input variable, setting the maximum price for spot instances. ```string null ``` -------------------------------- ### instance_count Input Example (Number) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'instance_count' input variable, specifying the number of instances. ```number 1 ``` -------------------------------- ### metadata Input Example (Map) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'metadata' input variable, used to apply metadata to Duplo Minions. ```map {} ``` -------------------------------- ### az_list Input Example (JSON) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'az_list' input variable, which specifies a list of availability zones. ```json [ "a", "b" ] ``` -------------------------------- ### max_instance_count Input Example (Number) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'max_instance_count' input variable, defining the maximum number of instances. ```number 3 ``` -------------------------------- ### base_ami_name Input Example (String) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'base_ami_name' input variable, used to define the base AMI name for instances. ```string "amazon-eks-node" ``` -------------------------------- ### Loading Tenant Context with Duplocloud Context Module Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md This example demonstrates how to load tenant-specific context by providing a tenant name to the module. It allows access to tenant details like ID and name through the `tenant` output. ```Terraform module "ctx" { source = "duplocloud/components/duplocloud//modules/context" tenant = "dev01" } ``` -------------------------------- ### os_disk_size Input Example (Number) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'os_disk_size' input variable, specifying the operating system disk size. ```number 20 ``` -------------------------------- ### Configuring JIT Credentials with Duplocloud Context Module Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md This example shows how to configure the context module to obtain Just-In-Time (JIT) credentials for AWS and Kubernetes. The `admin` flag should only be set to true if the user has administrative privileges. ```Terraform module "ctx" { source = "duplocloud/components/duplocloud//modules/context" admin = true jit = { aws = true k8s = true } } ``` -------------------------------- ### can_scale_from_zero Input Example (Boolean) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'can_scale_from_zero' input variable, a boolean to control scaling from zero. ```boolean false ``` -------------------------------- ### Loading Tenant and Infrastructure Context (Admin) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md This example shows how to load both tenant and infrastructure context when the `admin` flag is set to true and a tenant name is provided. This configuration automatically loads the associated infrastructure. ```Terraform module "ctx" { source = "duplocloud/components/duplocloud//modules/context" tenant = "dev01" admin = true } ``` -------------------------------- ### ReTool Bastion Server Example Usage (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/api-gateway/README.md This HCL code block demonstrates how to include and configure the ReTool bastion server module in a Terraform project. It specifies the source of the module, its version, and required input variables like tenant ID and the ReTool public key. ```hcl module "retool-bastion" { source = "duplocloud/components/duplocloud//modules/retool-bastion" version = "0.0.17" tenant_id = local.tenant_id retool_public_key = local.retool_public_key } ``` -------------------------------- ### Retool Bastion Server Module Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/lambda/README.md This section details the configuration and usage of the Retool Bastion Server Terraform module. It explains the purpose of the bastion server, its role in connecting Retool to private resources, and provides an example of how to implement it in your Terraform configuration. ```APIDOC ## DuploCloud Retool Bastion Server Module ### Description The DuploCloud Retool Bastion Server module creates a secure bastion host that acts as a bridge between Retool and your private cloud resources, such as databases. This is necessary because DuploCloud services are private by default, preventing direct external access. ### Method Not Applicable (Terraform Module) ### Endpoint Not Applicable (Terraform Module) ### Parameters #### Input Variables - **tenant_id** (string) - Required - The DuploCloud Tenant ID. - **name** (string) - Optional - The name of the bastion server. Defaults to `retool-bastion`. - **capacity** (string) - Optional - The instance capacity for the bastion server. Defaults to `t3.small`. - **retool_public_key** (string) - Required - The public SSH key of the Retool server. ### Request Example ```hcl module "retool-bastion" { source = "duplocloud/components/duplocloud//modules/retool-bastion" version = "0.0.17" tenant_id = local.tenant_id retool_public_key = local.retool_public_key } ``` ### Response No direct API response. This is a Terraform module that provisions resources. ### Success Response (200) Not Applicable ### Response Example Not Applicable ``` -------------------------------- ### rollover_timeout Input Example (Number) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Example of the 'rollover_timeout' input variable, specifying the timeout for kubectl drain operations. ```number 120 ``` -------------------------------- ### ReTool Bastion Server Configuration Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/retool-bastion/README.md This section details the configuration for the ReTool Bastion Server, including its purpose, setup, and usage within a Terraform environment. ```APIDOC ## ReTool Bastion Server ### Description The ReTool Bastion Server acts as a secure bridge between your ReTool instance and private resources within your cloud environment, such as RDS databases. It allows ReTool to access these resources via an SSH tunnel, enhancing security by keeping services private. ### Method This documentation outlines the configuration and usage of a Terraform module. ### Endpoint N/A (This is a Terraform module, not a REST API endpoint) ### Parameters #### Input Variables - **tenant_id** (string) - Required - The tenant ID for DuploCloud. - **name** (string) - Optional - The name of the bastion server. Defaults to `retool-bastion`. - **capacity** (string) - Optional - The instance capacity (size) for the bastion server. Defaults to `t3.small`. - **retool_public_key** (string) - Required - The public SSH key for the ReTool server. ### Request Example ```hcl module "retool-bastion" { source = "duplocloud/components/duplocloud//modules/retool-bastion" version = "0.0.17" tenant_id = local.tenant_id retool_public_key = local.retool_public_key } ``` ### Response #### Outputs - **host** (string) - The public IP address or DNS name of the bastion host, which can be used for configuring the SSH tunnel in ReTool. #### Output Example ``` Outputs: host = "your-bastion-host-public-ip-or-dns" ``` ### Error Handling Error handling is managed by Terraform and the DuploCloud provider. Refer to their respective documentation for specific error codes and resolutions. Common issues might include invalid tenant IDs, incorrect public keys, or insufficient permissions. ``` -------------------------------- ### node_ami Output Example Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md Output variable 'node_ami' which represents the AMI for nodes. -------------------------------- ### Terraform Configuration for Gamelift Build and Fleet Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/gamelift-build/README.md This snippet demonstrates the Terraform configuration for creating a GameLift build from an S3 artifact and subsequently deploying a fleet using that build. It utilizes the awscc provider for GameLift resources and the duplocloud provider for account data. ```hcl provider "awscc" { version = "1.10.0" } provider "duplocloud" { version = ">= 0.10.35" } resource "awscc_gamelift_build" "this" { name = "${var.name}-${var.build.version}" version = var.build.version storage_type = "S3" operating_system = var.build.operating_system storage_configuration { bucket = var.build.bucket key = var.build.bucket_key } } resource "awscc_gamelift_fleet" "this" { name = "${var.name}-fleet" build_id = awscc_gamelift_build.this.id type = var.fleet.type new_game_session_protection_policy = var.fleet.new_game_session_protection_policy compute_type = var.fleet.compute_type ec2_instance_type = var.fleet.ec2_instance_type runtime_configuration { game_session_manager_port = 7777 server_processes { launch_path = var.fleet.launch_path parameters = var.fleet.parameters } } ec2_inbound_permissions = [ { from_port = 7777 to_port = 7777 protocol = "UDP" ip_range = "0.0.0.0/0" } ] locations = [ { location = "us-east-1" priority = 1 } ] } data "duplocloud_aws_account" "this" { tenant_name = var.tenant_name } output "build_id" { description = "n/a" value = awscc_gamelift_build.this.id } output "fleet_id" { description = "n/a" value = awscc_gamelift_fleet.this.id } ``` -------------------------------- ### Use Duplocloud Terraform Module Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/README.md Demonstrates how to include and configure the Duplocloud Terraform module in a project. This requires specifying the module source and version. ```hcl module "components" { source = "duplocloud/components/duplocloud" version = "0.0.22" } ``` -------------------------------- ### Using Duplocloud Context Module from Source Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md This snippet demonstrates how to include the Duplocloud context module directly from its Git repository. It fetches the latest version from the 'main' branch. ```Terraform module "ctx" { source = "git::https://github.com/duplocloud/terraform-duplocloud-components.git//modules/context?ref=main" } ``` -------------------------------- ### Create Duplo Micro Service with Load Balancer Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md This HCL code snippet demonstrates how to use the micro-service module to create a Duplo service. It configures the service with a specified name, Docker image, and port. Optionally, it enables an Application Load Balancer (ALB) with a given certificate. Environment variables and custom configurations for the service can also be defined. ```hcl module "micro-service" { source = "duplocloud/components/duplocloud//modules/micro-service" version = "0.0.23" name = "micro-service" image = "nginx:latest" port = 80 lb = { enabled = true class = "alb" certificate = "my-cert" } env = { SOMETHING = "This and $(MESSAGE)" } configurations = [{ data = { MESSAGE = "Hello World" } }] } ``` -------------------------------- ### Referencing DuploCloud Workspaces in Terraform Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md Demonstrates how to define and reference other DuploCloud Terraform workspaces using the `module.ctx.workspaces` variable. This allows access to outputs from different workspaces, facilitating inter-workspace communication. The `workspaces` variable is a map where each key represents a workspace reference, and the value is an object defining the workspace's `name`, `prefix`, and `key` for state file location. ```terraform locals { # get a value from the output of a workspace message = module.ctx.workspaces.configuration.message } module "ctx" { source = "duplocloud/components/duplocloud//modules/context" workspaces = { # key and prefix will be tenant and name will be tf workspace tenant = {} # key will be configurations and name is the tf workspace because it was left out configuration = { prefix = "tenant" } # here is one where all are spelled out devops = { name = "myportal" prefix = "portal" # key = "devops" # this defaults to they key which is devops in this case. } } } ``` -------------------------------- ### Loading Infrastructure Context with Duplocloud Context Module Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md This snippet shows how to load infrastructure context by providing an infrastructure name and setting the `admin` flag to true. This is useful for admin users needing infrastructure-specific data. ```Terraform module "ctx" { source = "duplocloud/components/duplocloud//modules/context" infra = "nonprod01" admin = true } ``` -------------------------------- ### DuploCloud Service Load Balancer Configuration (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Configures exposing a service via a load balancer, specifying its type, priority, path, ports, protocol, and SSL certificate. The 'enabled' field defaults to false, 'type' to 'service', 'priority' to 0, 'path_pattern' to '/*', 'protocol' to 'http', and 'certificate' to an empty string. The 'port' defaults to null, and 'listener' defaults to null. ```hcl object({ enabled = optional(bool, false) type = optional(string, "service") priority = optional(number, 0) path_pattern = optional(string, "/*") port = optional(number, null) protocol = optional(string, "http") certificate = optional(string, "") listener = optional(string, null) dns_prfx = optional(string, null) }) ``` -------------------------------- ### Image Configuration Structure (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Defines the structure for container image configuration, including image URI, tag, repository, registry, and pull policy. It also specifies whether the image is managed by Terraform and provides logic for constructing the image URI if not explicitly set. ```hcl object({ uri = optional(string, null) tag = optional(string, "latest") repo = optional(string, null) registry = optional(string, "docker.io") pullPolicy = optional(string, "IfNotPresent") managed = optional(bool, true) }) ``` -------------------------------- ### Run Terraform Unit Tests Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md This command executes the unit tests for the Terraform module. It uses the `terraform test` command with a filter to specifically run tests defined in the `tests/unit.tftests.hcl` file. ```sh terraform test -filter=tests/unit.tftests.hcl ``` -------------------------------- ### DuploCloud Lambda Function Configuration Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/lambda/README.md Defines the configuration for a DuploCloud AWS Lambda function, including handler, image details, name, package type, and tenant name. This resource is utilized by the retool-bastion module. ```hcl resource "duplocloud_aws_lambda_function.this" "this" { tenant_id = local.tenant_id name = var.name package_type = var.package_type handler = var.handler image = var.image description = var.description timeout = var.timeout memory_size = var.memory_size tracing_mode = var.tracing_mode environment = var.environment } ``` -------------------------------- ### Configure Service Volume Mounts Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Defines how volumes are mounted into a service, specifying the volume name, mount path, and read-only status. Optionally supports mounting a sub-path of the volume. ```hcl list(object({ name = string mountPath = string readOnly = optional(bool, false) subPath = optional(string, null) })) ``` -------------------------------- ### Run Terraform Integration Tests Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md This command executes the integration tests for the Terraform module. It uses the `terraform test` command with a filter to specifically run tests defined in the `tests/integration.tftests.hcl` file. ```sh terraform test -filter=tests/integration.tftests.hcl ``` -------------------------------- ### Application Configuration Structure (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Defines the structure for application configurations, which can be configmaps or secrets. It includes fields for enabling/disabling, management by Terraform, data key-value pairs, file type mounting, and CSI driver usage. Supports environment variables or files as data types. ```hcl list(object({ enabled = optional(bool, true) external = optional(bool, false) name = optional(string, null) description = optional(string, null) type = optional(string, "environment") # environment or file data = optional(map(string), {}) value = optional(string, null) managed = optional(bool, true) class = optional(string, "configmap") csi = optional(bool, false) mountPath = optional(string, null) })) ``` -------------------------------- ### Configure Service Scaling Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Defines how a service scales, including auto-scaling settings, replica counts, and autoscaling metrics. Supports automatic scaling based on specified metrics or a fixed number of replicas. ```hcl object({ auto = optional(bool, false) replicas = optional(number, 1) min = optional(number, 1) max = optional(number, 3) metrics = optional(list(object({ type = string target = number })), []) }) ``` -------------------------------- ### Run Terraform Unit Tests Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/README.md Executes unit tests for Terraform modules. This command filters tests to only include those specified in the given HCL file. ```shell tf test -filter=tests/unit.tftest.hcl ``` -------------------------------- ### Using JIT AWS Credentials in AWS Provider Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md This snippet illustrates how to use the JIT AWS credentials obtained from the context module within the AWS provider configuration. It accesses the access key ID, secret access key, and session token from the module's outputs. ```Terraform provider "aws" { region = local.infra.region access_key = module.ctx.jit.aws.access_key_id secret_key = module.ctx.jit.aws.secret_access_key token = module.ctx.jit.aws.session_token } ``` -------------------------------- ### MongoDB Atlas Cluster Provisioning with Terraform Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/mongodb/README.md This snippet demonstrates how to provision a MongoDB Atlas advanced cluster using Terraform. It defines essential parameters such as project ID, database version, cluster name, type, environment, region configurations, and user details. ```hcl module "mongodb" { source = "path/to/this/module" mongo_project_id = "your_project_id" mongo_db_major_version = "5.0" cluster_name = "example-cluster" cluster_type = "REPLICASET" environment = "production" region_configs = { electable_specs = { instance_size = "M10" node_count = 3 disk_size_gb = 10 } provider_name = "AWS" priority = 7 region_name = "US_EAST_1" } mongo_user_details = { username = "admin" roles = { database_name = "admin" role_name = "readWrite" } auth_database_name = "admin" } } ``` -------------------------------- ### AWS Lambda Function Resource Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/lambda/README.md This section details the configuration of an AWS Lambda function within the DuploCloud context, likely used by the bastion server or related infrastructure. It outlines the required and optional input variables for defining the Lambda function. ```APIDOC ## AWS Lambda Function Resource ### Description This resource configures an AWS Lambda function, which can be utilized by the bastion server or other DuploCloud managed services. It specifies details such as the handler, deployment package, environment variables, and runtime settings. ### Method Not Applicable (Terraform Resource) ### Endpoint Not Applicable (Terraform Resource) ### Parameters #### Required Inputs - **handler** (string) - Required - The entry point for the Lambda function. - **image** (object) - Required - Configuration for the Lambda deployment package (e.g., container image URI). - **uri** (string) - Required - The URI of the container image. - **entry_point** (list(string)) - Optional - The entry point commands for the container. - **working_directory** (string) - Optional - The working directory for the container. - **name** (string) - Required - The name of the Lambda function. - **package_type** (string) - Required - The type of package to deploy (e.g., 'Image' or 'Zip'). - **tenant_name** (string) - Required - The name of the DuploCloud tenant. #### Optional Inputs - **description** (string) - Optional - A description for the Lambda function. Defaults to `Duplocloud Rocks`. - **environment** (map(string)) - Optional - Environment variables to set for the Lambda function. Defaults to an empty map `{}`. - **memory_size** (number) - Optional - The memory allocated to the Lambda function in MB. Defaults to `2048`. - **timeout** (number) - Optional - The maximum execution time for the Lambda function in seconds. Defaults to `600`. - **tracing_mode** (string) - Optional - The tracing mode for the Lambda function. Defaults to `PassThrough`. ### Request Example ```hcl resource "duplocloud_aws_lambda_function" "example" { tenant_name = "example-tenant" name = "my-lambda-function" package_type = "Image" handler = "index.handler" image = { uri = "123456789012.dkr.ecr.us-west-2.amazonaws.com/my-repo:latest" } description = "My example Lambda function" memory_size = 1024 timeout = 300 environment = { MY_VAR = "my_value" } } ``` ### Response No direct API response. This is a Terraform resource that provisions AWS resources. ### Success Response (200) Not Applicable ### Response Example Not Applicable ``` -------------------------------- ### DuploCloud Service Resource Configuration (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Specifies resource requests and limits for a service's pods. Both 'requests' and 'limits' are optional map(string) types, defaulting to null if not provided. ```hcl object({ requests = optional(map(string)) limits = optional(map(string)) }) ``` -------------------------------- ### DuploCloud Service Job Configuration (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Defines the configuration for service jobs, including enabling/disabling, naming, command execution, arguments, wait behavior, event triggers, and scheduling. The 'enabled' field defaults to true, 'name' to the event name, 'command' to container or var.command, 'args' to an empty list, 'wait' to true, and 'event' to 'before-update'. ```hcl list(object({ enabled = optional(bool, true) name = optional(string, null) command = optional(list(string), null) args = optional(list(string), []) wait = optional(bool, true) event = optional(string, "before-update") schedule = optional(string, "0 1 * * *" })) ``` -------------------------------- ### Setting DuploCloud Terraform State Bucket Name Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/context/README.md Shows how to explicitly set the DuploCloud Terraform state bucket name using the `duplocloud_admin_system_setting` resource. This is useful when the state bucket is not the standard, guessable bucket. Setting `StateBucket` in `AppConfig` ensures that the module uses the specified bucket for references. ```terraform resource "duplocloud_admin_system_setting" "tf_bucket" { key = "StateBucket" value = "my-tf-state-bucket-name" type = "AppConfig" } ``` -------------------------------- ### DuploCloud Tenant Data Source Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/lambda/README.md Retrieves information about a DuploCloud tenant using its name. This data source is used to obtain the tenant ID, which is a required input for various DuploCloud resources. ```hcl data "duplocloud_tenant" "this" { name = var.tenant_name } ``` -------------------------------- ### Create DuploCloud EKS HA Nodes with Terraform Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/eks-nodes/README.md This HCL code snippet demonstrates how to use the DuploCloud EKS nodes module to create a highly available node group for an EKS cluster. It specifies the source, version, tenant ID, and various capacity and instance count parameters for the node group. ```hcl module "nodegroup" { source = "duplocloud/components/duplocloud//modules/eks-nodes" version = "0.0.41" tenant_id = local.tenant_id capacity = var.asg_capacity eks_version = local.eks_version instance_count = var.asg_instance_count min_instance_count = var.asg_min_instance_count max_instance_count = var.asg_max_instance_count os_disk_size = var.asg_os_disk_size } ``` -------------------------------- ### Define Service Security Context Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Specifies the security context for a service, including user and group IDs for running the process and file system group ownership. ```hcl object({ run_as_user = optional(number, null) run_as_group = optional(number, null) fs_group = optional(number, null) }) ``` -------------------------------- ### DuploCloud Service Node Configuration (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Defines the node allocation strategy for a service, including optional allocation tags, shared node status, and selector for specific nodes. 'shared' defaults to false and 'allocation_tags' and 'selector' default to null. ```hcl object({ allocation_tags = optional(string, null) shared = optional(bool, false) selector = optional(map(string), null) }) ``` -------------------------------- ### Health Check Configuration Structure (HCL) Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/micro-service/README.md Specifies the structure for configuring health checks in a service. It includes fields for enabling the check, the path to check, and various timing and threshold parameters to determine the health status. ```hcl object({ enabled = optional(bool, true) path = optional(string, "/") failureThreshold = optional(number, 3) initialDelaySeconds = optional(number, 15) periodSeconds = optional(number, 20) successThreshold = optional(number, 1) timeoutSeconds = optional(number, 1) }) ``` -------------------------------- ### Terraform - Tenant Role Extension with IAM Policy Source: https://github.com/duplocloud/terraform-duplocloud-components/blob/main/modules/tenant-role-extension/README.md This Terraform code defines a module to extend a DuploCloud tenant role with specific IAM permissions. It utilizes AWS data sources to gather necessary information like the current region and account ID, and constructs a policy document granting 'secretsmanager:GetSecretValue' permissions. The module then attaches this policy to the tenant's role. ```terraform locals { my_secrets_prefix = "SecretSauce" tenant_name = "dev01" } data "aws_caller_identity" "current" { } data "aws_region" "current" { } data "aws_iam_policy_document" "example" { statement { effect = "Allow" actions = ["secretsmanager:GetSecretValue"] resources = ["arn:aws:secretsmanager:${data.aws_region.current.name}:${local.aws_account_id}:secret:/${local.my_secrets_prefix}/*"] } } module "tenant-role" { source = "duplocloud/components/duplocloud//modules/tenant-role-extension" version = "0.0.19" tenant_name = local.tenant_name iam_policy_json = data.aws_iam_policy_document.example.json } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.