1. Packages
  2. Packages
  3. Scaleway
  4. API Docs
  5. InstanceSecurityGroup
Viewing docs for Scaleway v1.48.0
published on Wednesday, Apr 29, 2026 by pulumiverse
scaleway logo
Viewing docs for Scaleway v1.48.0
published on Wednesday, Apr 29, 2026 by pulumiverse
    Deprecated: scaleway.index/instancesecuritygroup.InstanceSecurityGroup has been deprecated in favor of scaleway.instance/securitygroup.SecurityGroup

    Creates and manages Scaleway compute Instance security groups. For more information, see the API documentation.

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const allowAll = new scaleway.instance.SecurityGroup("allow_all", {});
    const web = new scaleway.instance.SecurityGroup("web", {
        inboundDefaultPolicy: "drop",
        inboundRules: [
            {
                action: "accept",
                port: 22,
                ipRange: "212.47.225.64/32",
            },
            {
                action: "accept",
                port: 80,
            },
            {
                action: "accept",
                protocol: "UDP",
                portRange: "22-23",
            },
        ],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    allow_all = scaleway.instance.SecurityGroup("allow_all")
    web = scaleway.instance.SecurityGroup("web",
        inbound_default_policy="drop",
        inbound_rules=[
            {
                "action": "accept",
                "port": 22,
                "ip_range": "212.47.225.64/32",
            },
            {
                "action": "accept",
                "port": 80,
            },
            {
                "action": "accept",
                "protocol": "UDP",
                "port_range": "22-23",
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/instance"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := instance.NewSecurityGroup(ctx, "allow_all", nil)
    		if err != nil {
    			return err
    		}
    		_, err = instance.NewSecurityGroup(ctx, "web", &instance.SecurityGroupArgs{
    			InboundDefaultPolicy: pulumi.String("drop"),
    			InboundRules: instance.SecurityGroupInboundRuleArray{
    				&instance.SecurityGroupInboundRuleArgs{
    					Action:  pulumi.String("accept"),
    					Port:    pulumi.Int(22),
    					IpRange: pulumi.String("212.47.225.64/32"),
    				},
    				&instance.SecurityGroupInboundRuleArgs{
    					Action: pulumi.String("accept"),
    					Port:   pulumi.Int(80),
    				},
    				&instance.SecurityGroupInboundRuleArgs{
    					Action:    pulumi.String("accept"),
    					Protocol:  pulumi.String("UDP"),
    					PortRange: pulumi.String("22-23"),
    				},
    			},
    		})
    		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 allowAll = new Scaleway.Instance.SecurityGroup("allow_all");
    
        var web = new Scaleway.Instance.SecurityGroup("web", new()
        {
            InboundDefaultPolicy = "drop",
            InboundRules = new[]
            {
                new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
                {
                    Action = "accept",
                    Port = 22,
                    IpRange = "212.47.225.64/32",
                },
                new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
                {
                    Action = "accept",
                    Port = 80,
                },
                new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
                {
                    Action = "accept",
                    Protocol = "UDP",
                    PortRange = "22-23",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.instance.SecurityGroup;
    import com.pulumi.scaleway.instance.SecurityGroupArgs;
    import com.pulumi.scaleway.instance.inputs.SecurityGroupInboundRuleArgs;
    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 allowAll = new SecurityGroup("allowAll");
    
            var web = new SecurityGroup("web", SecurityGroupArgs.builder()
                .inboundDefaultPolicy("drop")
                .inboundRules(            
                    SecurityGroupInboundRuleArgs.builder()
                        .action("accept")
                        .port(22)
                        .ipRange("212.47.225.64/32")
                        .build(),
                    SecurityGroupInboundRuleArgs.builder()
                        .action("accept")
                        .port(80)
                        .build(),
                    SecurityGroupInboundRuleArgs.builder()
                        .action("accept")
                        .protocol("UDP")
                        .portRange("22-23")
                        .build())
                .build());
    
        }
    }
    
    resources:
      allowAll:
        type: scaleway:instance:SecurityGroup
        name: allow_all
      web:
        type: scaleway:instance:SecurityGroup
        properties:
          inboundDefaultPolicy: drop
          inboundRules:
            - action: accept
              port: 22
              ipRange: 212.47.225.64/32
            - action: accept
              port: 80
            - action: accept
              protocol: UDP
              portRange: 22-23
    

    Web server with banned IP and restricted internet access

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const web = new scaleway.instance.SecurityGroup("web", {
        inboundDefaultPolicy: "drop",
        outboundDefaultPolicy: "drop",
        inboundRules: [
            {
                action: "drop",
                ipRange: "1.1.1.1/32",
            },
            {
                action: "accept",
                port: 22,
                ipRange: "212.47.225.64/32",
            },
            {
                action: "accept",
                port: 443,
            },
        ],
        outboundRules: [{
            action: "accept",
            ipRange: "8.8.8.8/32",
        }],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    web = scaleway.instance.SecurityGroup("web",
        inbound_default_policy="drop",
        outbound_default_policy="drop",
        inbound_rules=[
            {
                "action": "drop",
                "ip_range": "1.1.1.1/32",
            },
            {
                "action": "accept",
                "port": 22,
                "ip_range": "212.47.225.64/32",
            },
            {
                "action": "accept",
                "port": 443,
            },
        ],
        outbound_rules=[{
            "action": "accept",
            "ip_range": "8.8.8.8/32",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/instance"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := instance.NewSecurityGroup(ctx, "web", &instance.SecurityGroupArgs{
    			InboundDefaultPolicy:  pulumi.String("drop"),
    			OutboundDefaultPolicy: pulumi.String("drop"),
    			InboundRules: instance.SecurityGroupInboundRuleArray{
    				&instance.SecurityGroupInboundRuleArgs{
    					Action:  pulumi.String("drop"),
    					IpRange: pulumi.String("1.1.1.1/32"),
    				},
    				&instance.SecurityGroupInboundRuleArgs{
    					Action:  pulumi.String("accept"),
    					Port:    pulumi.Int(22),
    					IpRange: pulumi.String("212.47.225.64/32"),
    				},
    				&instance.SecurityGroupInboundRuleArgs{
    					Action: pulumi.String("accept"),
    					Port:   pulumi.Int(443),
    				},
    			},
    			OutboundRules: instance.SecurityGroupOutboundRuleArray{
    				&instance.SecurityGroupOutboundRuleArgs{
    					Action:  pulumi.String("accept"),
    					IpRange: pulumi.String("8.8.8.8/32"),
    				},
    			},
    		})
    		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 web = new Scaleway.Instance.SecurityGroup("web", new()
        {
            InboundDefaultPolicy = "drop",
            OutboundDefaultPolicy = "drop",
            InboundRules = new[]
            {
                new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
                {
                    Action = "drop",
                    IpRange = "1.1.1.1/32",
                },
                new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
                {
                    Action = "accept",
                    Port = 22,
                    IpRange = "212.47.225.64/32",
                },
                new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
                {
                    Action = "accept",
                    Port = 443,
                },
            },
            OutboundRules = new[]
            {
                new Scaleway.Instance.Inputs.SecurityGroupOutboundRuleArgs
                {
                    Action = "accept",
                    IpRange = "8.8.8.8/32",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.instance.SecurityGroup;
    import com.pulumi.scaleway.instance.SecurityGroupArgs;
    import com.pulumi.scaleway.instance.inputs.SecurityGroupInboundRuleArgs;
    import com.pulumi.scaleway.instance.inputs.SecurityGroupOutboundRuleArgs;
    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 web = new SecurityGroup("web", SecurityGroupArgs.builder()
                .inboundDefaultPolicy("drop")
                .outboundDefaultPolicy("drop")
                .inboundRules(            
                    SecurityGroupInboundRuleArgs.builder()
                        .action("drop")
                        .ipRange("1.1.1.1/32")
                        .build(),
                    SecurityGroupInboundRuleArgs.builder()
                        .action("accept")
                        .port(22)
                        .ipRange("212.47.225.64/32")
                        .build(),
                    SecurityGroupInboundRuleArgs.builder()
                        .action("accept")
                        .port(443)
                        .build())
                .outboundRules(SecurityGroupOutboundRuleArgs.builder()
                    .action("accept")
                    .ipRange("8.8.8.8/32")
                    .build())
                .build());
    
        }
    }
    
    resources:
      web:
        type: scaleway:instance:SecurityGroup
        properties:
          inboundDefaultPolicy: drop
          outboundDefaultPolicy: drop
          inboundRules:
            - action: drop
              ipRange: 1.1.1.1/32
            - action: accept
              port: 22
              ipRange: 212.47.225.64/32
            - action: accept
              port: 443
          outboundRules:
            - action: accept
              ipRange: 8.8.8.8/32
    

    Trusted IP for SSH access (using for_each)

    If you use terraform >= 0.12.6, you can leverage the forEach feature with this resource.

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const trusted = [
        "192.168.0.1",
        "192.168.0.2",
        "192.168.0.3",
    ];
    const dummy = new scaleway.instance.SecurityGroup("dummy", {
        inboundRules: trusted.map((v, k) => ({key: k, value: v})).map(entry => ({
            action: "accept",
            port: 22,
            ipRange: entry.value,
        })),
        inboundDefaultPolicy: "drop",
        outboundDefaultPolicy: "accept",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    trusted = [
        "192.168.0.1",
        "192.168.0.2",
        "192.168.0.3",
    ]
    dummy = scaleway.instance.SecurityGroup("dummy",
        inbound_rules=[{
            "action": "accept",
            "port": 22,
            "ip_range": entry["value"],
        } for entry in [{"key": k, "value": v} for k, v in trusted.items()]],
        inbound_default_policy="drop",
        outbound_default_policy="accept")
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var trusted = new[]
        {
            "192.168.0.1",
            "192.168.0.2",
            "192.168.0.3",
        };
    
        var dummy = new Scaleway.Instance.SecurityGroup("dummy", new()
        {
            InboundRules = trusted.Select((v, k) => new { Key = k, Value = v }).Select(entry => 
            {
                return new Scaleway.Instance.Inputs.SecurityGroupInboundRuleArgs
                {
                    Action = "accept",
                    Port = 22,
                    IpRange = entry.Value,
                };
            }).ToList(),
            InboundDefaultPolicy = "drop",
            OutboundDefaultPolicy = "accept",
        });
    
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Create InstanceSecurityGroup Resource

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

    Constructor syntax

    new InstanceSecurityGroup(name: string, args?: InstanceSecurityGroupArgs, opts?: CustomResourceOptions);
    @overload
    def InstanceSecurityGroup(resource_name: str,
                              args: Optional[InstanceSecurityGroupArgs] = None,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def InstanceSecurityGroup(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              description: Optional[str] = None,
                              enable_default_security: Optional[bool] = None,
                              external_rules: Optional[bool] = None,
                              inbound_default_policy: Optional[str] = None,
                              inbound_rules: Optional[Sequence[InstanceSecurityGroupInboundRuleArgs]] = None,
                              name: Optional[str] = None,
                              outbound_default_policy: Optional[str] = None,
                              outbound_rules: Optional[Sequence[InstanceSecurityGroupOutboundRuleArgs]] = None,
                              project_id: Optional[str] = None,
                              stateful: Optional[bool] = None,
                              tags: Optional[Sequence[str]] = None,
                              zone: Optional[str] = None)
    func NewInstanceSecurityGroup(ctx *Context, name string, args *InstanceSecurityGroupArgs, opts ...ResourceOption) (*InstanceSecurityGroup, error)
    public InstanceSecurityGroup(string name, InstanceSecurityGroupArgs? args = null, CustomResourceOptions? opts = null)
    public InstanceSecurityGroup(String name, InstanceSecurityGroupArgs args)
    public InstanceSecurityGroup(String name, InstanceSecurityGroupArgs args, CustomResourceOptions options)
    
    type: scaleway:InstanceSecurityGroup
    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 InstanceSecurityGroupArgs
    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 InstanceSecurityGroupArgs
    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 InstanceSecurityGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceSecurityGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceSecurityGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Description string
    The description of the security group.
    EnableDefaultSecurity bool
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    ExternalRules bool
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    InboundDefaultPolicy string
    The default policy on incoming traffic. Possible values are: accept or drop.
    InboundRules List<Pulumiverse.Scaleway.Inputs.InstanceSecurityGroupInboundRule>
    A list of inbound rule to add to the security group. (Structure is documented below.)
    Name string
    The name of the security group.
    OutboundDefaultPolicy string
    The default policy on outgoing traffic. Possible values are: accept or drop.
    OutboundRules List<Pulumiverse.Scaleway.Inputs.InstanceSecurityGroupOutboundRule>
    A list of outbound rule to add to the security group. (Structure is documented below.)
    ProjectId string
    projectId) The ID of the project the security group is associated with.
    Stateful bool
    A boolean to specify whether the security group should be stateful or not.
    Tags List<string>
    The tags of the security group.
    Zone string
    zone) The zone in which the security group should be created.
    Description string
    The description of the security group.
    EnableDefaultSecurity bool
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    ExternalRules bool
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    InboundDefaultPolicy string
    The default policy on incoming traffic. Possible values are: accept or drop.
    InboundRules []InstanceSecurityGroupInboundRuleArgs
    A list of inbound rule to add to the security group. (Structure is documented below.)
    Name string
    The name of the security group.
    OutboundDefaultPolicy string
    The default policy on outgoing traffic. Possible values are: accept or drop.
    OutboundRules []InstanceSecurityGroupOutboundRuleArgs
    A list of outbound rule to add to the security group. (Structure is documented below.)
    ProjectId string
    projectId) The ID of the project the security group is associated with.
    Stateful bool
    A boolean to specify whether the security group should be stateful or not.
    Tags []string
    The tags of the security group.
    Zone string
    zone) The zone in which the security group should be created.
    description String
    The description of the security group.
    enableDefaultSecurity Boolean
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    externalRules Boolean
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inboundDefaultPolicy String
    The default policy on incoming traffic. Possible values are: accept or drop.
    inboundRules List<InstanceSecurityGroupInboundRule>
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name String
    The name of the security group.
    outboundDefaultPolicy String
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outboundRules List<InstanceSecurityGroupOutboundRule>
    A list of outbound rule to add to the security group. (Structure is documented below.)
    projectId String
    projectId) The ID of the project the security group is associated with.
    stateful Boolean
    A boolean to specify whether the security group should be stateful or not.
    tags List<String>
    The tags of the security group.
    zone String
    zone) The zone in which the security group should be created.
    description string
    The description of the security group.
    enableDefaultSecurity boolean
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    externalRules boolean
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inboundDefaultPolicy string
    The default policy on incoming traffic. Possible values are: accept or drop.
    inboundRules InstanceSecurityGroupInboundRule[]
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name string
    The name of the security group.
    outboundDefaultPolicy string
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outboundRules InstanceSecurityGroupOutboundRule[]
    A list of outbound rule to add to the security group. (Structure is documented below.)
    projectId string
    projectId) The ID of the project the security group is associated with.
    stateful boolean
    A boolean to specify whether the security group should be stateful or not.
    tags string[]
    The tags of the security group.
    zone string
    zone) The zone in which the security group should be created.
    description str
    The description of the security group.
    enable_default_security bool
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    external_rules bool
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inbound_default_policy str
    The default policy on incoming traffic. Possible values are: accept or drop.
    inbound_rules Sequence[InstanceSecurityGroupInboundRuleArgs]
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name str
    The name of the security group.
    outbound_default_policy str
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outbound_rules Sequence[InstanceSecurityGroupOutboundRuleArgs]
    A list of outbound rule to add to the security group. (Structure is documented below.)
    project_id str
    projectId) The ID of the project the security group is associated with.
    stateful bool
    A boolean to specify whether the security group should be stateful or not.
    tags Sequence[str]
    The tags of the security group.
    zone str
    zone) The zone in which the security group should be created.
    description String
    The description of the security group.
    enableDefaultSecurity Boolean
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    externalRules Boolean
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inboundDefaultPolicy String
    The default policy on incoming traffic. Possible values are: accept or drop.
    inboundRules List<Property Map>
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name String
    The name of the security group.
    outboundDefaultPolicy String
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outboundRules List<Property Map>
    A list of outbound rule to add to the security group. (Structure is documented below.)
    projectId String
    projectId) The ID of the project the security group is associated with.
    stateful Boolean
    A boolean to specify whether the security group should be stateful or not.
    tags List<String>
    The tags of the security group.
    zone String
    zone) The zone in which the security group should be created.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The organization ID the security group is associated with.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The organization ID the security group is associated with.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The organization ID the security group is associated with.
    id string
    The provider-assigned unique ID for this managed resource.
    organizationId string
    The organization ID the security group is associated with.
    id str
    The provider-assigned unique ID for this managed resource.
    organization_id str
    The organization ID the security group is associated with.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The organization ID the security group is associated with.

    Look up Existing InstanceSecurityGroup Resource

    Get an existing InstanceSecurityGroup 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?: InstanceSecurityGroupState, opts?: CustomResourceOptions): InstanceSecurityGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            enable_default_security: Optional[bool] = None,
            external_rules: Optional[bool] = None,
            inbound_default_policy: Optional[str] = None,
            inbound_rules: Optional[Sequence[InstanceSecurityGroupInboundRuleArgs]] = None,
            name: Optional[str] = None,
            organization_id: Optional[str] = None,
            outbound_default_policy: Optional[str] = None,
            outbound_rules: Optional[Sequence[InstanceSecurityGroupOutboundRuleArgs]] = None,
            project_id: Optional[str] = None,
            stateful: Optional[bool] = None,
            tags: Optional[Sequence[str]] = None,
            zone: Optional[str] = None) -> InstanceSecurityGroup
    func GetInstanceSecurityGroup(ctx *Context, name string, id IDInput, state *InstanceSecurityGroupState, opts ...ResourceOption) (*InstanceSecurityGroup, error)
    public static InstanceSecurityGroup Get(string name, Input<string> id, InstanceSecurityGroupState? state, CustomResourceOptions? opts = null)
    public static InstanceSecurityGroup get(String name, Output<String> id, InstanceSecurityGroupState state, CustomResourceOptions options)
    resources:  _:    type: scaleway:InstanceSecurityGroup    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:
    Description string
    The description of the security group.
    EnableDefaultSecurity bool
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    ExternalRules bool
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    InboundDefaultPolicy string
    The default policy on incoming traffic. Possible values are: accept or drop.
    InboundRules List<Pulumiverse.Scaleway.Inputs.InstanceSecurityGroupInboundRule>
    A list of inbound rule to add to the security group. (Structure is documented below.)
    Name string
    The name of the security group.
    OrganizationId string
    The organization ID the security group is associated with.
    OutboundDefaultPolicy string
    The default policy on outgoing traffic. Possible values are: accept or drop.
    OutboundRules List<Pulumiverse.Scaleway.Inputs.InstanceSecurityGroupOutboundRule>
    A list of outbound rule to add to the security group. (Structure is documented below.)
    ProjectId string
    projectId) The ID of the project the security group is associated with.
    Stateful bool
    A boolean to specify whether the security group should be stateful or not.
    Tags List<string>
    The tags of the security group.
    Zone string
    zone) The zone in which the security group should be created.
    Description string
    The description of the security group.
    EnableDefaultSecurity bool
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    ExternalRules bool
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    InboundDefaultPolicy string
    The default policy on incoming traffic. Possible values are: accept or drop.
    InboundRules []InstanceSecurityGroupInboundRuleArgs
    A list of inbound rule to add to the security group. (Structure is documented below.)
    Name string
    The name of the security group.
    OrganizationId string
    The organization ID the security group is associated with.
    OutboundDefaultPolicy string
    The default policy on outgoing traffic. Possible values are: accept or drop.
    OutboundRules []InstanceSecurityGroupOutboundRuleArgs
    A list of outbound rule to add to the security group. (Structure is documented below.)
    ProjectId string
    projectId) The ID of the project the security group is associated with.
    Stateful bool
    A boolean to specify whether the security group should be stateful or not.
    Tags []string
    The tags of the security group.
    Zone string
    zone) The zone in which the security group should be created.
    description String
    The description of the security group.
    enableDefaultSecurity Boolean
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    externalRules Boolean
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inboundDefaultPolicy String
    The default policy on incoming traffic. Possible values are: accept or drop.
    inboundRules List<InstanceSecurityGroupInboundRule>
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name String
    The name of the security group.
    organizationId String
    The organization ID the security group is associated with.
    outboundDefaultPolicy String
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outboundRules List<InstanceSecurityGroupOutboundRule>
    A list of outbound rule to add to the security group. (Structure is documented below.)
    projectId String
    projectId) The ID of the project the security group is associated with.
    stateful Boolean
    A boolean to specify whether the security group should be stateful or not.
    tags List<String>
    The tags of the security group.
    zone String
    zone) The zone in which the security group should be created.
    description string
    The description of the security group.
    enableDefaultSecurity boolean
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    externalRules boolean
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inboundDefaultPolicy string
    The default policy on incoming traffic. Possible values are: accept or drop.
    inboundRules InstanceSecurityGroupInboundRule[]
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name string
    The name of the security group.
    organizationId string
    The organization ID the security group is associated with.
    outboundDefaultPolicy string
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outboundRules InstanceSecurityGroupOutboundRule[]
    A list of outbound rule to add to the security group. (Structure is documented below.)
    projectId string
    projectId) The ID of the project the security group is associated with.
    stateful boolean
    A boolean to specify whether the security group should be stateful or not.
    tags string[]
    The tags of the security group.
    zone string
    zone) The zone in which the security group should be created.
    description str
    The description of the security group.
    enable_default_security bool
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    external_rules bool
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inbound_default_policy str
    The default policy on incoming traffic. Possible values are: accept or drop.
    inbound_rules Sequence[InstanceSecurityGroupInboundRuleArgs]
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name str
    The name of the security group.
    organization_id str
    The organization ID the security group is associated with.
    outbound_default_policy str
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outbound_rules Sequence[InstanceSecurityGroupOutboundRuleArgs]
    A list of outbound rule to add to the security group. (Structure is documented below.)
    project_id str
    projectId) The ID of the project the security group is associated with.
    stateful bool
    A boolean to specify whether the security group should be stateful or not.
    tags Sequence[str]
    The tags of the security group.
    zone str
    zone) The zone in which the security group should be created.
    description String
    The description of the security group.
    enableDefaultSecurity Boolean
    Whether to block SMTP on IPv4/IPv6 (Port 25, 465, 587). Set to false will unblock SMTP if your account is authorized to. If your organization is not yet authorized to send SMTP traffic, open a support ticket.
    externalRules Boolean
    A boolean to specify whether to use instance_security_group_rules. If externalRules is set to true, inboundRule and outboundRule can not be set directly in the security group.
    inboundDefaultPolicy String
    The default policy on incoming traffic. Possible values are: accept or drop.
    inboundRules List<Property Map>
    A list of inbound rule to add to the security group. (Structure is documented below.)
    name String
    The name of the security group.
    organizationId String
    The organization ID the security group is associated with.
    outboundDefaultPolicy String
    The default policy on outgoing traffic. Possible values are: accept or drop.
    outboundRules List<Property Map>
    A list of outbound rule to add to the security group. (Structure is documented below.)
    projectId String
    projectId) The ID of the project the security group is associated with.
    stateful Boolean
    A boolean to specify whether the security group should be stateful or not.
    tags List<String>
    The tags of the security group.
    zone String
    zone) The zone in which the security group should be created.

    Supporting Types

    InstanceSecurityGroupInboundRule, InstanceSecurityGroupInboundRuleArgs

    Action string
    The action to take when rule match. Possible values are: accept or drop.
    Ip string
    The ip this rule apply to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.

    Deprecated: Ip address is deprecated. Please use ipRange instead

    IpRange string
    The ip range (e.g 192.168.1.0/24) this rule applies to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.
    Port int
    The port this rule applies to. If no port nor portRange are specified, the rule will apply to all port. Only one of port and portRange should be specified.
    PortRange string
    Need terraform >= 0.13.0 (Optional) The port range (e.g 22-23) this rule applies to. If no port nor portRange are specified, rule will apply to all port. Only one of port and portRange should be specified.
    Protocol string
    The protocol this rule apply to. Possible values are: TCP, UDP, ICMP or ANY.
    Action string
    The action to take when rule match. Possible values are: accept or drop.
    Ip string
    The ip this rule apply to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.

    Deprecated: Ip address is deprecated. Please use ipRange instead

    IpRange string
    The ip range (e.g 192.168.1.0/24) this rule applies to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.
    Port int
    The port this rule applies to. If no port nor portRange are specified, the rule will apply to all port. Only one of port and portRange should be specified.
    PortRange string
    Need terraform >= 0.13.0 (Optional) The port range (e.g 22-23) this rule applies to. If no port nor portRange are specified, rule will apply to all port. Only one of port and portRange should be specified.
    Protocol string
    The protocol this rule apply to. Possible values are: TCP, UDP, ICMP or ANY.
    action String
    The action to take when rule match. Possible values are: accept or drop.
    ip String
    The ip this rule apply to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ipRange String
    The ip range (e.g 192.168.1.0/24) this rule applies to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.
    port Integer
    The port this rule applies to. If no port nor portRange are specified, the rule will apply to all port. Only one of port and portRange should be specified.
    portRange String
    Need terraform >= 0.13.0 (Optional) The port range (e.g 22-23) this rule applies to. If no port nor portRange are specified, rule will apply to all port. Only one of port and portRange should be specified.
    protocol String
    The protocol this rule apply to. Possible values are: TCP, UDP, ICMP or ANY.
    action string
    The action to take when rule match. Possible values are: accept or drop.
    ip string
    The ip this rule apply to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ipRange string
    The ip range (e.g 192.168.1.0/24) this rule applies to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.
    port number
    The port this rule applies to. If no port nor portRange are specified, the rule will apply to all port. Only one of port and portRange should be specified.
    portRange string
    Need terraform >= 0.13.0 (Optional) The port range (e.g 22-23) this rule applies to. If no port nor portRange are specified, rule will apply to all port. Only one of port and portRange should be specified.
    protocol string
    The protocol this rule apply to. Possible values are: TCP, UDP, ICMP or ANY.
    action str
    The action to take when rule match. Possible values are: accept or drop.
    ip str
    The ip this rule apply to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ip_range str
    The ip range (e.g 192.168.1.0/24) this rule applies to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.
    port int
    The port this rule applies to. If no port nor portRange are specified, the rule will apply to all port. Only one of port and portRange should be specified.
    port_range str
    Need terraform >= 0.13.0 (Optional) The port range (e.g 22-23) this rule applies to. If no port nor portRange are specified, rule will apply to all port. Only one of port and portRange should be specified.
    protocol str
    The protocol this rule apply to. Possible values are: TCP, UDP, ICMP or ANY.
    action String
    The action to take when rule match. Possible values are: accept or drop.
    ip String
    The ip this rule apply to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ipRange String
    The ip range (e.g 192.168.1.0/24) this rule applies to. If no ip nor ipRange are specified, rule will apply to all ip. Only one of ip and ipRange should be specified.
    port Number
    The port this rule applies to. If no port nor portRange are specified, the rule will apply to all port. Only one of port and portRange should be specified.
    portRange String
    Need terraform >= 0.13.0 (Optional) The port range (e.g 22-23) this rule applies to. If no port nor portRange are specified, rule will apply to all port. Only one of port and portRange should be specified.
    protocol String
    The protocol this rule apply to. Possible values are: TCP, UDP, ICMP or ANY.

    InstanceSecurityGroupOutboundRule, InstanceSecurityGroupOutboundRuleArgs

    Action string
    Action when rule match request (drop or accept)
    Ip string
    Ip address for this rule (e.g: 1.1.1.1). Only one of ip or ipRange should be provided

    Deprecated: Ip address is deprecated. Please use ipRange instead

    IpRange string
    Ip range for this rule (e.g: 192.168.1.0/24). Only one of ip or ipRange should be provided
    Port int
    Network port for this rule
    PortRange string
    Computed port range for this rule (e.g: 1-1024, 22-22)
    Protocol string
    Protocol for this rule (TCP, UDP, ICMP or ANY)
    Action string
    Action when rule match request (drop or accept)
    Ip string
    Ip address for this rule (e.g: 1.1.1.1). Only one of ip or ipRange should be provided

    Deprecated: Ip address is deprecated. Please use ipRange instead

    IpRange string
    Ip range for this rule (e.g: 192.168.1.0/24). Only one of ip or ipRange should be provided
    Port int
    Network port for this rule
    PortRange string
    Computed port range for this rule (e.g: 1-1024, 22-22)
    Protocol string
    Protocol for this rule (TCP, UDP, ICMP or ANY)
    action String
    Action when rule match request (drop or accept)
    ip String
    Ip address for this rule (e.g: 1.1.1.1). Only one of ip or ipRange should be provided

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ipRange String
    Ip range for this rule (e.g: 192.168.1.0/24). Only one of ip or ipRange should be provided
    port Integer
    Network port for this rule
    portRange String
    Computed port range for this rule (e.g: 1-1024, 22-22)
    protocol String
    Protocol for this rule (TCP, UDP, ICMP or ANY)
    action string
    Action when rule match request (drop or accept)
    ip string
    Ip address for this rule (e.g: 1.1.1.1). Only one of ip or ipRange should be provided

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ipRange string
    Ip range for this rule (e.g: 192.168.1.0/24). Only one of ip or ipRange should be provided
    port number
    Network port for this rule
    portRange string
    Computed port range for this rule (e.g: 1-1024, 22-22)
    protocol string
    Protocol for this rule (TCP, UDP, ICMP or ANY)
    action str
    Action when rule match request (drop or accept)
    ip str
    Ip address for this rule (e.g: 1.1.1.1). Only one of ip or ipRange should be provided

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ip_range str
    Ip range for this rule (e.g: 192.168.1.0/24). Only one of ip or ipRange should be provided
    port int
    Network port for this rule
    port_range str
    Computed port range for this rule (e.g: 1-1024, 22-22)
    protocol str
    Protocol for this rule (TCP, UDP, ICMP or ANY)
    action String
    Action when rule match request (drop or accept)
    ip String
    Ip address for this rule (e.g: 1.1.1.1). Only one of ip or ipRange should be provided

    Deprecated: Ip address is deprecated. Please use ipRange instead

    ipRange String
    Ip range for this rule (e.g: 192.168.1.0/24). Only one of ip or ipRange should be provided
    port Number
    Network port for this rule
    portRange String
    Computed port range for this rule (e.g: 1-1024, 22-22)
    protocol String
    Protocol for this rule (TCP, UDP, ICMP or ANY)

    Import

    Instance security group can be imported using the {zone}/{id}, e.g.

    $ pulumi import scaleway:index/instanceSecurityGroup:InstanceSecurityGroup web fr-par-1/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
    Viewing docs for Scaleway v1.48.0
    published on Wednesday, Apr 29, 2026 by pulumiverse
      Try Pulumi Cloud free. Your team will thank you.