Skip to content

Instantly share code, notes, and snippets.

View calvin-puram's full-sized avatar
🎯
Focusing

Calvin Job Puram calvin-puram

🎯
Focusing
View GitHub Profile
...
resource "aws_instance" "dev-node" {
count = "${var.nodes_count}" // Declare it in variables.tf
ami = "${data.aws_ami.ubuntu.id}"
instance_type = "t2.micro"
key_name = "${aws_key_pair.aws_dev_key.key_name}"
security_groups = [
"${aws_security_group.allow_all.name}",
]
...
resource "aws_security_group" "allow_all" {
name = "allow_all"
description = "Allow all traffic"
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
...
resource "aws_route_table_association" "main-{{ name }}" {
subnet_id = "${aws_subnet.main-{{ name }}.id}"
route_table_id = "${aws_route_table.main-{{ name }}.id}"
}
...
resource "aws_vpc" "main-{{ name }}" {
cidr_block = "172.26.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
resource "aws_key_pair" "key-{{ name }}" {
key_name = "{{ name }}" public_key = var.public_key
}
provider "aws" { 
region = var.location 
version = "~>2.28"
}
output "ip_address" {
value = "${aws_instance.main-{{ name }}.*.public_ip}
}
terraform {
required_version = ">= 0.12"
}
resource "aws_s3_bucket" "terraform_state" {
bucket = "bucket name"
versioning {
enabled = true
}
# lifecycle {
# prevent_destroy = true
# }
Description
Ether Ethereum's cryptocurrency is called Ether (ETH). It is the fuel that keeps the network running. It is used to pay for the computational resources and transaction fees associated with each transaction carried out on the Ethereum network.
Smart Contracts A smart contract is a simple computer program that facilitates the exchange of any asset between two parties.
Ethereum Virtual Machine Ethereum provides the underlying technology, architecture, and software to understand smart contracts and interact with them.
Decentralized applications (Dapps) A Dapp is like any other piece of software you use. It might be a mobile app or a website. A Dapp is an application that is built on a decentralized network, such as Ethereum, as opposed to a conventional app