Skip to content

Commit 5ed7c49

Browse files
Import tf resources (#411)
* add kol-memory-viewer POC resources to TF * import blockscout taurus server to TF
1 parent 50378c6 commit 5ed7c49

File tree

8 files changed

+394
-0
lines changed

8 files changed

+394
-0
lines changed

auto-kol-memory/poc/backend.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
cloud {
3+
organization = "subspace-sre"
4+
5+
workspaces {
6+
name = "auto-kol-memory"
7+
}
8+
}
9+
}

auto-kol-memory/poc/main.tf

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
version = "~> 5.0"
6+
}
7+
}
8+
9+
required_version = ">= 1.0.0"
10+
}
11+
12+
provider "aws" {
13+
region = var.region
14+
}
15+
16+
# imported with `terraform import aws_instance.kol-memory-viewer i-0d3f0c603df4eabf4`
17+
# aws_instance.kol-memory-viewer:
18+
resource "aws_instance" "kol-memory-viewer" {
19+
ami = "ami-0e2c8caa4b6378d8c"
20+
associate_public_ip_address = true
21+
availability_zone = "us-east-1a"
22+
disable_api_stop = false
23+
disable_api_termination = false
24+
ebs_optimized = true
25+
get_password_data = false
26+
hibernation = false
27+
instance_initiated_shutdown_behavior = "stop"
28+
instance_type = "t3.large"
29+
key_name = "auto-kol"
30+
monitoring = false
31+
placement_partition_number = 0
32+
secondary_private_ips = []
33+
security_groups = []
34+
source_dest_check = true
35+
subnet_id = "subnet-0c9c609637361967a"
36+
tags = {
37+
"Name" = "kol-memory-viewer"
38+
}
39+
tags_all = {
40+
"Name" = "kol-memory-viewer"
41+
}
42+
tenancy = "default"
43+
vpc_security_group_ids = [
44+
"sg-012ef042c43b155ec",
45+
]
46+
47+
capacity_reservation_specification {
48+
capacity_reservation_preference = "open"
49+
}
50+
51+
cpu_options {
52+
core_count = 1
53+
threads_per_core = 2
54+
}
55+
56+
credit_specification {
57+
cpu_credits = "standard"
58+
}
59+
60+
enclave_options {
61+
enabled = false
62+
}
63+
64+
maintenance_options {
65+
auto_recovery = "default"
66+
}
67+
68+
metadata_options {
69+
http_endpoint = "enabled"
70+
http_protocol_ipv6 = "disabled"
71+
http_put_response_hop_limit = 2
72+
http_tokens = "required"
73+
instance_metadata_tags = "disabled"
74+
}
75+
76+
private_dns_name_options {
77+
enable_resource_name_dns_a_record = false
78+
enable_resource_name_dns_aaaa_record = false
79+
hostname_type = "ip-name"
80+
}
81+
82+
root_block_device {
83+
delete_on_termination = true
84+
encrypted = false
85+
iops = 3000
86+
tags = {}
87+
tags_all = {}
88+
throughput = 125
89+
volume_size = 8
90+
volume_type = "gp3"
91+
}
92+
}

auto-kol-memory/poc/outputs.tf

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
output "instance_id" {
2+
description = "The ID of the EC2 instance"
3+
value = aws_instance.kol-memory-viewer.id
4+
}
5+
6+
output "instance_arn" {
7+
description = "The ARN of the EC2 instance"
8+
value = aws_instance.kol-memory-viewer.arn
9+
}
10+
11+
output "instance_state" {
12+
description = "The current state of the instance"
13+
value = aws_instance.kol-memory-viewer.instance_state
14+
}
15+
16+
output "private_ip" {
17+
description = "Private IP address of the instance"
18+
value = aws_instance.kol-memory-viewer.private_ip
19+
}
20+
21+
output "public_ip" {
22+
description = "Public IP address of the instance"
23+
value = aws_instance.kol-memory-viewer.public_ip
24+
}
25+
26+
output "public_dns" {
27+
description = "Public DNS of the instance"
28+
value = aws_instance.kol-memory-viewer.public_dns
29+
}
30+
31+
output "subnet_id" {
32+
description = "Subnet ID where the instance is running"
33+
value = aws_instance.kol-memory-viewer.subnet_id
34+
}
35+
36+
output "vpc_security_group_ids" {
37+
description = "List of associated security groups"
38+
value = aws_instance.kol-memory-viewer.vpc_security_group_ids
39+
}
40+
41+
output "key_name" {
42+
description = "Name of the key pair used to launch the instance"
43+
value = aws_instance.kol-memory-viewer.key_name
44+
}
45+
46+
output "instance_type" {
47+
description = "The instance type of the EC2 instance"
48+
value = aws_instance.kol-memory-viewer.instance_type
49+
}
50+
51+
output "cpu_core_count" {
52+
description = "Number of CPU cores"
53+
value = aws_instance.kol-memory-viewer.cpu_core_count
54+
}
55+
56+
output "cpu_threads_per_core" {
57+
description = "Number of threads per core"
58+
value = aws_instance.kol-memory-viewer.cpu_threads_per_core
59+
}
60+
61+
output "ebs_optimized" {
62+
description = "Indicates whether the instance is EBS optimized"
63+
value = aws_instance.kol-memory-viewer.ebs_optimized
64+
}
65+
66+
output "root_volume_id" {
67+
description = "ID of the root EBS volume"
68+
value = aws_instance.kol-memory-viewer.root_block_device[0].volume_id
69+
}
70+
71+
output "root_volume_size" {
72+
description = "Size of the root volume in GB"
73+
value = aws_instance.kol-memory-viewer.root_block_device[0].volume_size
74+
}
75+
76+
output "root_volume_type" {
77+
description = "Type of the root volume (gp3, gp2, io1, etc.)"
78+
value = aws_instance.kol-memory-viewer.root_block_device[0].volume_type
79+
}
80+
81+
output "root_volume_iops" {
82+
description = "IOPS of the root volume"
83+
value = aws_instance.kol-memory-viewer.root_block_device[0].iops
84+
}
85+
86+
output "root_volume_throughput" {
87+
description = "Throughput of the root volume in MiB/s"
88+
value = aws_instance.kol-memory-viewer.root_block_device[0].throughput
89+
}
90+
91+
output "instance_details_json" {
92+
description = "Complete instance details in JSON format"
93+
value = jsonencode(aws_instance.kol-memory-viewer)
94+
}

auto-kol-memory/poc/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
variable "region" {
2+
description = "AWS region"
3+
default = "us-east-1"
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
cloud {
3+
organization = "subspace-sre"
4+
5+
workspaces {
6+
name = "blockscout"
7+
}
8+
}
9+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
version = "~> 5.0"
6+
}
7+
}
8+
9+
required_version = ">= 1.0.0"
10+
}
11+
12+
provider "aws" {
13+
region = var.region
14+
}
15+
16+
# imported with `terraform import aws_instance.blockscout_taurus i-0539bab3e0096f260`
17+
resource "aws_instance" "blockscout_taurus" {
18+
ami = "ami-05a9ac2fc2ef3e1d5"
19+
associate_public_ip_address = true
20+
availability_zone = "us-east-2b"
21+
disable_api_stop = false
22+
disable_api_termination = false
23+
ebs_optimized = true
24+
get_password_data = false
25+
hibernation = false
26+
instance_initiated_shutdown_behavior = "stop"
27+
instance_type = "m7a.2xlarge"
28+
key_name = "explorer-deployer"
29+
monitoring = false
30+
placement_partition_number = 0
31+
private_ip = "172.35.1.52"
32+
secondary_private_ips = []
33+
security_groups = []
34+
source_dest_check = true
35+
subnet_id = "subnet-0a57e78575b2bcf5a"
36+
tags = {
37+
"Name" = "blockscout-taurus"
38+
}
39+
tags_all = {
40+
"Name" = "blockscout-taurus"
41+
}
42+
tenancy = "default"
43+
vpc_security_group_ids = [
44+
"sg-05bfab744c63b40e9",
45+
]
46+
47+
capacity_reservation_specification {
48+
capacity_reservation_preference = "open"
49+
}
50+
51+
cpu_options {
52+
core_count = 8
53+
threads_per_core = 1
54+
}
55+
56+
enclave_options {
57+
enabled = false
58+
}
59+
60+
maintenance_options {
61+
auto_recovery = "default"
62+
}
63+
64+
metadata_options {
65+
http_endpoint = "enabled"
66+
http_protocol_ipv6 = "disabled"
67+
http_put_response_hop_limit = 1
68+
http_tokens = "optional"
69+
instance_metadata_tags = "disabled"
70+
}
71+
72+
private_dns_name_options {
73+
enable_resource_name_dns_a_record = false
74+
enable_resource_name_dns_aaaa_record = false
75+
hostname_type = "ip-name"
76+
}
77+
78+
root_block_device {
79+
delete_on_termination = true
80+
encrypted = false
81+
iops = 3000
82+
tags = {}
83+
tags_all = {}
84+
throughput = 125
85+
volume_size = 500
86+
volume_type = "gp3"
87+
}
88+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
output "instance_id" {
2+
description = "The ID of the EC2 instance"
3+
value = aws_instance.blockscout_taurus.id
4+
}
5+
6+
output "instance_arn" {
7+
description = "The ARN of the EC2 instance"
8+
value = aws_instance.blockscout_taurus.arn
9+
}
10+
11+
output "instance_state" {
12+
description = "The current state of the instance"
13+
value = aws_instance.blockscout_taurus.instance_state
14+
}
15+
16+
output "private_ip" {
17+
description = "Private IP address of the instance"
18+
value = aws_instance.blockscout_taurus.private_ip
19+
}
20+
21+
output "public_ip" {
22+
description = "Public IP address of the instance"
23+
value = aws_instance.blockscout_taurus.public_ip
24+
}
25+
26+
output "public_dns" {
27+
description = "Public DNS of the instance"
28+
value = aws_instance.blockscout_taurus.public_dns
29+
}
30+
31+
output "subnet_id" {
32+
description = "Subnet ID where the instance is running"
33+
value = aws_instance.blockscout_taurus.subnet_id
34+
}
35+
36+
output "vpc_security_group_ids" {
37+
description = "List of associated security groups"
38+
value = aws_instance.blockscout_taurus.vpc_security_group_ids
39+
}
40+
41+
output "key_name" {
42+
description = "Name of the key pair used to launch the instance"
43+
value = aws_instance.blockscout_taurus.key_name
44+
}
45+
46+
output "instance_type" {
47+
description = "The instance type of the EC2 instance"
48+
value = aws_instance.blockscout_taurus.instance_type
49+
}
50+
51+
output "cpu_core_count" {
52+
description = "Number of CPU cores"
53+
value = aws_instance.blockscout_taurus.cpu_core_count
54+
}
55+
56+
output "cpu_threads_per_core" {
57+
description = "Number of threads per core"
58+
value = aws_instance.blockscout_taurus.cpu_threads_per_core
59+
}
60+
61+
output "ebs_optimized" {
62+
description = "Indicates whether the instance is EBS optimized"
63+
value = aws_instance.blockscout_taurus.ebs_optimized
64+
}
65+
66+
output "root_volume_id" {
67+
description = "ID of the root EBS volume"
68+
value = aws_instance.blockscout_taurus.root_block_device[0].volume_id
69+
}
70+
71+
output "root_volume_size" {
72+
description = "Size of the root volume in GB"
73+
value = aws_instance.blockscout_taurus.root_block_device[0].volume_size
74+
}
75+
76+
output "root_volume_type" {
77+
description = "Type of the root volume (gp3, gp2, io1, etc.)"
78+
value = aws_instance.blockscout_taurus.root_block_device[0].volume_type
79+
}
80+
81+
output "root_volume_iops" {
82+
description = "IOPS of the root volume"
83+
value = aws_instance.blockscout_taurus.root_block_device[0].iops
84+
}
85+
86+
output "root_volume_throughput" {
87+
description = "Throughput of the root volume in MiB/s"
88+
value = aws_instance.blockscout_taurus.root_block_device[0].throughput
89+
}
90+
91+
output "instance_details_json" {
92+
description = "Complete instance details in JSON format"
93+
value = jsonencode(aws_instance.blockscout_taurus)
94+
}

0 commit comments

Comments
 (0)