1. Packages
  2. Scaleway
  3. API Docs
  4. network
  5. Acl
Scaleway v1.27.1 published on Wednesday, Apr 30, 2025 by pulumiverse

scaleway.network.Acl

Explore with Pulumi AI

scaleway logo
Scaleway v1.27.1 published on Wednesday, Apr 30, 2025 by pulumiverse

    Creates and manages Scaleway VPC ACLs.

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const vpc01 = new scaleway.network.Vpc("vpc01", {name: "tf-vpc-acl"});
    const acl01 = new scaleway.network.Acl("acl01", {
        vpcId: vpc01.id,
        isIpv6: false,
        rules: [{
            protocol: "TCP",
            srcPortLow: 0,
            srcPortHigh: 0,
            dstPortLow: 80,
            dstPortHigh: 80,
            source: "0.0.0.0/0",
            destination: "0.0.0.0/0",
            description: "Allow HTTP traffic from any source",
            action: "accept",
        }],
        defaultPolicy: "drop",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    vpc01 = scaleway.network.Vpc("vpc01", name="tf-vpc-acl")
    acl01 = scaleway.network.Acl("acl01",
        vpc_id=vpc01.id,
        is_ipv6=False,
        rules=[{
            "protocol": "TCP",
            "src_port_low": 0,
            "src_port_high": 0,
            "dst_port_low": 80,
            "dst_port_high": 80,
            "source": "0.0.0.0/0",
            "destination": "0.0.0.0/0",
            "description": "Allow HTTP traffic from any source",
            "action": "accept",
        }],
        default_policy="drop")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/network"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		vpc01, err := network.NewVpc(ctx, "vpc01", &network.VpcArgs{
    			Name: pulumi.String("tf-vpc-acl"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = network.NewAcl(ctx, "acl01", &network.AclArgs{
    			VpcId:  vpc01.ID(),
    			IsIpv6: pulumi.Bool(false),
    			Rules: network.AclRuleArray{
    				&network.AclRuleArgs{
    					Protocol:    pulumi.String("TCP"),
    					SrcPortLow:  pulumi.Int(0),
    					SrcPortHigh: pulumi.Int(0),
    					DstPortLow:  pulumi.Int(80),
    					DstPortHigh: pulumi.Int(80),
    					Source:      pulumi.String("0.0.0.0/0"),
    					Destination: pulumi.String("0.0.0.0/0"),
    					Description: pulumi.String("Allow HTTP traffic from any source"),
    					Action:      pulumi.String("accept"),
    				},
    			},
    			DefaultPolicy: pulumi.String("drop"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var vpc01 = new Scaleway.Network.Vpc("vpc01", new()
        {
            Name = "tf-vpc-acl",
        });
    
        var acl01 = new Scaleway.Network.Acl("acl01", new()
        {
            VpcId = vpc01.Id,
            IsIpv6 = false,
            Rules = new[]
            {
                new Scaleway.Network.Inputs.AclRuleArgs
                {
                    Protocol = "TCP",
                    SrcPortLow = 0,
                    SrcPortHigh = 0,
                    DstPortLow = 80,
                    DstPortHigh = 80,
                    Source = "0.0.0.0/0",
                    Destination = "0.0.0.0/0",
                    Description = "Allow HTTP traffic from any source",
                    Action = "accept",
                },
            },
            DefaultPolicy = "drop",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.network.Vpc;
    import com.pulumi.scaleway.network.VpcArgs;
    import com.pulumi.scaleway.network.Acl;
    import com.pulumi.scaleway.network.AclArgs;
    import com.pulumi.scaleway.network.inputs.AclRuleArgs;
    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 vpc01 = new Vpc("vpc01", VpcArgs.builder()
                .name("tf-vpc-acl")
                .build());
    
            var acl01 = new Acl("acl01", AclArgs.builder()
                .vpcId(vpc01.id())
                .isIpv6(false)
                .rules(AclRuleArgs.builder()
                    .protocol("TCP")
                    .srcPortLow(0)
                    .srcPortHigh(0)
                    .dstPortLow(80)
                    .dstPortHigh(80)
                    .source("0.0.0.0/0")
                    .destination("0.0.0.0/0")
                    .description("Allow HTTP traffic from any source")
                    .action("accept")
                    .build())
                .defaultPolicy("drop")
                .build());
    
        }
    }
    
    resources:
      vpc01:
        type: scaleway:network:Vpc
        properties:
          name: tf-vpc-acl
      acl01:
        type: scaleway:network:Acl
        properties:
          vpcId: ${vpc01.id}
          isIpv6: false
          rules:
            - protocol: TCP
              srcPortLow: 0
              srcPortHigh: 0
              dstPortLow: 80
              dstPortHigh: 80
              source: 0.0.0.0/0
              destination: 0.0.0.0/0
              description: Allow HTTP traffic from any source
              action: accept
          defaultPolicy: drop
    

    Create Acl Resource

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

    Constructor syntax

    new Acl(name: string, args: AclArgs, opts?: CustomResourceOptions);
    @overload
    def Acl(resource_name: str,
            args: AclArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Acl(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            default_policy: Optional[str] = None,
            rules: Optional[Sequence[AclRuleArgs]] = None,
            vpc_id: Optional[str] = None,
            is_ipv6: Optional[bool] = None,
            region: Optional[str] = None)
    func NewAcl(ctx *Context, name string, args AclArgs, opts ...ResourceOption) (*Acl, error)
    public Acl(string name, AclArgs args, CustomResourceOptions? opts = null)
    public Acl(String name, AclArgs args)
    public Acl(String name, AclArgs args, CustomResourceOptions options)
    
    type: scaleway:network:Acl
    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 AclArgs
    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 AclArgs
    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 AclArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AclArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AclArgs
    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 exampleaclResourceResourceFromNetworkacl = new Scaleway.Network.Acl("exampleaclResourceResourceFromNetworkacl", new()
    {
        DefaultPolicy = "string",
        Rules = new[]
        {
            new Scaleway.Network.Inputs.AclRuleArgs
            {
                Action = "string",
                Description = "string",
                Destination = "string",
                DstPortHigh = 0,
                DstPortLow = 0,
                Protocol = "string",
                Source = "string",
                SrcPortHigh = 0,
                SrcPortLow = 0,
            },
        },
        VpcId = "string",
        IsIpv6 = false,
        Region = "string",
    });
    
    example, err := network.NewAcl(ctx, "exampleaclResourceResourceFromNetworkacl", &network.AclArgs{
    	DefaultPolicy: pulumi.String("string"),
    	Rules: network.AclRuleArray{
    		&network.AclRuleArgs{
    			Action:      pulumi.String("string"),
    			Description: pulumi.String("string"),
    			Destination: pulumi.String("string"),
    			DstPortHigh: pulumi.Int(0),
    			DstPortLow:  pulumi.Int(0),
    			Protocol:    pulumi.String("string"),
    			Source:      pulumi.String("string"),
    			SrcPortHigh: pulumi.Int(0),
    			SrcPortLow:  pulumi.Int(0),
    		},
    	},
    	VpcId:  pulumi.String("string"),
    	IsIpv6: pulumi.Bool(false),
    	Region: pulumi.String("string"),
    })
    
    var exampleaclResourceResourceFromNetworkacl = new com.pulumi.scaleway.network.Acl("exampleaclResourceResourceFromNetworkacl", com.pulumi.scaleway.network.AclArgs.builder()
        .defaultPolicy("string")
        .rules(AclRuleArgs.builder()
            .action("string")
            .description("string")
            .destination("string")
            .dstPortHigh(0)
            .dstPortLow(0)
            .protocol("string")
            .source("string")
            .srcPortHigh(0)
            .srcPortLow(0)
            .build())
        .vpcId("string")
        .isIpv6(false)
        .region("string")
        .build());
    
    exampleacl_resource_resource_from_networkacl = scaleway.network.Acl("exampleaclResourceResourceFromNetworkacl",
        default_policy="string",
        rules=[{
            "action": "string",
            "description": "string",
            "destination": "string",
            "dst_port_high": 0,
            "dst_port_low": 0,
            "protocol": "string",
            "source": "string",
            "src_port_high": 0,
            "src_port_low": 0,
        }],
        vpc_id="string",
        is_ipv6=False,
        region="string")
    
    const exampleaclResourceResourceFromNetworkacl = new scaleway.network.Acl("exampleaclResourceResourceFromNetworkacl", {
        defaultPolicy: "string",
        rules: [{
            action: "string",
            description: "string",
            destination: "string",
            dstPortHigh: 0,
            dstPortLow: 0,
            protocol: "string",
            source: "string",
            srcPortHigh: 0,
            srcPortLow: 0,
        }],
        vpcId: "string",
        isIpv6: false,
        region: "string",
    });
    
    type: scaleway:network:Acl
    properties:
        defaultPolicy: string
        isIpv6: false
        region: string
        rules:
            - action: string
              description: string
              destination: string
              dstPortHigh: 0
              dstPortLow: 0
              protocol: string
              source: string
              srcPortHigh: 0
              srcPortLow: 0
        vpcId: string
    

    Acl 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 Acl resource accepts the following input properties:

    DefaultPolicy string
    The action to take for packets which do not match any rules.
    Rules List<Pulumiverse.Scaleway.Network.Inputs.AclRule>
    The list of Network ACL rules.
    VpcId string
    The VPC ID the ACL belongs to.
    IsIpv6 bool
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    Region string
    region) The region of the ACL.
    DefaultPolicy string
    The action to take for packets which do not match any rules.
    Rules []AclRuleArgs
    The list of Network ACL rules.
    VpcId string
    The VPC ID the ACL belongs to.
    IsIpv6 bool
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    Region string
    region) The region of the ACL.
    defaultPolicy String
    The action to take for packets which do not match any rules.
    rules List<AclRule>
    The list of Network ACL rules.
    vpcId String
    The VPC ID the ACL belongs to.
    isIpv6 Boolean
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region String
    region) The region of the ACL.
    defaultPolicy string
    The action to take for packets which do not match any rules.
    rules AclRule[]
    The list of Network ACL rules.
    vpcId string
    The VPC ID the ACL belongs to.
    isIpv6 boolean
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region string
    region) The region of the ACL.
    default_policy str
    The action to take for packets which do not match any rules.
    rules Sequence[AclRuleArgs]
    The list of Network ACL rules.
    vpc_id str
    The VPC ID the ACL belongs to.
    is_ipv6 bool
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region str
    region) The region of the ACL.
    defaultPolicy String
    The action to take for packets which do not match any rules.
    rules List<Property Map>
    The list of Network ACL rules.
    vpcId String
    The VPC ID the ACL belongs to.
    isIpv6 Boolean
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region String
    region) The region of the ACL.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Acl 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 Acl Resource

    Get an existing Acl 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?: AclState, opts?: CustomResourceOptions): Acl
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            default_policy: Optional[str] = None,
            is_ipv6: Optional[bool] = None,
            region: Optional[str] = None,
            rules: Optional[Sequence[AclRuleArgs]] = None,
            vpc_id: Optional[str] = None) -> Acl
    func GetAcl(ctx *Context, name string, id IDInput, state *AclState, opts ...ResourceOption) (*Acl, error)
    public static Acl Get(string name, Input<string> id, AclState? state, CustomResourceOptions? opts = null)
    public static Acl get(String name, Output<String> id, AclState state, CustomResourceOptions options)
    resources:  _:    type: scaleway:network:Acl    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:
    DefaultPolicy string
    The action to take for packets which do not match any rules.
    IsIpv6 bool
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    Region string
    region) The region of the ACL.
    Rules List<Pulumiverse.Scaleway.Network.Inputs.AclRule>
    The list of Network ACL rules.
    VpcId string
    The VPC ID the ACL belongs to.
    DefaultPolicy string
    The action to take for packets which do not match any rules.
    IsIpv6 bool
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    Region string
    region) The region of the ACL.
    Rules []AclRuleArgs
    The list of Network ACL rules.
    VpcId string
    The VPC ID the ACL belongs to.
    defaultPolicy String
    The action to take for packets which do not match any rules.
    isIpv6 Boolean
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region String
    region) The region of the ACL.
    rules List<AclRule>
    The list of Network ACL rules.
    vpcId String
    The VPC ID the ACL belongs to.
    defaultPolicy string
    The action to take for packets which do not match any rules.
    isIpv6 boolean
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region string
    region) The region of the ACL.
    rules AclRule[]
    The list of Network ACL rules.
    vpcId string
    The VPC ID the ACL belongs to.
    default_policy str
    The action to take for packets which do not match any rules.
    is_ipv6 bool
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region str
    region) The region of the ACL.
    rules Sequence[AclRuleArgs]
    The list of Network ACL rules.
    vpc_id str
    The VPC ID the ACL belongs to.
    defaultPolicy String
    The action to take for packets which do not match any rules.
    isIpv6 Boolean
    Defines whether this set of ACL rules is for IPv6 (false = IPv4). Each Network ACL can have rules for only one IP type.
    region String
    region) The region of the ACL.
    rules List<Property Map>
    The list of Network ACL rules.
    vpcId String
    The VPC ID the ACL belongs to.

    Supporting Types

    AclRule, AclRuleArgs

    Action string
    The policy to apply to the packet.
    Description string
    The rule description.
    Destination string
    The destination IP range to which this rule applies (CIDR notation with subnet mask).
    DstPortHigh int
    The ending port of the destination port range to which this rule applies (inclusive).
    DstPortLow int
    The starting port of the destination port range to which this rule applies (inclusive).
    Protocol string
    The protocol to which this rule applies. Default value: ANY.
    Source string
    The Source IP range to which this rule applies (CIDR notation with subnet mask).
    SrcPortHigh int
    The ending port of the source port range to which this rule applies (inclusive).
    SrcPortLow int
    The starting port of the source port range to which this rule applies (inclusive).
    Action string
    The policy to apply to the packet.
    Description string
    The rule description.
    Destination string
    The destination IP range to which this rule applies (CIDR notation with subnet mask).
    DstPortHigh int
    The ending port of the destination port range to which this rule applies (inclusive).
    DstPortLow int
    The starting port of the destination port range to which this rule applies (inclusive).
    Protocol string
    The protocol to which this rule applies. Default value: ANY.
    Source string
    The Source IP range to which this rule applies (CIDR notation with subnet mask).
    SrcPortHigh int
    The ending port of the source port range to which this rule applies (inclusive).
    SrcPortLow int
    The starting port of the source port range to which this rule applies (inclusive).
    action String
    The policy to apply to the packet.
    description String
    The rule description.
    destination String
    The destination IP range to which this rule applies (CIDR notation with subnet mask).
    dstPortHigh Integer
    The ending port of the destination port range to which this rule applies (inclusive).
    dstPortLow Integer
    The starting port of the destination port range to which this rule applies (inclusive).
    protocol String
    The protocol to which this rule applies. Default value: ANY.
    source String
    The Source IP range to which this rule applies (CIDR notation with subnet mask).
    srcPortHigh Integer
    The ending port of the source port range to which this rule applies (inclusive).
    srcPortLow Integer
    The starting port of the source port range to which this rule applies (inclusive).
    action string
    The policy to apply to the packet.
    description string
    The rule description.
    destination string
    The destination IP range to which this rule applies (CIDR notation with subnet mask).
    dstPortHigh number
    The ending port of the destination port range to which this rule applies (inclusive).
    dstPortLow number
    The starting port of the destination port range to which this rule applies (inclusive).
    protocol string
    The protocol to which this rule applies. Default value: ANY.
    source string
    The Source IP range to which this rule applies (CIDR notation with subnet mask).
    srcPortHigh number
    The ending port of the source port range to which this rule applies (inclusive).
    srcPortLow number
    The starting port of the source port range to which this rule applies (inclusive).
    action str
    The policy to apply to the packet.
    description str
    The rule description.
    destination str
    The destination IP range to which this rule applies (CIDR notation with subnet mask).
    dst_port_high int
    The ending port of the destination port range to which this rule applies (inclusive).
    dst_port_low int
    The starting port of the destination port range to which this rule applies (inclusive).
    protocol str
    The protocol to which this rule applies. Default value: ANY.
    source str
    The Source IP range to which this rule applies (CIDR notation with subnet mask).
    src_port_high int
    The ending port of the source port range to which this rule applies (inclusive).
    src_port_low int
    The starting port of the source port range to which this rule applies (inclusive).
    action String
    The policy to apply to the packet.
    description String
    The rule description.
    destination String
    The destination IP range to which this rule applies (CIDR notation with subnet mask).
    dstPortHigh Number
    The ending port of the destination port range to which this rule applies (inclusive).
    dstPortLow Number
    The starting port of the destination port range to which this rule applies (inclusive).
    protocol String
    The protocol to which this rule applies. Default value: ANY.
    source String
    The Source IP range to which this rule applies (CIDR notation with subnet mask).
    srcPortHigh Number
    The ending port of the source port range to which this rule applies (inclusive).
    srcPortLow Number
    The starting port of the source port range to which this rule applies (inclusive).

    Import

    ACLs can be imported using {region}/{id}, e.g.

    bash

    $ pulumi import scaleway:network/acl:Acl main fr-par/11111111-1111-1111-1111-111111111111
    

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

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.27.1 published on Wednesday, Apr 30, 2025 by pulumiverse