1. Packages
  2. Netlify Provider
  3. API Docs
  4. SiteFirewallTrafficRules
netlify 0.2.2 published on Friday, Mar 7, 2025 by netlify

netlify.SiteFirewallTrafficRules

Explore with Pulumi AI

netlify logo
netlify 0.2.2 published on Friday, Mar 7, 2025 by netlify

    Netlify site-level firewall traffic rules. Read more

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netlify.SiteFirewallTrafficRules;
    import com.pulumi.netlify.SiteFirewallTrafficRulesArgs;
    import com.pulumi.netlify.inputs.SiteFirewallTrafficRulesPublishedArgs;
    import com.pulumi.netlify.inputs.SiteFirewallTrafficRulesUnpublishedArgs;
    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 blog = new SiteFirewallTrafficRules("blog", SiteFirewallTrafficRulesArgs.builder()
                .siteId(data.netlify_site().blog().id())
                .published(SiteFirewallTrafficRulesPublishedArgs.builder()
                    .default_action("allow")
                    .ip_restrictions(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                    .geo_exceptions(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                    .build())
                .unpublished(SiteFirewallTrafficRulesUnpublishedArgs.builder()
                    .default_action("deny")
                    .ip_exceptions(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                    .build())
                .build());
    
        }
    }
    
    resources:
      blog:
        type: netlify:SiteFirewallTrafficRules
        properties:
          siteId: ${data.netlify_site.blog.id}
          published:
            default_action: allow
            ip_restrictions:
              - description: bot network
                addresses:
                  - 192.0.2.0/24
                  - 198.51.100.0/24
            geo_exceptions:
              - description: brazil
                countries:
                  - BR
          unpublished:
            default_action: deny
            ip_exceptions:
              - description: Allow the VPN IP
                addresses:
                  - 203.0.113.65/32
    

    Create SiteFirewallTrafficRules Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SiteFirewallTrafficRules(name: string, args: SiteFirewallTrafficRulesArgs, opts?: CustomResourceOptions);
    @overload
    def SiteFirewallTrafficRules(resource_name: str,
                                 args: SiteFirewallTrafficRulesArgs,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def SiteFirewallTrafficRules(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 published: Optional[SiteFirewallTrafficRulesPublishedArgs] = None,
                                 site_id: Optional[str] = None,
                                 unpublished: Optional[SiteFirewallTrafficRulesUnpublishedArgs] = None)
    func NewSiteFirewallTrafficRules(ctx *Context, name string, args SiteFirewallTrafficRulesArgs, opts ...ResourceOption) (*SiteFirewallTrafficRules, error)
    public SiteFirewallTrafficRules(string name, SiteFirewallTrafficRulesArgs args, CustomResourceOptions? opts = null)
    public SiteFirewallTrafficRules(String name, SiteFirewallTrafficRulesArgs args)
    public SiteFirewallTrafficRules(String name, SiteFirewallTrafficRulesArgs args, CustomResourceOptions options)
    
    type: netlify:SiteFirewallTrafficRules
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SiteFirewallTrafficRulesArgs
    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 SiteFirewallTrafficRulesArgs
    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 SiteFirewallTrafficRulesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SiteFirewallTrafficRulesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SiteFirewallTrafficRulesArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var siteFirewallTrafficRulesResource = new Netlify.SiteFirewallTrafficRules("siteFirewallTrafficRulesResource", new()
    {
        Published = new Netlify.Inputs.SiteFirewallTrafficRulesPublishedArgs
        {
            DefaultAction = "string",
            GeoExceptions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesPublishedGeoExceptionArgs
                {
                    Countries = new[]
                    {
                        "string",
                    },
                    Description = "string",
                    Subregions = new[]
                    {
                        "string",
                    },
                },
            },
            GeoRestrictions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesPublishedGeoRestrictionArgs
                {
                    Countries = new[]
                    {
                        "string",
                    },
                    Description = "string",
                    Subregions = new[]
                    {
                        "string",
                    },
                },
            },
            IpExceptions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesPublishedIpExceptionArgs
                {
                    Addresses = new[]
                    {
                        "string",
                    },
                    Description = "string",
                },
            },
            IpRestrictions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesPublishedIpRestrictionArgs
                {
                    Addresses = new[]
                    {
                        "string",
                    },
                    Description = "string",
                },
            },
        },
        SiteId = "string",
        Unpublished = new Netlify.Inputs.SiteFirewallTrafficRulesUnpublishedArgs
        {
            DefaultAction = "string",
            GeoExceptions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesUnpublishedGeoExceptionArgs
                {
                    Countries = new[]
                    {
                        "string",
                    },
                    Description = "string",
                    Subregions = new[]
                    {
                        "string",
                    },
                },
            },
            GeoRestrictions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesUnpublishedGeoRestrictionArgs
                {
                    Countries = new[]
                    {
                        "string",
                    },
                    Description = "string",
                    Subregions = new[]
                    {
                        "string",
                    },
                },
            },
            IpExceptions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesUnpublishedIpExceptionArgs
                {
                    Addresses = new[]
                    {
                        "string",
                    },
                    Description = "string",
                },
            },
            IpRestrictions = new[]
            {
                new Netlify.Inputs.SiteFirewallTrafficRulesUnpublishedIpRestrictionArgs
                {
                    Addresses = new[]
                    {
                        "string",
                    },
                    Description = "string",
                },
            },
        },
    });
    
    example, err := netlify.NewSiteFirewallTrafficRules(ctx, "siteFirewallTrafficRulesResource", &netlify.SiteFirewallTrafficRulesArgs{
    Published: &.SiteFirewallTrafficRulesPublishedArgs{
    DefaultAction: pulumi.String("string"),
    GeoExceptions: .SiteFirewallTrafficRulesPublishedGeoExceptionArray{
    &.SiteFirewallTrafficRulesPublishedGeoExceptionArgs{
    Countries: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    Subregions: pulumi.StringArray{
    pulumi.String("string"),
    },
    },
    },
    GeoRestrictions: .SiteFirewallTrafficRulesPublishedGeoRestrictionArray{
    &.SiteFirewallTrafficRulesPublishedGeoRestrictionArgs{
    Countries: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    Subregions: pulumi.StringArray{
    pulumi.String("string"),
    },
    },
    },
    IpExceptions: .SiteFirewallTrafficRulesPublishedIpExceptionArray{
    &.SiteFirewallTrafficRulesPublishedIpExceptionArgs{
    Addresses: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    },
    },
    IpRestrictions: .SiteFirewallTrafficRulesPublishedIpRestrictionArray{
    &.SiteFirewallTrafficRulesPublishedIpRestrictionArgs{
    Addresses: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    },
    },
    },
    SiteId: pulumi.String("string"),
    Unpublished: &.SiteFirewallTrafficRulesUnpublishedArgs{
    DefaultAction: pulumi.String("string"),
    GeoExceptions: .SiteFirewallTrafficRulesUnpublishedGeoExceptionArray{
    &.SiteFirewallTrafficRulesUnpublishedGeoExceptionArgs{
    Countries: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    Subregions: pulumi.StringArray{
    pulumi.String("string"),
    },
    },
    },
    GeoRestrictions: .SiteFirewallTrafficRulesUnpublishedGeoRestrictionArray{
    &.SiteFirewallTrafficRulesUnpublishedGeoRestrictionArgs{
    Countries: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    Subregions: pulumi.StringArray{
    pulumi.String("string"),
    },
    },
    },
    IpExceptions: .SiteFirewallTrafficRulesUnpublishedIpExceptionArray{
    &.SiteFirewallTrafficRulesUnpublishedIpExceptionArgs{
    Addresses: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    },
    },
    IpRestrictions: .SiteFirewallTrafficRulesUnpublishedIpRestrictionArray{
    &.SiteFirewallTrafficRulesUnpublishedIpRestrictionArgs{
    Addresses: pulumi.StringArray{
    pulumi.String("string"),
    },
    Description: pulumi.String("string"),
    },
    },
    },
    })
    
    var siteFirewallTrafficRulesResource = new SiteFirewallTrafficRules("siteFirewallTrafficRulesResource", SiteFirewallTrafficRulesArgs.builder()
        .published(SiteFirewallTrafficRulesPublishedArgs.builder()
            .defaultAction("string")
            .geoExceptions(SiteFirewallTrafficRulesPublishedGeoExceptionArgs.builder()
                .countries("string")
                .description("string")
                .subregions("string")
                .build())
            .geoRestrictions(SiteFirewallTrafficRulesPublishedGeoRestrictionArgs.builder()
                .countries("string")
                .description("string")
                .subregions("string")
                .build())
            .ipExceptions(SiteFirewallTrafficRulesPublishedIpExceptionArgs.builder()
                .addresses("string")
                .description("string")
                .build())
            .ipRestrictions(SiteFirewallTrafficRulesPublishedIpRestrictionArgs.builder()
                .addresses("string")
                .description("string")
                .build())
            .build())
        .siteId("string")
        .unpublished(SiteFirewallTrafficRulesUnpublishedArgs.builder()
            .defaultAction("string")
            .geoExceptions(SiteFirewallTrafficRulesUnpublishedGeoExceptionArgs.builder()
                .countries("string")
                .description("string")
                .subregions("string")
                .build())
            .geoRestrictions(SiteFirewallTrafficRulesUnpublishedGeoRestrictionArgs.builder()
                .countries("string")
                .description("string")
                .subregions("string")
                .build())
            .ipExceptions(SiteFirewallTrafficRulesUnpublishedIpExceptionArgs.builder()
                .addresses("string")
                .description("string")
                .build())
            .ipRestrictions(SiteFirewallTrafficRulesUnpublishedIpRestrictionArgs.builder()
                .addresses("string")
                .description("string")
                .build())
            .build())
        .build());
    
    site_firewall_traffic_rules_resource = netlify.SiteFirewallTrafficRules("siteFirewallTrafficRulesResource",
        published={
            "default_action": "string",
            "geo_exceptions": [{
                "countries": ["string"],
                "description": "string",
                "subregions": ["string"],
            }],
            "geo_restrictions": [{
                "countries": ["string"],
                "description": "string",
                "subregions": ["string"],
            }],
            "ip_exceptions": [{
                "addresses": ["string"],
                "description": "string",
            }],
            "ip_restrictions": [{
                "addresses": ["string"],
                "description": "string",
            }],
        },
        site_id="string",
        unpublished={
            "default_action": "string",
            "geo_exceptions": [{
                "countries": ["string"],
                "description": "string",
                "subregions": ["string"],
            }],
            "geo_restrictions": [{
                "countries": ["string"],
                "description": "string",
                "subregions": ["string"],
            }],
            "ip_exceptions": [{
                "addresses": ["string"],
                "description": "string",
            }],
            "ip_restrictions": [{
                "addresses": ["string"],
                "description": "string",
            }],
        })
    
    const siteFirewallTrafficRulesResource = new netlify.SiteFirewallTrafficRules("siteFirewallTrafficRulesResource", {
        published: {
            defaultAction: "string",
            geoExceptions: [{
                countries: ["string"],
                description: "string",
                subregions: ["string"],
            }],
            geoRestrictions: [{
                countries: ["string"],
                description: "string",
                subregions: ["string"],
            }],
            ipExceptions: [{
                addresses: ["string"],
                description: "string",
            }],
            ipRestrictions: [{
                addresses: ["string"],
                description: "string",
            }],
        },
        siteId: "string",
        unpublished: {
            defaultAction: "string",
            geoExceptions: [{
                countries: ["string"],
                description: "string",
                subregions: ["string"],
            }],
            geoRestrictions: [{
                countries: ["string"],
                description: "string",
                subregions: ["string"],
            }],
            ipExceptions: [{
                addresses: ["string"],
                description: "string",
            }],
            ipRestrictions: [{
                addresses: ["string"],
                description: "string",
            }],
        },
    });
    
    type: netlify:SiteFirewallTrafficRules
    properties:
        published:
            defaultAction: string
            geoExceptions:
                - countries:
                    - string
                  description: string
                  subregions:
                    - string
            geoRestrictions:
                - countries:
                    - string
                  description: string
                  subregions:
                    - string
            ipExceptions:
                - addresses:
                    - string
                  description: string
            ipRestrictions:
                - addresses:
                    - string
                  description: string
        siteId: string
        unpublished:
            defaultAction: string
            geoExceptions:
                - countries:
                    - string
                  description: string
                  subregions:
                    - string
            geoRestrictions:
                - countries:
                    - string
                  description: string
                  subregions:
                    - string
            ipExceptions:
                - addresses:
                    - string
                  description: string
            ipRestrictions:
                - addresses:
                    - string
                  description: string
    

    SiteFirewallTrafficRules Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The SiteFirewallTrafficRules resource accepts the following input properties:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SiteFirewallTrafficRules resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    TeamId string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    TeamId string
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    teamId String
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    teamId string
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    team_id str
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    teamId String

    Look up Existing SiteFirewallTrafficRules Resource

    Get an existing SiteFirewallTrafficRules 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?: SiteFirewallTrafficRulesState, opts?: CustomResourceOptions): SiteFirewallTrafficRules
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            last_updated: Optional[str] = None,
            published: Optional[SiteFirewallTrafficRulesPublishedArgs] = None,
            site_id: Optional[str] = None,
            team_id: Optional[str] = None,
            unpublished: Optional[SiteFirewallTrafficRulesUnpublishedArgs] = None) -> SiteFirewallTrafficRules
    func GetSiteFirewallTrafficRules(ctx *Context, name string, id IDInput, state *SiteFirewallTrafficRulesState, opts ...ResourceOption) (*SiteFirewallTrafficRules, error)
    public static SiteFirewallTrafficRules Get(string name, Input<string> id, SiteFirewallTrafficRulesState? state, CustomResourceOptions? opts = null)
    public static SiteFirewallTrafficRules get(String name, Output<String> id, SiteFirewallTrafficRulesState state, CustomResourceOptions options)
    resources:  _:    type: netlify:SiteFirewallTrafficRules    get:      id: ${id}
    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.
    The following state arguments are supported:

    Supporting Types

    SiteFirewallTrafficRulesPublished, SiteFirewallTrafficRulesPublishedArgs

    SiteFirewallTrafficRulesPublishedGeoException, SiteFirewallTrafficRulesPublishedGeoExceptionArgs

    Countries List<string>
    Description string
    Subregions List<string>
    Countries []string
    Description string
    Subregions []string
    countries List<String>
    description String
    subregions List<String>
    countries string[]
    description string
    subregions string[]
    countries Sequence[str]
    description str
    subregions Sequence[str]
    countries List<String>
    description String
    subregions List<String>

    SiteFirewallTrafficRulesPublishedGeoRestriction, SiteFirewallTrafficRulesPublishedGeoRestrictionArgs

    Countries List<string>
    Description string
    Subregions List<string>
    Countries []string
    Description string
    Subregions []string
    countries List<String>
    description String
    subregions List<String>
    countries string[]
    description string
    subregions string[]
    countries Sequence[str]
    description str
    subregions Sequence[str]
    countries List<String>
    description String
    subregions List<String>

    SiteFirewallTrafficRulesPublishedIpException, SiteFirewallTrafficRulesPublishedIpExceptionArgs

    Addresses List<string>
    Description string
    Addresses []string
    Description string
    addresses List<String>
    description String
    addresses string[]
    description string
    addresses Sequence[str]
    description str
    addresses List<String>
    description String

    SiteFirewallTrafficRulesPublishedIpRestriction, SiteFirewallTrafficRulesPublishedIpRestrictionArgs

    Addresses List<string>
    Description string
    Addresses []string
    Description string
    addresses List<String>
    description String
    addresses string[]
    description string
    addresses Sequence[str]
    description str
    addresses List<String>
    description String

    SiteFirewallTrafficRulesUnpublished, SiteFirewallTrafficRulesUnpublishedArgs

    SiteFirewallTrafficRulesUnpublishedGeoException, SiteFirewallTrafficRulesUnpublishedGeoExceptionArgs

    Countries List<string>
    Description string
    Subregions List<string>
    Countries []string
    Description string
    Subregions []string
    countries List<String>
    description String
    subregions List<String>
    countries string[]
    description string
    subregions string[]
    countries Sequence[str]
    description str
    subregions Sequence[str]
    countries List<String>
    description String
    subregions List<String>

    SiteFirewallTrafficRulesUnpublishedGeoRestriction, SiteFirewallTrafficRulesUnpublishedGeoRestrictionArgs

    Countries List<string>
    Description string
    Subregions List<string>
    Countries []string
    Description string
    Subregions []string
    countries List<String>
    description String
    subregions List<String>
    countries string[]
    description string
    subregions string[]
    countries Sequence[str]
    description str
    subregions Sequence[str]
    countries List<String>
    description String
    subregions List<String>

    SiteFirewallTrafficRulesUnpublishedIpException, SiteFirewallTrafficRulesUnpublishedIpExceptionArgs

    Addresses List<string>
    Description string
    Addresses []string
    Description string
    addresses List<String>
    description String
    addresses string[]
    description string
    addresses Sequence[str]
    description str
    addresses List<String>
    description String

    SiteFirewallTrafficRulesUnpublishedIpRestriction, SiteFirewallTrafficRulesUnpublishedIpRestrictionArgs

    Addresses List<string>
    Description string
    Addresses []string
    Description string
    addresses List<String>
    description String
    addresses string[]
    description string
    addresses Sequence[str]
    description str
    addresses List<String>
    description String

    Import

    Import a site’s firewall traffic rules by the site ID

    $ pulumi import netlify:index/siteFirewallTrafficRules:SiteFirewallTrafficRules blog 12345667-0000-0000-0000-abcdef012345
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    netlify netlify/terraform-provider-netlify
    License
    Notes
    This Pulumi package is based on the netlify Terraform Provider.
    netlify logo
    netlify 0.2.2 published on Friday, Mar 7, 2025 by netlify