I have create a simple Terraform recipe to set up an AWS Lightsail instance, to install Open Distro for Elasticsearch in it.
Everything ran smoothly during some days, and I could access and play with the Kibana instance in port 5601. But after some days, it was not accessible, and I discovered that I need to set up the firewall rule to let traffic access to port 5601.
I would like setting it up in the Terraform recipe as I've done for GCP with:
resource "google_compute_firewall" "kibana" {
name = "kibana-${random_id.instance_id.hex}"
network = "default"
allow {
protocol = "tcp"
ports = ["5601"]
}
source_ranges = ["0.0.0.0/0"]
}
But I haven't found a clear way to do it. Is aws_security_group what I need or is not way to set it up from Terraform?
Thank you!