An open API service indexing awesome lists of open source software.

https://github.com/blockscout/terraform-for-supernet


https://github.com/blockscout/terraform-for-supernet

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# Module for deploy blockscout to AWS
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 = ""
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 = ""
ssl_certificate_arn = ""
}
```

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.3.0 |
| [aws](#requirement\_aws) | >= 4.64.0 |
| [random](#requirement\_random) | 3.4.3 |

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 4.64.0 |
| [random](#provider\_random) | 3.4.3 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| [alb](#module\_alb) | ./alb | n/a |
| [alb\_eth\_bytecode\_db](#module\_alb\_eth\_bytecode\_db) | ./alb | n/a |
| [alb\_sig\_provider](#module\_alb\_sig\_provider) | ./alb | n/a |
| [alb\_stats](#module\_alb\_stats) | ./alb | n/a |
| [alb\_verifier](#module\_alb\_verifier) | ./alb | n/a |
| [alb\_visualizer](#module\_alb\_visualizer) | ./alb | n/a |
| [application\_sg](#module\_application\_sg) | terraform-aws-modules/security-group/aws | 4.16.0 |
| [db\_sg](#module\_db\_sg) | terraform-aws-modules/security-group/aws | 4.16.0 |
| [ec2\_asg\_api\_and\_ui](#module\_ec2\_asg\_api\_and\_ui) | ./asg | n/a |
| [ec2\_asg\_eth\_bytecode\_db](#module\_ec2\_asg\_eth\_bytecode\_db) | ./asg | n/a |
| [ec2\_asg\_indexer](#module\_ec2\_asg\_indexer) | ./asg | n/a |
| [ec2\_asg\_sig\_provider](#module\_ec2\_asg\_sig\_provider) | ./asg | n/a |
| [ec2\_asg\_stats](#module\_ec2\_asg\_stats) | ./asg | n/a |
| [ec2\_asg\_verifier](#module\_ec2\_asg\_verifier) | ./asg | n/a |
| [ec2\_asg\_visualizer](#module\_ec2\_asg\_visualizer) | ./asg | n/a |
| [ec2\_database](#module\_ec2\_database) | terraform-aws-modules/ec2-instance/aws | 4.2.1 |
| [key\_pair](#module\_key\_pair) | terraform-aws-modules/key-pair/aws | 2.0.1 |
| [lb\_microservices\_sg](#module\_lb\_microservices\_sg) | terraform-aws-modules/security-group/aws | 4.16.0 |
| [lb\_sg](#module\_lb\_sg) | terraform-aws-modules/security-group/aws | 4.16.0 |
| [microservices\_sg](#module\_microservices\_sg) | terraform-aws-modules/security-group/aws | 4.16.0 |
| [rds](#module\_rds) | terraform-aws-modules/rds/aws | 5.1.1 |
| [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 3.18.1 |

## Resources

| Name | Type |
|------|------|
| [random_string.secret_key_base](https://registry.terraform.io/providers/hashicorp/random/3.4.3/docs/resources/string) | resource |
| [aws_ami.ubuntu](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source |
| [aws_availability_zones.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source |
| [aws_subnet.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnet) | data source |
| [aws_subnets.selected](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets) | data source |
| [aws_vpc.selected](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [blockscout\_settings](#input\_blockscout\_settings) | Settings of blockscout app |

object({
postgres_password = optional(string, "postgres")
postgres_user = optional(string, "postgres")
postgres_host = optional(string, "postgres")
blockscout_docker_image = optional(string, "blockscout/blockscout-polygon-supernets:5.1.3-prerelease-61c1238e")
rpc_address = optional(string, "https://rpc-supertestnet.polygon.technology")
chain_id = optional(string, "93201")
rust_verification_service_url = optional(string, "https://sc-verifier.aws-k8s.blockscout.com/")
ws_address = optional(string, "")
visualize_sol2uml_service_url = optional(string, "")
sig_provider_service_url = optional(string, "")
})
| `{}` | no |
| [create\_iam\_instance\_profile\_ssm\_policy](#input\_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](#input\_deploy\_ec2\_instance\_db) | Create ec2 instance with postgresql db in docker | `bool` | `true` | no |
| [deploy\_rds\_db](#input\_deploy\_rds\_db) | Enabled deploy rds | `bool` | `false` | no |
| [enabled\_dns\_hostnames](#input\_enabled\_dns\_hostnames) | Autocreate dns names for ec2 instance in route53. Required for work with default DB | `bool` | `true` | no |
| [enabled\_nat\_gateway](#input\_enabled\_nat\_gateway) | Nat gateway enabled | `bool` | `true` | no |
| [eth\_bytecode\_db\_create\_database](#input\_eth\_bytecode\_db\_create\_database) | Create database in application start | `bool` | `true` | no |
| [eth\_bytecode\_db\_docker\_image](#input\_eth\_bytecode\_db\_docker\_image) | Docker image of eth-bytecode-db | `string` | `"ghcr.io/blockscout/eth-bytecode-db:main"` | no |
| [eth\_bytecode\_db\_enabled](#input\_eth\_bytecode\_db\_enabled) | eth-bytecode-db deploy | `bool` | `true` | no |
| [eth\_bytecode\_db\_instance\_type](#input\_eth\_bytecode\_db\_instance\_type) | AWS instance type | `string` | `"t2.medium"` | no |
| [eth\_bytecode\_db\_replicas](#input\_eth\_bytecode\_db\_replicas) | Number of eth-bytecode-db replicas | `number` | `1` | no |
| [existed\_private\_subnets\_ids](#input\_existed\_private\_subnets\_ids) | List of existed id private subnets(For instances) | `list(string)` | `[]` | no |
| [existed\_public\_subnets\_ids](#input\_existed\_public\_subnets\_ids) | List of existed if public subnets(For LB) | `list(string)` | `[]` | no |
| [existed\_rds\_subnet\_group\_name](#input\_existed\_rds\_subnet\_group\_name) | Name of subnet group for RDS deploy | `string` | `""` | no |
| [existed\_vpc\_id](#input\_existed\_vpc\_id) | Required for using existed vpc. ID of VPC | `string` | `""` | no |
| [iam\_instance\_profile\_arn](#input\_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](#input\_image\_name) | OS image mask | `string` | `"ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-202304*"` | no |
| [image\_owner](#input\_image\_owner) | ID of image owner | `string` | `"679593333241"` | no |
| [indexer\_instance\_type](#input\_indexer\_instance\_type) | AWS instance type | `string` | `"t2.medium"` | no |
| [path\_docker\_compose\_files](#input\_path\_docker\_compose\_files) | Path in ec2 instance for blockscout files | `string` | `"/opt/blockscout"` | no |
| [rds\_allocated\_storage](#input\_rds\_allocated\_storage) | Size of rds storage | `number` | `20` | no |
| [rds\_instance\_type](#input\_rds\_instance\_type) | AWS RDS instance type | `string` | `"db.t3.large"` | no |
| [rds\_max\_allocated\_storage](#input\_rds\_max\_allocated\_storage) | Max size of rds storage | `number` | `300` | no |
| [rds\_multi\_az](#input\_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](#input\_sig\_provider\_docker\_image) | Docker image of sig-provider | `string` | `"ghcr.io/blockscout/sig-provider:main"` | no |
| [sig\_provider\_enabled](#input\_sig\_provider\_enabled) | sig-provider deploy | `bool` | `false` | no |
| [sig\_provider\_instance\_type](#input\_sig\_provider\_instance\_type) | AWS instance type | `string` | `"t2.medium"` | no |
| [sig\_provider\_replicas](#input\_sig\_provider\_replicas) | Number of sig-provider replicas | `number` | `1` | no |
| [single\_nat\_gateway](#input\_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](#input\_ssh\_keys) | Create ssh keys | `map(string)` | `{}` | no |
| [ssl\_certificate\_arn](#input\_ssl\_certificate\_arn) | Certificate for ALB | `string` | `""` | no |
| [stats\_create\_database](#input\_stats\_create\_database) | Create database in application start | `bool` | `true` | no |
| [stats\_docker\_image](#input\_stats\_docker\_image) | Docker image of stats | `string` | `"ghcr.io/blockscout/stats:main"` | no |
| [stats\_enabled](#input\_stats\_enabled) | stats deploy | `bool` | `true` | no |
| [stats\_instance\_type](#input\_stats\_instance\_type) | AWS instance type | `string` | `"t2.medium"` | no |
| [stats\_replicas](#input\_stats\_replicas) | Number of stats replicas | `number` | `1` | no |
| [tags](#input\_tags) | Add custom tags for all resources managed by this script | `map(string)` | `{}` | no |
| [ui\_and\_api\_instance\_type](#input\_ui\_and\_api\_instance\_type) | AWS instance type | `string` | `"t2.medium"` | no |
| [user](#input\_user) | What user to service run as | `string` | `"root"` | no |
| [verifier\_enabled](#input\_verifier\_enabled) | Verifier deploy | `bool` | `true` | no |
| [verifier\_instance\_type](#input\_verifier\_instance\_type) | AWS instance type | `string` | `"t2.medium"` | no |
| [verifier\_replicas](#input\_verifier\_replicas) | Number of verifier replicas | `number` | `2` | no |
| [verifier\_settings](#input\_verifier\_settings) | Settings of verifier |
object({
docker_image = optional(string, "ghcr.io/blockscout/smart-contract-verifier:main")
solidity_fetcher_list_url = optional(string, "https://solc-bin.ethereum.org/linux-amd64/list.json")
solidity_refresh_versions_schedule = optional(string, "0 0 * * * * *")
vyper_fetcher_list_url = optional(string, "https://raw.githubusercontent.com/blockscout/solc-bin/main/vyper.list.json")
vyper_refresh_versions_schedule = optional(string, "0 0 * * * * *")
sourcify_api_url = optional(string, "https://sourcify.dev/server/")
})
| `{}` | no |
| [verifier\_url](#input\_verifier\_url) | Url of verifier | `string` | `""` | no |
| [visualizer\_docker\_image](#input\_visualizer\_docker\_image) | Docker image of visualizer | `string` | `"ghcr.io/blockscout/visualizer:latest"` | no |
| [visualizer\_enabled](#input\_visualizer\_enabled) | Visualizer deploy | `bool` | `true` | no |
| [visualizer\_instance\_type](#input\_visualizer\_instance\_type) | AWS instance type | `string` | `"t2.medium"` | no |
| [visualizer\_replicas](#input\_visualizer\_replicas) | Number of visualizer replicas | `number` | `2` | no |
| [vpc\_cidr](#input\_vpc\_cidr) | VPC cidr | `string` | `"10.105.0.0/16"` | no |
| [vpc\_name](#input\_vpc\_name) | VPC name | `string` | `""` | no |
| [vpc\_private\_subnet\_cidrs](#input\_vpc\_private\_subnet\_cidrs) | Not required! You can set custom private subnets | `list(string)` | `null` | no |
| [vpc\_public\_subnet\_cidrs](#input\_vpc\_public\_subnet\_cidrs) | Not required! You can set custom public subnets | `list(string)` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| [blockscout\_url](#output\_blockscout\_url) | DNS name of frontend |