Terraform snippets

    The ibm_firewall resource specifies the name of the IBM Firewall instance, public_vlan_id is set to the public vlan id assigned to the VM instance, and the ibm_firewall_policy resource is used to create a policy for the firewall. The rules resource is used to create a ruleset for the IBM Firewall instance. The rule action is set to Deny all and the src_ip_address, src_ip_cidr, dst_ip_address, and dst_ip_cidr values are set to empty values. The protocol value is set to tcp.

    Shortcut: tf_ibm_firewall_policy

    resource "ibm_firewall" "${myResourceName}" {
       ha_enabled = false
       public_vlan_id = "${ibm_compute_vm_instance.myResourceName.public_vlan_id}"
    resource "ibm_firewall_policy" "rules" {
        firewall_id = "${}"
       rules = {
           action = ""
           src_ip_address = ""
           src_ip_cidr = 
           dst_ip_address = ""
           dst_ip_cidr = 
           dst_port_range_start = 1
           dst_port_range_end = 
           notes = "Deny all"
           protocol = "tcp"
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.