A Terraform module that sets up the necessary AWS infrastructure to connect your AWS account to Altinity.Cloud. This module provisions EC2 instances running the cloud-connect service, along with the required IAM roles, security groups, and networking components.
If you're looking for a way to manage ClickHouse clusters via Terraform, see terraform-provider-altinitycloud.
Before using this module, ensure you have:
- AWS CLI configured with appropriate credentials
- Terraform >= 1.0
- Altinity.Cloud account and access to the cloud-connect certificate
provider "aws" {
region = "us-west-2"
}
module "altinitycloud_connect_aws" {
source = "altinity/connect-aws/altinitycloud"
version = "~> 0.2.0"
# Certificate from `altinitycloud-connect login`
pem = file("cloud-connect.pem")
}
module "altinitycloud_connect_aws" {
source = "altinity/connect-aws/altinitycloud"
version = "~> 0.2.0"
pem = file("cloud-connect.pem")
# High availability configuration
replicas = 3
instance_type = "t3.medium"
# Optional tags
tags = {
Environment = "production"
HA = "true"
}
}
module "altinitycloud_connect_aws" {
source = "altinity/connect-aws/altinitycloud"
version = "~> 0.2.0"
pem = file("cloud-connect.pem")
# Create new VPC with custom CIDR
cidr_block = "172.16.0.0/16"
map_public_ip_on_launch = true
# Security configuration
allow_altinity_access = false
require_imdsv2 = true
# Optional tags
tags = {
Environment = "staging"
VPC = "custom"
}
}
module "altinitycloud_connect_aws" {
source = "altinity/connect-aws/altinitycloud"
version = "~> 0.2.0"
pem = file("cloud-connect.pem")
# Use existing VPC subnets
subnets = [
"subnet-12345678",
"subnet-87654321",
"subnet-11223344"
]
# Optional tags
tags = {
Environment = "production"
VPC = "existing"
}
}
Name | Description | Type |
---|---|---|
pem |
Contents of cloud-connect.pem certificate (if not using SSM) | string |
Name | Description | Type | Default |
---|---|---|---|
pem_ssm_parameter_name |
AWS SSM Parameter containing the certificate | string |
"" |
instance_type |
EC2 instance type | string |
"t3.micro" |
replicas |
Number of cloud-connect instances (1-3) | number |
1 |
subnets |
List of subnet IDs for instances | list(string) |
[] |
use_default_subnets |
Use default VPC subnets | bool |
false |
cidr_block |
CIDR block for new VPC | string |
"10.0.0.0/16" |
allow_altinity_access |
Allow Altinity break-glass access | bool |
true |
enable_permissions_boundary |
Enable IAM permission boundaries | bool |
false |
external_buckets |
Additional S3 buckets to allow access | list(string) |
[] |
restricted_iam_permissions |
Use scoped IAM permissions | bool |
false |
tags |
Resource tags | map(string) |
{} |
For a complete list of variables, see variables.tf.
Name | Description |
---|---|
resource_prefix |
AWS resource prefix (when permission boundary enabled) |
permissions_boundary_policy_arn |
ARN of the permission boundary policy |
- Instance fails to start: Check certificate validity and network connectivity to Altinity.Cloud. Review CloudWatch logs.
- Permission errors: Ensure AWS credentials have sufficient permissions and verify IAM role policies.
If you encounter issues not covered above, please create an issue with detailed information about your problem.
Contributions are welcome! Please submit a Pull Request or open an issue for major changes. See CONTRIBUTING.md for development guidelines and advanced configuration examples.
All code, unless specified otherwise, is licensed under the Apache-2.0 license. Copyright (c) 2023 Altinity, Inc.