Magic Firewall Ruleset Args
data class MagicFirewallRulesetArgs(val accountId: Output<String>? = null, val description: Output<String>? = null, val name: Output<String>? = null, val rules: Output<List<Map<String, String>>>? = null) : ConvertibleToJava<MagicFirewallRulesetArgs>
Magic Firewall is a network-level firewall to protect networks that are onboarded to Cloudflare's Magic Transit. This resource creates a root ruleset on the account level and contains one or more rules. Rules can be crafted in Wireshark syntax and are evaluated in order, with the first rule having the highest priority.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.MagicFirewallRuleset;
import com.pulumi.cloudflare.MagicFirewallRulesetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new MagicFirewallRuleset("example", MagicFirewallRulesetArgs.builder()
.accountId("d41d8cd98f00b204e9800998ecf8427e")
.description("Global mitigations")
.name("Magic Transit Ruleset")
.rules(
Map.ofEntries(
Map.entry("action", "allow"),
Map.entry("description", "Allow TCP Ephemeral Ports"),
Map.entry("enabled", "true"),
Map.entry("expression", "tcp.dstport in { 32768..65535 }")
),
Map.ofEntries(
Map.entry("action", "block"),
Map.entry("description", "Block all"),
Map.entry("enabled", "true"),
Map.entry("expression", "ip.len >= 0")
))
.build());
}
}
Content copied to clipboard
Import
An existing Magic Firewall Ruleset can be imported using the account ID and ruleset ID
$ pulumi import cloudflare:index/magicFirewallRuleset:MagicFirewallRuleset example d41d8cd98f00b204e9800998ecf8427e/cb029e245cfdd66dc8d2e570d5dd3322
Content copied to clipboard