Terraform module to create firewall resource on google.
This project deploys a Google Cloud infrastructure using Terraform to create firewall .
To get started, make sure you have configured your GCP provider. You can use the following code as a starting point:
module "firewall" {
source = "git::https://github.com/slovink/terraform-google-firewall.git?ref=v1.0.0"
name = "app"
environment = "test"
firewall = module.vpc.vpc_id
priority = 1000
source_ranges = ["0.0.0.0/0"]
allow = [
{
protocol = "tcp"
ports = ["22", "80"]
}
]
}
Make sure to configure the provider block with your GCP credentials or use other authentication methods. Adjust the variables according to your requirements.
For detailed examples on how to use these modules, please refer to the Examples directory within this repository.
Your Name Replace MIT and slovink with the appropriate license and your information. Feel free to expand this README with additional details or usage instructions as needed for your specific use case.
This project is licensed under the MIT License - see the LICENSE file for details.
Name | Version |
---|---|
terraform | >=1.9.5 |
>= 3.50.0, < 5.11.0 |
Name | Version |
---|---|
>= 3.50.0, < 5.11.0 |
Name | Source | Version |
---|---|---|
labels | git::https://github.com/slovink/terraform-google-labels.git | v1.0.0 |
Name | Type |
---|---|
google_compute_firewall.rules | resource |
google_client_config.current | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
egress_rules | List of egress firewall rules. | list(object({ |
[ |
no |
environment | Environment (e.g. prod , dev , staging ). |
string |
"" |
no |
ingress_rules | List of ingress firewall rules. | list(object({ |
null |
no |
label_order | Label order, e.g. sequence of application name and environment name ,environment , 'attribute' [webserver ,qa ,devops ,public ,]. |
list(string) |
[ |
no |
managedby | ManagedBy, e.g. 'contact@slovink.com'. | string |
"contact@slovink.com" |
no |
name | Name of the resource. Provided by the client when the resource is created. | string |
"" |
no |
network | (Required) The VPC network the subnets belong to. Only networks that are in distributed mode can have subnetworks. | string |
"" |
no |
repository | Terraform current module repository. | string |
"https://github.com/slovink/terraform-google-firewall" |
no |
Name | Description |
---|---|
firewall_creation_timestamps | Creation timestamps of the created firewall rules. |
firewall_id | IDs of the created firewall rules. |
firewall_names | Names of the created firewall rules. |
firewall_self_links | Self-links of the created firewall rules. |