1. Packages
  2. Outscale Provider
  3. API Docs
  4. SecurityGroupRule
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.SecurityGroupRule

Explore with Pulumi AI

Manages a security group rule.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

Required resources

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const securityGroup01 = new outscale.SecurityGroup("securityGroup01", {
    description: "Terraform target security group for SG rule from IP and SG",
    securityGroupName: "terraform-security-group-test-01",
});
const securityGroup02 = new outscale.SecurityGroup("securityGroup02", {
    description: "Terraform source security group for SG rule from SG",
    securityGroupName: "terraform-security-group-test-02",
});
Copy
import pulumi
import pulumi_outscale as outscale

security_group01 = outscale.SecurityGroup("securityGroup01",
    description="Terraform target security group for SG rule from IP and SG",
    security_group_name="terraform-security-group-test-01")
security_group02 = outscale.SecurityGroup("securityGroup02",
    description="Terraform source security group for SG rule from SG",
    security_group_name="terraform-security-group-test-02")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewSecurityGroup(ctx, "securityGroup01", &outscale.SecurityGroupArgs{
			Description:       pulumi.String("Terraform target security group for SG rule from IP and SG"),
			SecurityGroupName: pulumi.String("terraform-security-group-test-01"),
		})
		if err != nil {
			return err
		}
		_, err = outscale.NewSecurityGroup(ctx, "securityGroup02", &outscale.SecurityGroupArgs{
			Description:       pulumi.String("Terraform source security group for SG rule from SG"),
			SecurityGroupName: pulumi.String("terraform-security-group-test-02"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var securityGroup01 = new Outscale.SecurityGroup("securityGroup01", new()
    {
        Description = "Terraform target security group for SG rule from IP and SG",
        SecurityGroupName = "terraform-security-group-test-01",
    });

    var securityGroup02 = new Outscale.SecurityGroup("securityGroup02", new()
    {
        Description = "Terraform source security group for SG rule from SG",
        SecurityGroupName = "terraform-security-group-test-02",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.SecurityGroup;
import com.pulumi.outscale.SecurityGroupArgs;
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 securityGroup01 = new SecurityGroup("securityGroup01", SecurityGroupArgs.builder()
            .description("Terraform target security group for SG rule from IP and SG")
            .securityGroupName("terraform-security-group-test-01")
            .build());

        var securityGroup02 = new SecurityGroup("securityGroup02", SecurityGroupArgs.builder()
            .description("Terraform source security group for SG rule from SG")
            .securityGroupName("terraform-security-group-test-02")
            .build());

    }
}
Copy
resources:
  securityGroup01:
    type: outscale:SecurityGroup
    properties:
      description: Terraform target security group for SG rule from IP and SG
      securityGroupName: terraform-security-group-test-01
  securityGroup02:
    type: outscale:SecurityGroup
    properties:
      description: Terraform source security group for SG rule from SG
      securityGroupName: terraform-security-group-test-02
Copy

Set an inbound rule from an IP range

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const securityGroupRule01 = new outscale.SecurityGroupRule("securityGroupRule01", {
    flow: "Inbound",
    securityGroupId: outscale_security_group.security_group01.security_group_id,
    fromPortRange: 80,
    toPortRange: 80,
    ipProtocol: "tcp",
    ipRange: "10.0.0.0/16",
});
Copy
import pulumi
import pulumi_outscale as outscale

security_group_rule01 = outscale.SecurityGroupRule("securityGroupRule01",
    flow="Inbound",
    security_group_id=outscale_security_group["security_group01"]["security_group_id"],
    from_port_range=80,
    to_port_range=80,
    ip_protocol="tcp",
    ip_range="10.0.0.0/16")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewSecurityGroupRule(ctx, "securityGroupRule01", &outscale.SecurityGroupRuleArgs{
			Flow:            pulumi.String("Inbound"),
			SecurityGroupId: pulumi.Any(outscale_security_group.Security_group01.Security_group_id),
			FromPortRange:   pulumi.Float64(80),
			ToPortRange:     pulumi.Float64(80),
			IpProtocol:      pulumi.String("tcp"),
			IpRange:         pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var securityGroupRule01 = new Outscale.SecurityGroupRule("securityGroupRule01", new()
    {
        Flow = "Inbound",
        SecurityGroupId = outscale_security_group.Security_group01.Security_group_id,
        FromPortRange = 80,
        ToPortRange = 80,
        IpProtocol = "tcp",
        IpRange = "10.0.0.0/16",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.SecurityGroupRule;
import com.pulumi.outscale.SecurityGroupRuleArgs;
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 securityGroupRule01 = new SecurityGroupRule("securityGroupRule01", SecurityGroupRuleArgs.builder()
            .flow("Inbound")
            .securityGroupId(outscale_security_group.security_group01().security_group_id())
            .fromPortRange("80")
            .toPortRange("80")
            .ipProtocol("tcp")
            .ipRange("10.0.0.0/16")
            .build());

    }
}
Copy
resources:
  securityGroupRule01:
    type: outscale:SecurityGroupRule
    properties:
      flow: Inbound
      securityGroupId: ${outscale_security_group.security_group01.security_group_id}
      fromPortRange: '80'
      toPortRange: '80'
      ipProtocol: tcp
      ipRange: 10.0.0.0/16
Copy

Set an inbound rule from another security group

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const securityGroupRule02 = new outscale.SecurityGroupRule("securityGroupRule02", {
    flow: "Inbound",
    securityGroupId: outscale_security_group.security_group01.security_group_id,
    rules: [{
        fromPortRange: 22,
        toPortRange: 22,
        ipProtocol: "tcp",
        securityGroupsMembers: [{
            accountId: "012345678910",
            securityGroupName: "terraform-security-group-test-02",
        }],
    }],
});
Copy
import pulumi
import pulumi_outscale as outscale

security_group_rule02 = outscale.SecurityGroupRule("securityGroupRule02",
    flow="Inbound",
    security_group_id=outscale_security_group["security_group01"]["security_group_id"],
    rules=[{
        "from_port_range": 22,
        "to_port_range": 22,
        "ip_protocol": "tcp",
        "security_groups_members": [{
            "account_id": "012345678910",
            "security_group_name": "terraform-security-group-test-02",
        }],
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewSecurityGroupRule(ctx, "securityGroupRule02", &outscale.SecurityGroupRuleArgs{
			Flow:            pulumi.String("Inbound"),
			SecurityGroupId: pulumi.Any(outscale_security_group.Security_group01.Security_group_id),
			Rules: outscale.SecurityGroupRuleRuleArray{
				&outscale.SecurityGroupRuleRuleArgs{
					FromPortRange: pulumi.Float64(22),
					ToPortRange:   pulumi.Float64(22),
					IpProtocol:    pulumi.String("tcp"),
					SecurityGroupsMembers: outscale.SecurityGroupRuleRuleSecurityGroupsMemberArray{
						&outscale.SecurityGroupRuleRuleSecurityGroupsMemberArgs{
							AccountId:         pulumi.String("012345678910"),
							SecurityGroupName: pulumi.String("terraform-security-group-test-02"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var securityGroupRule02 = new Outscale.SecurityGroupRule("securityGroupRule02", new()
    {
        Flow = "Inbound",
        SecurityGroupId = outscale_security_group.Security_group01.Security_group_id,
        Rules = new[]
        {
            new Outscale.Inputs.SecurityGroupRuleRuleArgs
            {
                FromPortRange = 22,
                ToPortRange = 22,
                IpProtocol = "tcp",
                SecurityGroupsMembers = new[]
                {
                    new Outscale.Inputs.SecurityGroupRuleRuleSecurityGroupsMemberArgs
                    {
                        AccountId = "012345678910",
                        SecurityGroupName = "terraform-security-group-test-02",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.SecurityGroupRule;
import com.pulumi.outscale.SecurityGroupRuleArgs;
import com.pulumi.outscale.inputs.SecurityGroupRuleRuleArgs;
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 securityGroupRule02 = new SecurityGroupRule("securityGroupRule02", SecurityGroupRuleArgs.builder()
            .flow("Inbound")
            .securityGroupId(outscale_security_group.security_group01().security_group_id())
            .rules(SecurityGroupRuleRuleArgs.builder()
                .fromPortRange("22")
                .toPortRange("22")
                .ipProtocol("tcp")
                .securityGroupsMembers(SecurityGroupRuleRuleSecurityGroupsMemberArgs.builder()
                    .accountId("012345678910")
                    .securityGroupName("terraform-security-group-test-02")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  securityGroupRule02:
    type: outscale:SecurityGroupRule
    properties:
      flow: Inbound
      securityGroupId: ${outscale_security_group.security_group01.security_group_id}
      rules:
        - fromPortRange: '22'
          toPortRange: '22'
          ipProtocol: tcp
          securityGroupsMembers:
            - accountId: '012345678910'
              securityGroupName: terraform-security-group-test-02
Copy

Create SecurityGroupRule Resource

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

Constructor syntax

new SecurityGroupRule(name: string, args: SecurityGroupRuleArgs, opts?: CustomResourceOptions);
@overload
def SecurityGroupRule(resource_name: str,
                      args: SecurityGroupRuleArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def SecurityGroupRule(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      flow: Optional[str] = None,
                      security_group_id: Optional[str] = None,
                      from_port_range: Optional[float] = None,
                      ip_protocol: Optional[str] = None,
                      ip_range: Optional[str] = None,
                      rules: Optional[Sequence[SecurityGroupRuleRuleArgs]] = None,
                      security_group_account_id_to_link: Optional[str] = None,
                      security_group_name_to_link: Optional[str] = None,
                      security_group_rule_id: Optional[str] = None,
                      to_port_range: Optional[float] = None)
func NewSecurityGroupRule(ctx *Context, name string, args SecurityGroupRuleArgs, opts ...ResourceOption) (*SecurityGroupRule, error)
public SecurityGroupRule(string name, SecurityGroupRuleArgs args, CustomResourceOptions? opts = null)
public SecurityGroupRule(String name, SecurityGroupRuleArgs args)
public SecurityGroupRule(String name, SecurityGroupRuleArgs args, CustomResourceOptions options)
type: outscale:SecurityGroupRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SecurityGroupRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SecurityGroupRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SecurityGroupRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SecurityGroupRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SecurityGroupRuleArgs
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 securityGroupRuleResource = new Outscale.SecurityGroupRule("securityGroupRuleResource", new()
{
    Flow = "string",
    SecurityGroupId = "string",
    FromPortRange = 0,
    IpProtocol = "string",
    IpRange = "string",
    Rules = new[]
    {
        new Outscale.Inputs.SecurityGroupRuleRuleArgs
        {
            FromPortRange = 0,
            IpProtocol = "string",
            IpRanges = new[]
            {
                "string",
            },
            SecurityGroupsMembers = new[]
            {
                new Outscale.Inputs.SecurityGroupRuleRuleSecurityGroupsMemberArgs
                {
                    AccountId = "string",
                    SecurityGroupId = "string",
                    SecurityGroupName = "string",
                },
            },
            ServiceIds = new[]
            {
                "string",
            },
            ToPortRange = 0,
        },
    },
    SecurityGroupAccountIdToLink = "string",
    SecurityGroupNameToLink = "string",
    SecurityGroupRuleId = "string",
    ToPortRange = 0,
});
Copy
example, err := outscale.NewSecurityGroupRule(ctx, "securityGroupRuleResource", &outscale.SecurityGroupRuleArgs{
Flow: pulumi.String("string"),
SecurityGroupId: pulumi.String("string"),
FromPortRange: pulumi.Float64(0),
IpProtocol: pulumi.String("string"),
IpRange: pulumi.String("string"),
Rules: .SecurityGroupRuleRuleArray{
&.SecurityGroupRuleRuleArgs{
FromPortRange: pulumi.Float64(0),
IpProtocol: pulumi.String("string"),
IpRanges: pulumi.StringArray{
pulumi.String("string"),
},
SecurityGroupsMembers: .SecurityGroupRuleRuleSecurityGroupsMemberArray{
&.SecurityGroupRuleRuleSecurityGroupsMemberArgs{
AccountId: pulumi.String("string"),
SecurityGroupId: pulumi.String("string"),
SecurityGroupName: pulumi.String("string"),
},
},
ServiceIds: pulumi.StringArray{
pulumi.String("string"),
},
ToPortRange: pulumi.Float64(0),
},
},
SecurityGroupAccountIdToLink: pulumi.String("string"),
SecurityGroupNameToLink: pulumi.String("string"),
SecurityGroupRuleId: pulumi.String("string"),
ToPortRange: pulumi.Float64(0),
})
Copy
var securityGroupRuleResource = new SecurityGroupRule("securityGroupRuleResource", SecurityGroupRuleArgs.builder()
    .flow("string")
    .securityGroupId("string")
    .fromPortRange(0)
    .ipProtocol("string")
    .ipRange("string")
    .rules(SecurityGroupRuleRuleArgs.builder()
        .fromPortRange(0)
        .ipProtocol("string")
        .ipRanges("string")
        .securityGroupsMembers(SecurityGroupRuleRuleSecurityGroupsMemberArgs.builder()
            .accountId("string")
            .securityGroupId("string")
            .securityGroupName("string")
            .build())
        .serviceIds("string")
        .toPortRange(0)
        .build())
    .securityGroupAccountIdToLink("string")
    .securityGroupNameToLink("string")
    .securityGroupRuleId("string")
    .toPortRange(0)
    .build());
Copy
security_group_rule_resource = outscale.SecurityGroupRule("securityGroupRuleResource",
    flow="string",
    security_group_id="string",
    from_port_range=0,
    ip_protocol="string",
    ip_range="string",
    rules=[{
        "from_port_range": 0,
        "ip_protocol": "string",
        "ip_ranges": ["string"],
        "security_groups_members": [{
            "account_id": "string",
            "security_group_id": "string",
            "security_group_name": "string",
        }],
        "service_ids": ["string"],
        "to_port_range": 0,
    }],
    security_group_account_id_to_link="string",
    security_group_name_to_link="string",
    security_group_rule_id="string",
    to_port_range=0)
Copy
const securityGroupRuleResource = new outscale.SecurityGroupRule("securityGroupRuleResource", {
    flow: "string",
    securityGroupId: "string",
    fromPortRange: 0,
    ipProtocol: "string",
    ipRange: "string",
    rules: [{
        fromPortRange: 0,
        ipProtocol: "string",
        ipRanges: ["string"],
        securityGroupsMembers: [{
            accountId: "string",
            securityGroupId: "string",
            securityGroupName: "string",
        }],
        serviceIds: ["string"],
        toPortRange: 0,
    }],
    securityGroupAccountIdToLink: "string",
    securityGroupNameToLink: "string",
    securityGroupRuleId: "string",
    toPortRange: 0,
});
Copy
type: outscale:SecurityGroupRule
properties:
    flow: string
    fromPortRange: 0
    ipProtocol: string
    ipRange: string
    rules:
        - fromPortRange: 0
          ipProtocol: string
          ipRanges:
            - string
          securityGroupsMembers:
            - accountId: string
              securityGroupId: string
              securityGroupName: string
          serviceIds:
            - string
          toPortRange: 0
    securityGroupAccountIdToLink: string
    securityGroupId: string
    securityGroupNameToLink: string
    securityGroupRuleId: string
    toPortRange: 0
Copy

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

Flow This property is required. string
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
SecurityGroupId This property is required. string
The ID of the security group for which you want to create a rule.
FromPortRange double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpRange string
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
Rules List<SecurityGroupRuleRule>
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
SecurityGroupAccountIdToLink string
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
SecurityGroupNameToLink string
The ID of a source or destination security group that you want to link to the security group of the rule.
SecurityGroupRuleId string
ToPortRange double
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
Flow This property is required. string
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
SecurityGroupId This property is required. string
The ID of the security group for which you want to create a rule.
FromPortRange float64
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpRange string
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
Rules []SecurityGroupRuleRuleArgs
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
SecurityGroupAccountIdToLink string
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
SecurityGroupNameToLink string
The ID of a source or destination security group that you want to link to the security group of the rule.
SecurityGroupRuleId string
ToPortRange float64
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow This property is required. String
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
securityGroupId This property is required. String
The ID of the security group for which you want to create a rule.
fromPortRange Double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipProtocol String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipRange String
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
rules List<SecurityGroupRuleRule>
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
securityGroupAccountIdToLink String
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
securityGroupNameToLink String
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupRuleId String
toPortRange Double
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow This property is required. string
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
securityGroupId This property is required. string
The ID of the security group for which you want to create a rule.
fromPortRange number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipRange string
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
rules SecurityGroupRuleRule[]
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
securityGroupAccountIdToLink string
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
securityGroupNameToLink string
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupRuleId string
toPortRange number
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow This property is required. str
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
security_group_id This property is required. str
The ID of the security group for which you want to create a rule.
from_port_range float
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ip_protocol str
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ip_range str
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
rules Sequence[SecurityGroupRuleRuleArgs]
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
security_group_account_id_to_link str
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
security_group_name_to_link str
The ID of a source or destination security group that you want to link to the security group of the rule.
security_group_rule_id str
to_port_range float
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow This property is required. String
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
securityGroupId This property is required. String
The ID of the security group for which you want to create a rule.
fromPortRange Number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipProtocol String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipRange String
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
rules List<Property Map>
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
securityGroupAccountIdToLink String
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
securityGroupNameToLink String
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupRuleId String
toPortRange Number
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
NetId string
The ID of the Net for the security group.
RequestId string
SecurityGroupName string
The name of the security group.
Id string
The provider-assigned unique ID for this managed resource.
NetId string
The ID of the Net for the security group.
RequestId string
SecurityGroupName string
The name of the security group.
id String
The provider-assigned unique ID for this managed resource.
netId String
The ID of the Net for the security group.
requestId String
securityGroupName String
The name of the security group.
id string
The provider-assigned unique ID for this managed resource.
netId string
The ID of the Net for the security group.
requestId string
securityGroupName string
The name of the security group.
id str
The provider-assigned unique ID for this managed resource.
net_id str
The ID of the Net for the security group.
request_id str
security_group_name str
The name of the security group.
id String
The provider-assigned unique ID for this managed resource.
netId String
The ID of the Net for the security group.
requestId String
securityGroupName String
The name of the security group.

Look up Existing SecurityGroupRule Resource

Get an existing SecurityGroupRule 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?: SecurityGroupRuleState, opts?: CustomResourceOptions): SecurityGroupRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        flow: Optional[str] = None,
        from_port_range: Optional[float] = None,
        ip_protocol: Optional[str] = None,
        ip_range: Optional[str] = None,
        net_id: Optional[str] = None,
        request_id: Optional[str] = None,
        rules: Optional[Sequence[SecurityGroupRuleRuleArgs]] = None,
        security_group_account_id_to_link: Optional[str] = None,
        security_group_id: Optional[str] = None,
        security_group_name: Optional[str] = None,
        security_group_name_to_link: Optional[str] = None,
        security_group_rule_id: Optional[str] = None,
        to_port_range: Optional[float] = None) -> SecurityGroupRule
func GetSecurityGroupRule(ctx *Context, name string, id IDInput, state *SecurityGroupRuleState, opts ...ResourceOption) (*SecurityGroupRule, error)
public static SecurityGroupRule Get(string name, Input<string> id, SecurityGroupRuleState? state, CustomResourceOptions? opts = null)
public static SecurityGroupRule get(String name, Output<String> id, SecurityGroupRuleState state, CustomResourceOptions options)
resources:  _:    type: outscale:SecurityGroupRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Flow string
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
FromPortRange double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpRange string
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
NetId string
The ID of the Net for the security group.
RequestId string
Rules List<SecurityGroupRuleRule>
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
SecurityGroupAccountIdToLink string
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
SecurityGroupId string
The ID of the security group for which you want to create a rule.
SecurityGroupName string
The name of the security group.
SecurityGroupNameToLink string
The ID of a source or destination security group that you want to link to the security group of the rule.
SecurityGroupRuleId string
ToPortRange double
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
Flow string
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
FromPortRange float64
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
IpRange string
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
NetId string
The ID of the Net for the security group.
RequestId string
Rules []SecurityGroupRuleRuleArgs
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
SecurityGroupAccountIdToLink string
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
SecurityGroupId string
The ID of the security group for which you want to create a rule.
SecurityGroupName string
The name of the security group.
SecurityGroupNameToLink string
The ID of a source or destination security group that you want to link to the security group of the rule.
SecurityGroupRuleId string
ToPortRange float64
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow String
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
fromPortRange Double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipProtocol String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipRange String
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
netId String
The ID of the Net for the security group.
requestId String
rules List<SecurityGroupRuleRule>
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
securityGroupAccountIdToLink String
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
securityGroupId String
The ID of the security group for which you want to create a rule.
securityGroupName String
The name of the security group.
securityGroupNameToLink String
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupRuleId String
toPortRange Double
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow string
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
fromPortRange number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipRange string
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
netId string
The ID of the Net for the security group.
requestId string
rules SecurityGroupRuleRule[]
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
securityGroupAccountIdToLink string
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
securityGroupId string
The ID of the security group for which you want to create a rule.
securityGroupName string
The name of the security group.
securityGroupNameToLink string
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupRuleId string
toPortRange number
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow str
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
from_port_range float
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ip_protocol str
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ip_range str
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
net_id str
The ID of the Net for the security group.
request_id str
rules Sequence[SecurityGroupRuleRuleArgs]
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
security_group_account_id_to_link str
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
security_group_id str
The ID of the security group for which you want to create a rule.
security_group_name str
The name of the security group.
security_group_name_to_link str
The ID of a source or destination security group that you want to link to the security group of the rule.
security_group_rule_id str
to_port_range float
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
flow String
The direction of the flow: Inbound or Outbound. You can specify Outbound for Nets only.
fromPortRange Number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipProtocol String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website. If you specify this parameter, you cannot specify the rules parameter and its subparameters.
ipRange String
The IP range for the security group rule, in CIDR notation (for example, 10.0.0.0/16). If you specify this parameter, you cannot specify the rules parameter and its subparameters.
netId String
The ID of the Net for the security group.
requestId String
rules List<Property Map>
Information about the security group rule to create. If you specify this parent parameter and its subparameters, you cannot specify the following parent parameters: from_port_range, ip_protocol, ip_range, and to_port_range.
securityGroupAccountIdToLink String
The account ID that owns the source or destination security group specified in the security_group_name_to_link parameter.
securityGroupId String
The ID of the security group for which you want to create a rule.
securityGroupName String
The name of the security group.
securityGroupNameToLink String
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupRuleId String
toPortRange Number
The end of the port range for the TCP and UDP protocols, or an ICMP code number. If you specify this parameter, you cannot specify the rules parameter and its subparameters.

Supporting Types

SecurityGroupRuleRule
, SecurityGroupRuleRuleArgs

FromPortRange double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
IpProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
IpRanges List<string>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
SecurityGroupsMembers List<SecurityGroupRuleRuleSecurityGroupsMember>
Information about one or more source or destination security groups.
ServiceIds List<string>
One or more service IDs to allow traffic from a Net to access the corresponding OUTSCALE services. For more information, see ReadNetAccessPointServices.
ToPortRange double
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
FromPortRange float64
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
IpProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
IpRanges []string
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
SecurityGroupsMembers []SecurityGroupRuleRuleSecurityGroupsMember
Information about one or more source or destination security groups.
ServiceIds []string
One or more service IDs to allow traffic from a Net to access the corresponding OUTSCALE services. For more information, see ReadNetAccessPointServices.
ToPortRange float64
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange Double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges List<String>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
securityGroupsMembers List<SecurityGroupRuleRuleSecurityGroupsMember>
Information about one or more source or destination security groups.
serviceIds List<String>
One or more service IDs to allow traffic from a Net to access the corresponding OUTSCALE services. For more information, see ReadNetAccessPointServices.
toPortRange Double
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges string[]
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
securityGroupsMembers SecurityGroupRuleRuleSecurityGroupsMember[]
Information about one or more source or destination security groups.
serviceIds string[]
One or more service IDs to allow traffic from a Net to access the corresponding OUTSCALE services. For more information, see ReadNetAccessPointServices.
toPortRange number
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
from_port_range float
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ip_protocol str
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ip_ranges Sequence[str]
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
security_groups_members Sequence[SecurityGroupRuleRuleSecurityGroupsMember]
Information about one or more source or destination security groups.
service_ids Sequence[str]
One or more service IDs to allow traffic from a Net to access the corresponding OUTSCALE services. For more information, see ReadNetAccessPointServices.
to_port_range float
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange Number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges List<String>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
securityGroupsMembers List<Property Map>
Information about one or more source or destination security groups.
serviceIds List<String>
One or more service IDs to allow traffic from a Net to access the corresponding OUTSCALE services. For more information, see ReadNetAccessPointServices.
toPortRange Number
The end of the port range for the TCP and UDP protocols, or an ICMP code number.

SecurityGroupRuleRuleSecurityGroupsMember
, SecurityGroupRuleRuleSecurityGroupsMemberArgs

AccountId string
The account ID that owns the source or destination security group.
SecurityGroupId string
The ID of a source or destination security group that you want to link to the security group of the rule.
SecurityGroupName string
(Public Cloud only) The name of a source or destination security group that you want to link to the security group of the rule.
AccountId string
The account ID that owns the source or destination security group.
SecurityGroupId string
The ID of a source or destination security group that you want to link to the security group of the rule.
SecurityGroupName string
(Public Cloud only) The name of a source or destination security group that you want to link to the security group of the rule.
accountId String
The account ID that owns the source or destination security group.
securityGroupId String
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupName String
(Public Cloud only) The name of a source or destination security group that you want to link to the security group of the rule.
accountId string
The account ID that owns the source or destination security group.
securityGroupId string
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupName string
(Public Cloud only) The name of a source or destination security group that you want to link to the security group of the rule.
account_id str
The account ID that owns the source or destination security group.
security_group_id str
The ID of a source or destination security group that you want to link to the security group of the rule.
security_group_name str
(Public Cloud only) The name of a source or destination security group that you want to link to the security group of the rule.
accountId String
The account ID that owns the source or destination security group.
securityGroupId String
The ID of a source or destination security group that you want to link to the security group of the rule.
securityGroupName String
(Public Cloud only) The name of a source or destination security group that you want to link to the security group of the rule.

Import

A security group rule can be imported using the following format: SecurityGroupId_Flow_IpProtocol_FromPortRange_ToPortRange_IpRange.

For example:

console

$ pulumi import outscale:index/securityGroupRule:SecurityGroupRule ImportedRule sg-87654321_outbound_-1_-1_-1_10.0.0.0/16
Copy

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

Package Details

Repository
outscale outscale/terraform-provider-outscale
License
Notes
This Pulumi package is based on the outscale Terraform Provider.