Terraform to allow and block a single IP address
Terraform to allow and block a single IP address
```hcl
provider "aws" {
region = "us-east-1" # Update with your desired region
}
Make sure to replace `"your-vpc-id"` with the ID of your VPC where you want to
create this security group. This Terraform template will create a security group
named "allow-only-specific-ips-sg" with two inbound rules: one to block traffic
from the IP address 10.20.30.40 and another to allow traffic from the IP address
50.60.70.80. Additionally, it includes an outbound rule that allows all traffic to
any destination.
After saving the above code in a `.tf` file, you can run `terraform init`,
`terraform plan`, and `terraform apply` commands in the directory where the file is
located to create the security group in your AWS account.