Examples:
New vpc and deploy database rds:
locals {
region = "us-east-1"
tags = {
terraform_managed = true
project = "blockscout-supernet"
}
}
module "vpc" {
source = "./aws"
vpc_name = "name"
ssl_certificate_arn = "<arn>"
deploy_ec2_instance_db = false
deploy_rds_db = true
tags = local.tags
}
!!! For work with existed vpc needs a subnet group: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Subnets
Existed vpc and deploy database rds:
locals {
region = "us-east-1"
tags = {
terraform_managed = true
project = "blockscout-supernet"
}
}
module "vpc" {
source = "./aws"
existed_vpc_id = "vpc-05626****"
existed_private_subnets_ids = ["subnet-*", "subnet-*", "subnet-*"]
existed_public_subnets_ids = ["subnet-*", "subnet-*", "subnet-*"]
existed_rds_subnet_group_name = "<name>"
ssl_certificate_arn = "<arn>"
}
Name | Version |
---|---|
terraform | >= 1.3.0 |
aws | >= 4.64.0 |
random | 3.4.3 |
Name | Version |
---|---|
aws | >= 4.64.0 |
random | 3.4.3 |
Name | Source | Version |
---|---|---|
alb | ./alb | n/a |
alb_eth_bytecode_db | ./alb | n/a |
alb_sig_provider | ./alb | n/a |
alb_stats | ./alb | n/a |
alb_verifier | ./alb | n/a |
alb_visualizer | ./alb | n/a |
application_sg | terraform-aws-modules/security-group/aws | 4.16.0 |
db_sg | terraform-aws-modules/security-group/aws | 4.16.0 |
ec2_asg_api_and_ui | ./asg | n/a |
ec2_asg_eth_bytecode_db | ./asg | n/a |
ec2_asg_indexer | ./asg | n/a |
ec2_asg_sig_provider | ./asg | n/a |
ec2_asg_stats | ./asg | n/a |
ec2_asg_verifier | ./asg | n/a |
ec2_asg_visualizer | ./asg | n/a |
ec2_database | terraform-aws-modules/ec2-instance/aws | 4.2.1 |
key_pair | terraform-aws-modules/key-pair/aws | 2.0.1 |
lb_microservices_sg | terraform-aws-modules/security-group/aws | 4.16.0 |
lb_sg | terraform-aws-modules/security-group/aws | 4.16.0 |
microservices_sg | terraform-aws-modules/security-group/aws | 4.16.0 |
rds | terraform-aws-modules/rds/aws | 5.1.1 |
vpc | terraform-aws-modules/vpc/aws | 3.18.1 |
Name | Type |
---|---|
random_string.secret_key_base | resource |
aws_ami.ubuntu | data source |
aws_availability_zones.current | data source |
aws_subnet.this | data source |
aws_subnets.selected | data source |
aws_vpc.selected | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
blockscout_settings | Settings of blockscout app | object({ |
{} |
no |
create_iam_instance_profile_ssm_policy | Determines whether an IAM instance profile with SSM policy is created or to use an existing IAM instance profile | string |
false |
no |
deploy_ec2_instance_db | Create ec2 instance with postgresql db in docker | bool |
true |
no |
deploy_rds_db | Enabled deploy rds | bool |
false |
no |
enabled_dns_hostnames | Autocreate dns names for ec2 instance in route53. Required for work with default DB | bool |
true |
no |
enabled_nat_gateway | Nat gateway enabled | bool |
true |
no |
eth_bytecode_db_create_database | Create database in application start | bool |
true |
no |
eth_bytecode_db_docker_image | Docker image of eth-bytecode-db | string |
"ghcr.io/blockscout/eth-bytecode-db:main" |
no |
eth_bytecode_db_enabled | eth-bytecode-db deploy | bool |
true |
no |
eth_bytecode_db_instance_type | AWS instance type | string |
"t2.medium" |
no |
eth_bytecode_db_replicas | Number of eth-bytecode-db replicas | number |
1 |
no |
existed_private_subnets_ids | List of existed id private subnets(For instances) | list(string) |
[] |
no |
existed_public_subnets_ids | List of existed if public subnets(For LB) | list(string) |
[] |
no |
existed_rds_subnet_group_name | Name of subnet group for RDS deploy | string |
"" |
no |
existed_vpc_id | Required for using existed vpc. ID of VPC | string |
"" |
no |
iam_instance_profile_arn | Amazon Resource Name (ARN) of an existing IAM instance profile. Used when create_iam_instance_profile_ssm_policy = false |
string |
null |
no |
image_name | OS image mask | string |
"ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-202304*" |
no |
image_owner | ID of image owner | string |
"679593333241" |
no |
indexer_instance_type | AWS instance type | string |
"t2.medium" |
no |
path_docker_compose_files | Path in ec2 instance for blockscout files | string |
"/opt/blockscout" |
no |
rds_allocated_storage | Size of rds storage | number |
20 |
no |
rds_instance_type | AWS RDS instance type | string |
"db.t3.large" |
no |
rds_max_allocated_storage | Max size of rds storage | number |
300 |
no |
rds_multi_az | Creates a primary DB instance and a standby DB instance in a different AZ. Provides high availability and data redundancy, but the standby DB instance doesn't support connections for read workloads. | bool |
false |
no |
sig_provider_docker_image | Docker image of sig-provider | string |
"ghcr.io/blockscout/sig-provider:main" |
no |
sig_provider_enabled | sig-provider deploy | bool |
false |
no |
sig_provider_instance_type | AWS instance type | string |
"t2.medium" |
no |
sig_provider_replicas | Number of sig-provider replicas | number |
1 |
no |
single_nat_gateway | Should be true if you want to provision a single shared NAT Gateway across all of your private networks | bool |
true |
no |
ssh_keys | Create ssh keys | map(string) |
{} |
no |
ssl_certificate_arn | Certificate for ALB | string |
"" |
no |
stats_create_database | Create database in application start | bool |
true |
no |
stats_docker_image | Docker image of stats | string |
"ghcr.io/blockscout/stats:main" |
no |
stats_enabled | stats deploy | bool |
true |
no |
stats_instance_type | AWS instance type | string |
"t2.medium" |
no |
stats_replicas | Number of stats replicas | number |
1 |
no |
tags | Add custom tags for all resources managed by this script | map(string) |
{} |
no |
ui_and_api_instance_type | AWS instance type | string |
"t2.medium" |
no |
user | What user to service run as | string |
"root" |
no |
verifier_enabled | Verifier deploy | bool |
true |
no |
verifier_instance_type | AWS instance type | string |
"t2.medium" |
no |
verifier_replicas | Number of verifier replicas | number |
2 |
no |
verifier_settings | Settings of verifier | object({ |
{} |
no |
verifier_url | Url of verifier | string |
"" |
no |
visualizer_docker_image | Docker image of visualizer | string |
"ghcr.io/blockscout/visualizer:latest" |
no |
visualizer_enabled | Visualizer deploy | bool |
true |
no |
visualizer_instance_type | AWS instance type | string |
"t2.medium" |
no |
visualizer_replicas | Number of visualizer replicas | number |
2 |
no |
vpc_cidr | VPC cidr | string |
"10.105.0.0/16" |
no |
vpc_name | VPC name | string |
"" |
no |
vpc_private_subnet_cidrs | Not required! You can set custom private subnets | list(string) |
null |
no |
vpc_public_subnet_cidrs | Not required! You can set custom public subnets | list(string) |
null |
no |
Name | Description |
---|---|
blockscout_url | DNS name of frontend |