gcp.compute.RegionSecurityPolicyRule
Explore with Pulumi AI
Import
RegionSecurityPolicyRule can be imported using any of these accepted formats* projects/{{project}}/regions/{{region}}/securityPolicies/{{security_policy}}/priority/{{priority}}
* {{project}}/{{region}}/{{security_policy}}/{{priority}}
* {{region}}/{{security_policy}}/{{priority}}
* {{security_policy}}/{{priority}}
In Terraform v1.5.0 and later, use an import
block to import RegionSecurityPolicyRule using one of the formats above. For exampletf import {
id = “projects/{{project}}/regions/{{region}}/securityPolicies/{{security_policy}}/priority/{{priority}}”
to = google_compute_region_security_policy_rule.default }
$ pulumi import gcp:compute/regionSecurityPolicyRule:RegionSecurityPolicyRule When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), RegionSecurityPolicyRule can be imported using one of the formats above. For example
$ pulumi import gcp:compute/regionSecurityPolicyRule:RegionSecurityPolicyRule default projects/{{project}}/regions/{{region}}/securityPolicies/{{security_policy}}/priority/{{priority}}
$ pulumi import gcp:compute/regionSecurityPolicyRule:RegionSecurityPolicyRule default {{project}}/{{region}}/{{security_policy}}/{{priority}}
$ pulumi import gcp:compute/regionSecurityPolicyRule:RegionSecurityPolicyRule default {{region}}/{{security_policy}}/{{priority}}
$ pulumi import gcp:compute/regionSecurityPolicyRule:RegionSecurityPolicyRule default {{security_policy}}/{{priority}}
Example Usage
Region Security Policy Rule Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.Compute.RegionSecurityPolicy("default", new()
{
Region = "us-west2",
Description = "basic region security policy",
Type = "CLOUD_ARMOR",
}, new CustomResourceOptions
{
Provider = google_beta,
});
var policyRule = new Gcp.Compute.RegionSecurityPolicyRule("policyRule", new()
{
Region = "us-west2",
SecurityPolicy = @default.Name,
Description = "new rule",
Priority = 100,
Match = new Gcp.Compute.Inputs.RegionSecurityPolicyRuleMatchArgs
{
VersionedExpr = "SRC_IPS_V1",
Config = new Gcp.Compute.Inputs.RegionSecurityPolicyRuleMatchConfigArgs
{
SrcIpRanges = new[]
{
"10.10.0.0/16",
},
},
},
Action = "allow",
Preview = true,
}, new CustomResourceOptions
{
Provider = google_beta,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewRegionSecurityPolicy(ctx, "default", &compute.RegionSecurityPolicyArgs{
Region: pulumi.String("us-west2"),
Description: pulumi.String("basic region security policy"),
Type: pulumi.String("CLOUD_ARMOR"),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = compute.NewRegionSecurityPolicyRule(ctx, "policyRule", &compute.RegionSecurityPolicyRuleArgs{
Region: pulumi.String("us-west2"),
SecurityPolicy: _default.Name,
Description: pulumi.String("new rule"),
Priority: pulumi.Int(100),
Match: &compute.RegionSecurityPolicyRuleMatchArgs{
VersionedExpr: pulumi.String("SRC_IPS_V1"),
Config: &compute.RegionSecurityPolicyRuleMatchConfigArgs{
SrcIpRanges: pulumi.StringArray{
pulumi.String("10.10.0.0/16"),
},
},
},
Action: pulumi.String("allow"),
Preview: pulumi.Bool(true),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionSecurityPolicy;
import com.pulumi.gcp.compute.RegionSecurityPolicyArgs;
import com.pulumi.gcp.compute.RegionSecurityPolicyRule;
import com.pulumi.gcp.compute.RegionSecurityPolicyRuleArgs;
import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyRuleMatchArgs;
import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyRuleMatchConfigArgs;
import com.pulumi.resources.CustomResourceOptions;
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 default_ = new RegionSecurityPolicy("default", RegionSecurityPolicyArgs.builder()
.region("us-west2")
.description("basic region security policy")
.type("CLOUD_ARMOR")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var policyRule = new RegionSecurityPolicyRule("policyRule", RegionSecurityPolicyRuleArgs.builder()
.region("us-west2")
.securityPolicy(default_.name())
.description("new rule")
.priority(100)
.match(RegionSecurityPolicyRuleMatchArgs.builder()
.versionedExpr("SRC_IPS_V1")
.config(RegionSecurityPolicyRuleMatchConfigArgs.builder()
.srcIpRanges("10.10.0.0/16")
.build())
.build())
.action("allow")
.preview(true)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import pulumi_gcp as gcp
default = gcp.compute.RegionSecurityPolicy("default",
region="us-west2",
description="basic region security policy",
type="CLOUD_ARMOR",
opts=pulumi.ResourceOptions(provider=google_beta))
policy_rule = gcp.compute.RegionSecurityPolicyRule("policyRule",
region="us-west2",
security_policy=default.name,
description="new rule",
priority=100,
match=gcp.compute.RegionSecurityPolicyRuleMatchArgs(
versioned_expr="SRC_IPS_V1",
config=gcp.compute.RegionSecurityPolicyRuleMatchConfigArgs(
src_ip_ranges=["10.10.0.0/16"],
),
),
action="allow",
preview=True,
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.compute.RegionSecurityPolicy("default", {
region: "us-west2",
description: "basic region security policy",
type: "CLOUD_ARMOR",
}, {
provider: google_beta,
});
const policyRule = new gcp.compute.RegionSecurityPolicyRule("policyRule", {
region: "us-west2",
securityPolicy: _default.name,
description: "new rule",
priority: 100,
match: {
versionedExpr: "SRC_IPS_V1",
config: {
srcIpRanges: ["10.10.0.0/16"],
},
},
action: "allow",
preview: true,
}, {
provider: google_beta,
});
resources:
default:
type: gcp:compute:RegionSecurityPolicy
properties:
region: us-west2
description: basic region security policy
type: CLOUD_ARMOR
options:
provider: ${["google-beta"]}
policyRule:
type: gcp:compute:RegionSecurityPolicyRule
properties:
region: us-west2
securityPolicy: ${default.name}
description: new rule
priority: 100
match:
versionedExpr: SRC_IPS_V1
config:
srcIpRanges:
- 10.10.0.0/16
action: allow
preview: true
options:
provider: ${["google-beta"]}
Region Security Policy Rule Multiple Rules
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.Compute.RegionSecurityPolicy("default", new()
{
Region = "us-west2",
Description = "basic region security policy",
Type = "CLOUD_ARMOR",
}, new CustomResourceOptions
{
Provider = google_beta,
});
var policyRuleOne = new Gcp.Compute.RegionSecurityPolicyRule("policyRuleOne", new()
{
Region = "us-west2",
SecurityPolicy = @default.Name,
Description = "new rule one",
Priority = 100,
Match = new Gcp.Compute.Inputs.RegionSecurityPolicyRuleMatchArgs
{
VersionedExpr = "SRC_IPS_V1",
Config = new Gcp.Compute.Inputs.RegionSecurityPolicyRuleMatchConfigArgs
{
SrcIpRanges = new[]
{
"10.10.0.0/16",
},
},
},
Action = "allow",
Preview = true,
}, new CustomResourceOptions
{
Provider = google_beta,
});
var policyRuleTwo = new Gcp.Compute.RegionSecurityPolicyRule("policyRuleTwo", new()
{
Region = "us-west2",
SecurityPolicy = @default.Name,
Description = "new rule two",
Priority = 101,
Match = new Gcp.Compute.Inputs.RegionSecurityPolicyRuleMatchArgs
{
VersionedExpr = "SRC_IPS_V1",
Config = new Gcp.Compute.Inputs.RegionSecurityPolicyRuleMatchConfigArgs
{
SrcIpRanges = new[]
{
"192.168.0.0/16",
"10.0.0.0/8",
},
},
},
Action = "allow",
Preview = true,
}, new CustomResourceOptions
{
Provider = google_beta,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewRegionSecurityPolicy(ctx, "default", &compute.RegionSecurityPolicyArgs{
Region: pulumi.String("us-west2"),
Description: pulumi.String("basic region security policy"),
Type: pulumi.String("CLOUD_ARMOR"),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = compute.NewRegionSecurityPolicyRule(ctx, "policyRuleOne", &compute.RegionSecurityPolicyRuleArgs{
Region: pulumi.String("us-west2"),
SecurityPolicy: _default.Name,
Description: pulumi.String("new rule one"),
Priority: pulumi.Int(100),
Match: &compute.RegionSecurityPolicyRuleMatchArgs{
VersionedExpr: pulumi.String("SRC_IPS_V1"),
Config: &compute.RegionSecurityPolicyRuleMatchConfigArgs{
SrcIpRanges: pulumi.StringArray{
pulumi.String("10.10.0.0/16"),
},
},
},
Action: pulumi.String("allow"),
Preview: pulumi.Bool(true),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = compute.NewRegionSecurityPolicyRule(ctx, "policyRuleTwo", &compute.RegionSecurityPolicyRuleArgs{
Region: pulumi.String("us-west2"),
SecurityPolicy: _default.Name,
Description: pulumi.String("new rule two"),
Priority: pulumi.Int(101),
Match: &compute.RegionSecurityPolicyRuleMatchArgs{
VersionedExpr: pulumi.String("SRC_IPS_V1"),
Config: &compute.RegionSecurityPolicyRuleMatchConfigArgs{
SrcIpRanges: pulumi.StringArray{
pulumi.String("192.168.0.0/16"),
pulumi.String("10.0.0.0/8"),
},
},
},
Action: pulumi.String("allow"),
Preview: pulumi.Bool(true),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionSecurityPolicy;
import com.pulumi.gcp.compute.RegionSecurityPolicyArgs;
import com.pulumi.gcp.compute.RegionSecurityPolicyRule;
import com.pulumi.gcp.compute.RegionSecurityPolicyRuleArgs;
import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyRuleMatchArgs;
import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyRuleMatchConfigArgs;
import com.pulumi.resources.CustomResourceOptions;
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 default_ = new RegionSecurityPolicy("default", RegionSecurityPolicyArgs.builder()
.region("us-west2")
.description("basic region security policy")
.type("CLOUD_ARMOR")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var policyRuleOne = new RegionSecurityPolicyRule("policyRuleOne", RegionSecurityPolicyRuleArgs.builder()
.region("us-west2")
.securityPolicy(default_.name())
.description("new rule one")
.priority(100)
.match(RegionSecurityPolicyRuleMatchArgs.builder()
.versionedExpr("SRC_IPS_V1")
.config(RegionSecurityPolicyRuleMatchConfigArgs.builder()
.srcIpRanges("10.10.0.0/16")
.build())
.build())
.action("allow")
.preview(true)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var policyRuleTwo = new RegionSecurityPolicyRule("policyRuleTwo", RegionSecurityPolicyRuleArgs.builder()
.region("us-west2")
.securityPolicy(default_.name())
.description("new rule two")
.priority(101)
.match(RegionSecurityPolicyRuleMatchArgs.builder()
.versionedExpr("SRC_IPS_V1")
.config(RegionSecurityPolicyRuleMatchConfigArgs.builder()
.srcIpRanges(
"192.168.0.0/16",
"10.0.0.0/8")
.build())
.build())
.action("allow")
.preview(true)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import pulumi_gcp as gcp
default = gcp.compute.RegionSecurityPolicy("default",
region="us-west2",
description="basic region security policy",
type="CLOUD_ARMOR",
opts=pulumi.ResourceOptions(provider=google_beta))
policy_rule_one = gcp.compute.RegionSecurityPolicyRule("policyRuleOne",
region="us-west2",
security_policy=default.name,
description="new rule one",
priority=100,
match=gcp.compute.RegionSecurityPolicyRuleMatchArgs(
versioned_expr="SRC_IPS_V1",
config=gcp.compute.RegionSecurityPolicyRuleMatchConfigArgs(
src_ip_ranges=["10.10.0.0/16"],
),
),
action="allow",
preview=True,
opts=pulumi.ResourceOptions(provider=google_beta))
policy_rule_two = gcp.compute.RegionSecurityPolicyRule("policyRuleTwo",
region="us-west2",
security_policy=default.name,
description="new rule two",
priority=101,
match=gcp.compute.RegionSecurityPolicyRuleMatchArgs(
versioned_expr="SRC_IPS_V1",
config=gcp.compute.RegionSecurityPolicyRuleMatchConfigArgs(
src_ip_ranges=[
"192.168.0.0/16",
"10.0.0.0/8",
],
),
),
action="allow",
preview=True,
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.compute.RegionSecurityPolicy("default", {
region: "us-west2",
description: "basic region security policy",
type: "CLOUD_ARMOR",
}, {
provider: google_beta,
});
const policyRuleOne = new gcp.compute.RegionSecurityPolicyRule("policyRuleOne", {
region: "us-west2",
securityPolicy: _default.name,
description: "new rule one",
priority: 100,
match: {
versionedExpr: "SRC_IPS_V1",
config: {
srcIpRanges: ["10.10.0.0/16"],
},
},
action: "allow",
preview: true,
}, {
provider: google_beta,
});
const policyRuleTwo = new gcp.compute.RegionSecurityPolicyRule("policyRuleTwo", {
region: "us-west2",
securityPolicy: _default.name,
description: "new rule two",
priority: 101,
match: {
versionedExpr: "SRC_IPS_V1",
config: {
srcIpRanges: [
"192.168.0.0/16",
"10.0.0.0/8",
],
},
},
action: "allow",
preview: true,
}, {
provider: google_beta,
});
resources:
default:
type: gcp:compute:RegionSecurityPolicy
properties:
region: us-west2
description: basic region security policy
type: CLOUD_ARMOR
options:
provider: ${["google-beta"]}
policyRuleOne:
type: gcp:compute:RegionSecurityPolicyRule
properties:
region: us-west2
securityPolicy: ${default.name}
description: new rule one
priority: 100
match:
versionedExpr: SRC_IPS_V1
config:
srcIpRanges:
- 10.10.0.0/16
action: allow
preview: true
options:
provider: ${["google-beta"]}
policyRuleTwo:
type: gcp:compute:RegionSecurityPolicyRule
properties:
region: us-west2
securityPolicy: ${default.name}
description: new rule two
priority: 101
match:
versionedExpr: SRC_IPS_V1
config:
srcIpRanges:
- 192.168.0.0/16
- 10.0.0.0/8
action: allow
preview: true
options:
provider: ${["google-beta"]}
Region Security Policy Rule With Network Match
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
// First activate advanced network DDoS protection for the desired region
var policyddosprotection = new Gcp.Compute.RegionSecurityPolicy("policyddosprotection", new()
{
Region = "us-west2",
Description = "policy for activating network DDoS protection for the desired region",
Type = "CLOUD_ARMOR_NETWORK",
DdosProtectionConfig = new Gcp.Compute.Inputs.RegionSecurityPolicyDdosProtectionConfigArgs
{
DdosProtection = "ADVANCED_PREVIEW",
},
}, new CustomResourceOptions
{
Provider = google_beta,
});
var edgeSecService = new Gcp.Compute.NetworkEdgeSecurityService("edgeSecService", new()
{
Region = "us-west2",
Description = "linking policy to edge security service",
SecurityPolicy = policyddosprotection.SelfLink,
}, new CustomResourceOptions
{
Provider = google_beta,
});
// Add the desired policy and custom rule.
var policynetworkmatch = new Gcp.Compute.RegionSecurityPolicy("policynetworkmatch", new()
{
Region = "us-west2",
Description = "region security policy for network match",
Type = "CLOUD_ARMOR_NETWORK",
UserDefinedFields = new[]
{
new Gcp.Compute.Inputs.RegionSecurityPolicyUserDefinedFieldArgs
{
Name = "SIG1_AT_0",
Base = "TCP",
Offset = 8,
Size = 2,
Mask = "0x8F00",
},
},
}, new CustomResourceOptions
{
Provider = google_beta,
DependsOn = new[]
{
edgeSecService,
},
});
var policyRuleNetworkMatch = new Gcp.Compute.RegionSecurityPolicyRule("policyRuleNetworkMatch", new()
{
Region = "us-west2",
SecurityPolicy = policynetworkmatch.Name,
Description = "custom rule for network match",
Priority = 100,
NetworkMatch = new Gcp.Compute.Inputs.RegionSecurityPolicyRuleNetworkMatchArgs
{
SrcIpRanges = new[]
{
"10.10.0.0/16",
},
UserDefinedFields = new[]
{
new Gcp.Compute.Inputs.RegionSecurityPolicyRuleNetworkMatchUserDefinedFieldArgs
{
Name = "SIG1_AT_0",
Values = new[]
{
"0x8F00",
},
},
},
},
Action = "allow",
Preview = true,
}, new CustomResourceOptions
{
Provider = google_beta,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
policyddosprotection, err := compute.NewRegionSecurityPolicy(ctx, "policyddosprotection", &compute.RegionSecurityPolicyArgs{
Region: pulumi.String("us-west2"),
Description: pulumi.String("policy for activating network DDoS protection for the desired region"),
Type: pulumi.String("CLOUD_ARMOR_NETWORK"),
DdosProtectionConfig: &compute.RegionSecurityPolicyDdosProtectionConfigArgs{
DdosProtection: pulumi.String("ADVANCED_PREVIEW"),
},
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
edgeSecService, err := compute.NewNetworkEdgeSecurityService(ctx, "edgeSecService", &compute.NetworkEdgeSecurityServiceArgs{
Region: pulumi.String("us-west2"),
Description: pulumi.String("linking policy to edge security service"),
SecurityPolicy: policyddosprotection.SelfLink,
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
policynetworkmatch, err := compute.NewRegionSecurityPolicy(ctx, "policynetworkmatch", &compute.RegionSecurityPolicyArgs{
Region: pulumi.String("us-west2"),
Description: pulumi.String("region security policy for network match"),
Type: pulumi.String("CLOUD_ARMOR_NETWORK"),
UserDefinedFields: compute.RegionSecurityPolicyUserDefinedFieldArray{
&compute.RegionSecurityPolicyUserDefinedFieldArgs{
Name: pulumi.String("SIG1_AT_0"),
Base: pulumi.String("TCP"),
Offset: pulumi.Int(8),
Size: pulumi.Int(2),
Mask: pulumi.String("0x8F00"),
},
},
}, pulumi.Provider(google_beta), pulumi.DependsOn([]pulumi.Resource{
edgeSecService,
}))
if err != nil {
return err
}
_, err = compute.NewRegionSecurityPolicyRule(ctx, "policyRuleNetworkMatch", &compute.RegionSecurityPolicyRuleArgs{
Region: pulumi.String("us-west2"),
SecurityPolicy: policynetworkmatch.Name,
Description: pulumi.String("custom rule for network match"),
Priority: pulumi.Int(100),
NetworkMatch: &compute.RegionSecurityPolicyRuleNetworkMatchArgs{
SrcIpRanges: pulumi.StringArray{
pulumi.String("10.10.0.0/16"),
},
UserDefinedFields: compute.RegionSecurityPolicyRuleNetworkMatchUserDefinedFieldArray{
&compute.RegionSecurityPolicyRuleNetworkMatchUserDefinedFieldArgs{
Name: pulumi.String("SIG1_AT_0"),
Values: pulumi.StringArray{
pulumi.String("0x8F00"),
},
},
},
},
Action: pulumi.String("allow"),
Preview: pulumi.Bool(true),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionSecurityPolicy;
import com.pulumi.gcp.compute.RegionSecurityPolicyArgs;
import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyDdosProtectionConfigArgs;
import com.pulumi.gcp.compute.NetworkEdgeSecurityService;
import com.pulumi.gcp.compute.NetworkEdgeSecurityServiceArgs;
import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyUserDefinedFieldArgs;
import com.pulumi.gcp.compute.RegionSecurityPolicyRule;
import com.pulumi.gcp.compute.RegionSecurityPolicyRuleArgs;
import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyRuleNetworkMatchArgs;
import com.pulumi.resources.CustomResourceOptions;
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 policyddosprotection = new RegionSecurityPolicy("policyddosprotection", RegionSecurityPolicyArgs.builder()
.region("us-west2")
.description("policy for activating network DDoS protection for the desired region")
.type("CLOUD_ARMOR_NETWORK")
.ddosProtectionConfig(RegionSecurityPolicyDdosProtectionConfigArgs.builder()
.ddosProtection("ADVANCED_PREVIEW")
.build())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var edgeSecService = new NetworkEdgeSecurityService("edgeSecService", NetworkEdgeSecurityServiceArgs.builder()
.region("us-west2")
.description("linking policy to edge security service")
.securityPolicy(policyddosprotection.selfLink())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var policynetworkmatch = new RegionSecurityPolicy("policynetworkmatch", RegionSecurityPolicyArgs.builder()
.region("us-west2")
.description("region security policy for network match")
.type("CLOUD_ARMOR_NETWORK")
.userDefinedFields(RegionSecurityPolicyUserDefinedFieldArgs.builder()
.name("SIG1_AT_0")
.base("TCP")
.offset(8)
.size(2)
.mask("0x8F00")
.build())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.dependsOn(edgeSecService)
.build());
var policyRuleNetworkMatch = new RegionSecurityPolicyRule("policyRuleNetworkMatch", RegionSecurityPolicyRuleArgs.builder()
.region("us-west2")
.securityPolicy(policynetworkmatch.name())
.description("custom rule for network match")
.priority(100)
.networkMatch(RegionSecurityPolicyRuleNetworkMatchArgs.builder()
.srcIpRanges("10.10.0.0/16")
.userDefinedFields(RegionSecurityPolicyRuleNetworkMatchUserDefinedFieldArgs.builder()
.name("SIG1_AT_0")
.values("0x8F00")
.build())
.build())
.action("allow")
.preview(true)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import pulumi_gcp as gcp
# First activate advanced network DDoS protection for the desired region
policyddosprotection = gcp.compute.RegionSecurityPolicy("policyddosprotection",
region="us-west2",
description="policy for activating network DDoS protection for the desired region",
type="CLOUD_ARMOR_NETWORK",
ddos_protection_config=gcp.compute.RegionSecurityPolicyDdosProtectionConfigArgs(
ddos_protection="ADVANCED_PREVIEW",
),
opts=pulumi.ResourceOptions(provider=google_beta))
edge_sec_service = gcp.compute.NetworkEdgeSecurityService("edgeSecService",
region="us-west2",
description="linking policy to edge security service",
security_policy=policyddosprotection.self_link,
opts=pulumi.ResourceOptions(provider=google_beta))
# Add the desired policy and custom rule.
policynetworkmatch = gcp.compute.RegionSecurityPolicy("policynetworkmatch",
region="us-west2",
description="region security policy for network match",
type="CLOUD_ARMOR_NETWORK",
user_defined_fields=[gcp.compute.RegionSecurityPolicyUserDefinedFieldArgs(
name="SIG1_AT_0",
base="TCP",
offset=8,
size=2,
mask="0x8F00",
)],
opts=pulumi.ResourceOptions(provider=google_beta,
depends_on=[edge_sec_service]))
policy_rule_network_match = gcp.compute.RegionSecurityPolicyRule("policyRuleNetworkMatch",
region="us-west2",
security_policy=policynetworkmatch.name,
description="custom rule for network match",
priority=100,
network_match=gcp.compute.RegionSecurityPolicyRuleNetworkMatchArgs(
src_ip_ranges=["10.10.0.0/16"],
user_defined_fields=[gcp.compute.RegionSecurityPolicyRuleNetworkMatchUserDefinedFieldArgs(
name="SIG1_AT_0",
values=["0x8F00"],
)],
),
action="allow",
preview=True,
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
// First activate advanced network DDoS protection for the desired region
const policyddosprotection = new gcp.compute.RegionSecurityPolicy("policyddosprotection", {
region: "us-west2",
description: "policy for activating network DDoS protection for the desired region",
type: "CLOUD_ARMOR_NETWORK",
ddosProtectionConfig: {
ddosProtection: "ADVANCED_PREVIEW",
},
}, {
provider: google_beta,
});
const edgeSecService = new gcp.compute.NetworkEdgeSecurityService("edgeSecService", {
region: "us-west2",
description: "linking policy to edge security service",
securityPolicy: policyddosprotection.selfLink,
}, {
provider: google_beta,
});
// Add the desired policy and custom rule.
const policynetworkmatch = new gcp.compute.RegionSecurityPolicy("policynetworkmatch", {
region: "us-west2",
description: "region security policy for network match",
type: "CLOUD_ARMOR_NETWORK",
userDefinedFields: [{
name: "SIG1_AT_0",
base: "TCP",
offset: 8,
size: 2,
mask: "0x8F00",
}],
}, {
provider: google_beta,
dependsOn: [edgeSecService],
});
const policyRuleNetworkMatch = new gcp.compute.RegionSecurityPolicyRule("policyRuleNetworkMatch", {
region: "us-west2",
securityPolicy: policynetworkmatch.name,
description: "custom rule for network match",
priority: 100,
networkMatch: {
srcIpRanges: ["10.10.0.0/16"],
userDefinedFields: [{
name: "SIG1_AT_0",
values: ["0x8F00"],
}],
},
action: "allow",
preview: true,
}, {
provider: google_beta,
});
resources:
# First activate advanced network DDoS protection for the desired region
policyddosprotection:
type: gcp:compute:RegionSecurityPolicy
properties:
region: us-west2
description: policy for activating network DDoS protection for the desired region
type: CLOUD_ARMOR_NETWORK
ddosProtectionConfig:
ddosProtection: ADVANCED_PREVIEW
options:
provider: ${["google-beta"]}
edgeSecService:
type: gcp:compute:NetworkEdgeSecurityService
properties:
region: us-west2
description: linking policy to edge security service
securityPolicy: ${policyddosprotection.selfLink}
options:
provider: ${["google-beta"]}
# Add the desired policy and custom rule.
policynetworkmatch:
type: gcp:compute:RegionSecurityPolicy
properties:
region: us-west2
description: region security policy for network match
type: CLOUD_ARMOR_NETWORK
userDefinedFields:
- name: SIG1_AT_0
base: TCP
offset: 8
size: 2
mask: 0x8F00
options:
provider: ${["google-beta"]}
dependson:
- ${edgeSecService}
policyRuleNetworkMatch:
type: gcp:compute:RegionSecurityPolicyRule
properties:
region: us-west2
securityPolicy: ${policynetworkmatch.name}
description: custom rule for network match
priority: 100
networkMatch:
srcIpRanges:
- 10.10.0.0/16
userDefinedFields:
- name: SIG1_AT_0
values:
- 0x8F00
action: allow
preview: true
options:
provider: ${["google-beta"]}
Create RegionSecurityPolicyRule Resource
new RegionSecurityPolicyRule(name: string, args: RegionSecurityPolicyRuleArgs, opts?: CustomResourceOptions);
@overload
def RegionSecurityPolicyRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
description: Optional[str] = None,
match: Optional[RegionSecurityPolicyRuleMatchArgs] = None,
network_match: Optional[RegionSecurityPolicyRuleNetworkMatchArgs] = None,
preview: Optional[bool] = None,
priority: Optional[int] = None,
project: Optional[str] = None,
region: Optional[str] = None,
security_policy: Optional[str] = None)
@overload
def RegionSecurityPolicyRule(resource_name: str,
args: RegionSecurityPolicyRuleArgs,
opts: Optional[ResourceOptions] = None)
func NewRegionSecurityPolicyRule(ctx *Context, name string, args RegionSecurityPolicyRuleArgs, opts ...ResourceOption) (*RegionSecurityPolicyRule, error)
public RegionSecurityPolicyRule(string name, RegionSecurityPolicyRuleArgs args, CustomResourceOptions? opts = null)
public RegionSecurityPolicyRule(String name, RegionSecurityPolicyRuleArgs args)
public RegionSecurityPolicyRule(String name, RegionSecurityPolicyRuleArgs args, CustomResourceOptions options)
type: gcp:compute:RegionSecurityPolicyRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegionSecurityPolicyRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RegionSecurityPolicyRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RegionSecurityPolicyRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegionSecurityPolicyRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RegionSecurityPolicyRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RegionSecurityPolicyRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The RegionSecurityPolicyRule resource accepts the following input properties:
- Action string
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- Priority int
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- Region string
The Region in which the created Region Security Policy rule should reside.
- Security
Policy string The name of the security policy this rule belongs to.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Match
Region
Security Policy Rule Match A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Match RegionSecurity Policy Rule Network Match A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- Preview bool
If set to true, the specified action is not enforced.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Action string
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- Priority int
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- Region string
The Region in which the created Region Security Policy rule should reside.
- Security
Policy string The name of the security policy this rule belongs to.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Match
Region
Security Policy Rule Match Args A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Match RegionSecurity Policy Rule Network Match Args A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- Preview bool
If set to true, the specified action is not enforced.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- action String
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- priority Integer
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- region String
The Region in which the created Region Security Policy rule should reside.
- security
Policy String The name of the security policy this rule belongs to.
- description String
An optional description of this resource. Provide this property when you create the resource.
- match
Region
Security Policy Rule Match A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Match RegionSecurity Policy Rule Network Match A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview Boolean
If set to true, the specified action is not enforced.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- action string
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- priority number
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- region string
The Region in which the created Region Security Policy rule should reside.
- security
Policy string The name of the security policy this rule belongs to.
- description string
An optional description of this resource. Provide this property when you create the resource.
- match
Region
Security Policy Rule Match A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Match RegionSecurity Policy Rule Network Match A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview boolean
If set to true, the specified action is not enforced.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- action str
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- priority int
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- region str
The Region in which the created Region Security Policy rule should reside.
- security_
policy str The name of the security policy this rule belongs to.
- description str
An optional description of this resource. Provide this property when you create the resource.
- match
Region
Security Policy Rule Match Args A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network_
match RegionSecurity Policy Rule Network Match Args A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview bool
If set to true, the specified action is not enforced.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- action String
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- priority Number
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- region String
The Region in which the created Region Security Policy rule should reside.
- security
Policy String The name of the security policy this rule belongs to.
- description String
An optional description of this resource. Provide this property when you create the resource.
- match Property Map
A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Match Property Map A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview Boolean
If set to true, the specified action is not enforced.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the RegionSecurityPolicyRule resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing RegionSecurityPolicyRule Resource
Get an existing RegionSecurityPolicyRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RegionSecurityPolicyRuleState, opts?: CustomResourceOptions): RegionSecurityPolicyRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
description: Optional[str] = None,
match: Optional[RegionSecurityPolicyRuleMatchArgs] = None,
network_match: Optional[RegionSecurityPolicyRuleNetworkMatchArgs] = None,
preview: Optional[bool] = None,
priority: Optional[int] = None,
project: Optional[str] = None,
region: Optional[str] = None,
security_policy: Optional[str] = None) -> RegionSecurityPolicyRule
func GetRegionSecurityPolicyRule(ctx *Context, name string, id IDInput, state *RegionSecurityPolicyRuleState, opts ...ResourceOption) (*RegionSecurityPolicyRule, error)
public static RegionSecurityPolicyRule Get(string name, Input<string> id, RegionSecurityPolicyRuleState? state, CustomResourceOptions? opts = null)
public static RegionSecurityPolicyRule get(String name, Output<String> id, RegionSecurityPolicyRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Action string
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Match
Region
Security Policy Rule Match A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Match RegionSecurity Policy Rule Network Match A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- Preview bool
If set to true, the specified action is not enforced.
- Priority int
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
The Region in which the created Region Security Policy rule should reside.
- Security
Policy string The name of the security policy this rule belongs to.
- Action string
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Match
Region
Security Policy Rule Match Args A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- Network
Match RegionSecurity Policy Rule Network Match Args A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- Preview bool
If set to true, the specified action is not enforced.
- Priority int
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
The Region in which the created Region Security Policy rule should reside.
- Security
Policy string The name of the security policy this rule belongs to.
- action String
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- description String
An optional description of this resource. Provide this property when you create the resource.
- match
Region
Security Policy Rule Match A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Match RegionSecurity Policy Rule Network Match A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview Boolean
If set to true, the specified action is not enforced.
- priority Integer
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
The Region in which the created Region Security Policy rule should reside.
- security
Policy String The name of the security policy this rule belongs to.
- action string
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- description string
An optional description of this resource. Provide this property when you create the resource.
- match
Region
Security Policy Rule Match A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Match RegionSecurity Policy Rule Network Match A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview boolean
If set to true, the specified action is not enforced.
- priority number
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
The Region in which the created Region Security Policy rule should reside.
- security
Policy string The name of the security policy this rule belongs to.
- action str
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- description str
An optional description of this resource. Provide this property when you create the resource.
- match
Region
Security Policy Rule Match Args A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network_
match RegionSecurity Policy Rule Network Match Args A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview bool
If set to true, the specified action is not enforced.
- priority int
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
The Region in which the created Region Security Policy rule should reside.
- security_
policy str The name of the security policy this rule belongs to.
- action String
The Action to perform when the rule is matched. The following are the valid actions:
- allow: allow access to target.
- deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for STATUS are 403, 404, and 502.
- rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rateLimitOptions to be set.
- redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR.
- throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rateLimitOptions to be set for this.
- description String
An optional description of this resource. Provide this property when you create the resource.
- match Property Map
A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. Structure is documented below.
- network
Match Property Map A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive Structure is documented below.
- preview Boolean
If set to true, the specified action is not enforced.
- priority Number
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
The Region in which the created Region Security Policy rule should reside.
- security
Policy String The name of the security policy this rule belongs to.
Supporting Types
RegionSecurityPolicyRuleMatch, RegionSecurityPolicyRuleMatchArgs
- Config
Region
Security Policy Rule Match Config The configuration options available when specifying versionedExpr. This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. Structure is documented below.
- Versioned
Expr string Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. Possible values are:
SRC_IPS_V1
.
- Config
Region
Security Policy Rule Match Config The configuration options available when specifying versionedExpr. This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. Structure is documented below.
- Versioned
Expr string Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. Possible values are:
SRC_IPS_V1
.
- config
Region
Security Policy Rule Match Config The configuration options available when specifying versionedExpr. This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. Structure is documented below.
- versioned
Expr String Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. Possible values are:
SRC_IPS_V1
.
- config
Region
Security Policy Rule Match Config The configuration options available when specifying versionedExpr. This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. Structure is documented below.
- versioned
Expr string Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. Possible values are:
SRC_IPS_V1
.
- config
Region
Security Policy Rule Match Config The configuration options available when specifying versionedExpr. This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. Structure is documented below.
- versioned_
expr str Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. Possible values are:
SRC_IPS_V1
.
- config Property Map
The configuration options available when specifying versionedExpr. This field must be specified if versionedExpr is specified and cannot be specified if versionedExpr is not specified. Structure is documented below.
- versioned
Expr String Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding srcIpRange field in config. Possible values are:
SRC_IPS_V1
.
RegionSecurityPolicyRuleMatchConfig, RegionSecurityPolicyRuleMatchConfigArgs
- Src
Ip List<string>Ranges CIDR IP address range. Maximum number of srcIpRanges allowed is 10.
- Src
Ip []stringRanges CIDR IP address range. Maximum number of srcIpRanges allowed is 10.
- src
Ip List<String>Ranges CIDR IP address range. Maximum number of srcIpRanges allowed is 10.
- src
Ip string[]Ranges CIDR IP address range. Maximum number of srcIpRanges allowed is 10.
- src_
ip_ Sequence[str]ranges CIDR IP address range. Maximum number of srcIpRanges allowed is 10.
- src
Ip List<String>Ranges CIDR IP address range. Maximum number of srcIpRanges allowed is 10.
RegionSecurityPolicyRuleNetworkMatch, RegionSecurityPolicyRuleNetworkMatchArgs
- Dest
Ip List<string>Ranges Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- Dest
Ports List<string> Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- Ip
Protocols List<string> IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp".
- Src
Asns List<int> BGP Autonomous System Number associated with the source IP address.
- Src
Ip List<string>Ranges Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- Src
Ports List<string> Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- Src
Region List<string>Codes Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.
- User
Defined List<RegionFields Security Policy Rule Network Match User Defined Field> User-defined fields. Each element names a defined field and lists the matching values for that field. Structure is documented below.
- Dest
Ip []stringRanges Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- Dest
Ports []string Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- Ip
Protocols []string IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp".
- Src
Asns []int BGP Autonomous System Number associated with the source IP address.
- Src
Ip []stringRanges Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- Src
Ports []string Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- Src
Region []stringCodes Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.
- User
Defined []RegionFields Security Policy Rule Network Match User Defined Field User-defined fields. Each element names a defined field and lists the matching values for that field. Structure is documented below.
- dest
Ip List<String>Ranges Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- dest
Ports List<String> Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- ip
Protocols List<String> IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp".
- src
Asns List<Integer> BGP Autonomous System Number associated with the source IP address.
- src
Ip List<String>Ranges Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- src
Ports List<String> Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- src
Region List<String>Codes Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.
- user
Defined List<RegionFields Security Policy Rule Network Match User Defined Field> User-defined fields. Each element names a defined field and lists the matching values for that field. Structure is documented below.
- dest
Ip string[]Ranges Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- dest
Ports string[] Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- ip
Protocols string[] IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp".
- src
Asns number[] BGP Autonomous System Number associated with the source IP address.
- src
Ip string[]Ranges Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- src
Ports string[] Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- src
Region string[]Codes Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.
- user
Defined RegionFields Security Policy Rule Network Match User Defined Field[] User-defined fields. Each element names a defined field and lists the matching values for that field. Structure is documented below.
- dest_
ip_ Sequence[str]ranges Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- dest_
ports Sequence[str] Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- ip_
protocols Sequence[str] IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp".
- src_
asns Sequence[int] BGP Autonomous System Number associated with the source IP address.
- src_
ip_ Sequence[str]ranges Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- src_
ports Sequence[str] Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- src_
region_ Sequence[str]codes Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.
- user_
defined_ Sequence[Regionfields Security Policy Rule Network Match User Defined Field] User-defined fields. Each element names a defined field and lists the matching values for that field. Structure is documented below.
- dest
Ip List<String>Ranges Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- dest
Ports List<String> Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- ip
Protocols List<String> IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp".
- src
Asns List<Number> BGP Autonomous System Number associated with the source IP address.
- src
Ip List<String>Ranges Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
- src
Ports List<String> Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
- src
Region List<String>Codes Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.
- user
Defined List<Property Map>Fields User-defined fields. Each element names a defined field and lists the matching values for that field. Structure is documented below.
RegionSecurityPolicyRuleNetworkMatchUserDefinedField, RegionSecurityPolicyRuleNetworkMatchUserDefinedFieldArgs
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.