Open apoorvpandey-ap opened 2 years ago
resource "linode_domain" "example_domain" {
domain = "virtualdoxxindia.com"
soa_email = "apoorvcreate@gmail.com"
type = "master"
}
# domain record
resource "linode_domain_record" "example_domain_record" {
domain_id = linode_domain.example_domain.id
name = "virtualdoxxindia.com"
record_type = "A"
target = linode_instance.example_instance.ip_address
ttl_sec = 300
}
resource "linode_firewall" "example_firewall" {
label = "example_firewall_label"
inbound {
label = "allow-http"
action = "ACCEPT"
protocol = "TCP"
ports = "80"
ipv4 = ["0.0.0.0/0"]
ipv6 = ["ff00::/8"]
}
inbound_policy = "DROP"
outbound_policy = "ACCEPT"
linodes = [linode_instance.example_instance.id]
}
Step 1. Login to Linode.
Step 2. Install terraform on your machine and set the environment
Step 3. Open VS code and write this code
official link -https://www.linode.com/docs/guides/introduction-to-hcl/
Step 4. Run terraform command on terminal
terraforn init
terraforn plan
terraform apply