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",
});
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")
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
	})
}
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",
    });
});
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());
    }
}
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
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",
});
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")
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
	})
}
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",
    });
});
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());
    }
}
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
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",
        }],
    }],
});
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",
        }],
    }])
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
	})
}
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",
                    },
                },
            },
        },
    });
});
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());
    }
}
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
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 string
- The unique name of the resource.
- args SecurityGroupRuleArgs
- 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 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 string
- The unique name of the resource.
- args SecurityGroupRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecurityGroupRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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,
});
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),
})
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());
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)
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,
});
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
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 string
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- SecurityGroup stringId 
- The ID of the security group for which you want to create a rule.
- FromPort doubleRange 
- 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 rulesparameter and its subparameters.
- IpProtocol string
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- Rules
List<SecurityGroup Rule Rule> 
- 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, andto_port_range.
- SecurityGroup stringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- SecurityGroup stringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- SecurityGroup stringRule Id 
- ToPort doubleRange 
- 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 rulesparameter and its subparameters.
- Flow string
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- SecurityGroup stringId 
- The ID of the security group for which you want to create a rule.
- FromPort float64Range 
- 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 rulesparameter and its subparameters.
- IpProtocol string
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- Rules
[]SecurityGroup Rule Rule Args 
- 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, andto_port_range.
- SecurityGroup stringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- SecurityGroup stringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- SecurityGroup stringRule Id 
- ToPort float64Range 
- 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 rulesparameter and its subparameters.
- flow String
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- securityGroup StringId 
- The ID of the security group for which you want to create a rule.
- fromPort DoubleRange 
- 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 rulesparameter and its subparameters.
- ipProtocol String
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- rules
List<SecurityGroup Rule Rule> 
- 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, andto_port_range.
- securityGroup StringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- securityGroup StringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup StringRule Id 
- toPort DoubleRange 
- 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 rulesparameter and its subparameters.
- flow string
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- securityGroup stringId 
- The ID of the security group for which you want to create a rule.
- fromPort numberRange 
- 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 rulesparameter and its subparameters.
- ipProtocol string
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- rules
SecurityGroup Rule Rule[] 
- 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, andto_port_range.
- securityGroup stringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- securityGroup stringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup stringRule Id 
- toPort numberRange 
- 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 rulesparameter and its subparameters.
- flow str
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- security_group_ strid 
- The ID of the security group for which you want to create a rule.
- from_port_ floatrange 
- 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 rulesparameter and its subparameters.
- ip_protocol str
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- rules
Sequence[SecurityGroup Rule Rule Args] 
- 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, andto_port_range.
- security_group_ straccount_ id_ to_ link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- security_group_ strname_ to_ link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- security_group_ strrule_ id 
- to_port_ floatrange 
- 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 rulesparameter and its subparameters.
- flow String
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- securityGroup StringId 
- The ID of the security group for which you want to create a rule.
- fromPort NumberRange 
- 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 rulesparameter and its subparameters.
- ipProtocol String
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter 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, andto_port_range.
- securityGroup StringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- securityGroup StringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup StringRule Id 
- toPort NumberRange 
- 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 rulesparameter 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
- SecurityGroup stringName 
- 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
- SecurityGroup stringName 
- 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
- securityGroup StringName 
- 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
- securityGroup stringName 
- 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_ strname 
- 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
- securityGroup StringName 
- 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) -> SecurityGroupRulefunc 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
- 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.
- Flow string
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- FromPort doubleRange 
- 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 rulesparameter and its subparameters.
- IpProtocol string
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- NetId string
- The ID of the Net for the security group.
- RequestId string
- Rules
List<SecurityGroup Rule Rule> 
- 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, andto_port_range.
- SecurityGroup stringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- SecurityGroup stringId 
- The ID of the security group for which you want to create a rule.
- SecurityGroup stringName 
- The name of the security group.
- SecurityGroup stringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- SecurityGroup stringRule Id 
- ToPort doubleRange 
- 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 rulesparameter and its subparameters.
- Flow string
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- FromPort float64Range 
- 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 rulesparameter and its subparameters.
- IpProtocol string
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- NetId string
- The ID of the Net for the security group.
- RequestId string
- Rules
[]SecurityGroup Rule Rule Args 
- 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, andto_port_range.
- SecurityGroup stringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- SecurityGroup stringId 
- The ID of the security group for which you want to create a rule.
- SecurityGroup stringName 
- The name of the security group.
- SecurityGroup stringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- SecurityGroup stringRule Id 
- ToPort float64Range 
- 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 rulesparameter and its subparameters.
- flow String
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- fromPort DoubleRange 
- 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 rulesparameter and its subparameters.
- ipProtocol String
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- netId String
- The ID of the Net for the security group.
- requestId String
- rules
List<SecurityGroup Rule Rule> 
- 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, andto_port_range.
- securityGroup StringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- securityGroup StringId 
- The ID of the security group for which you want to create a rule.
- securityGroup StringName 
- The name of the security group.
- securityGroup StringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup StringRule Id 
- toPort DoubleRange 
- 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 rulesparameter and its subparameters.
- flow string
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- fromPort numberRange 
- 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 rulesparameter and its subparameters.
- ipProtocol string
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- netId string
- The ID of the Net for the security group.
- requestId string
- rules
SecurityGroup Rule Rule[] 
- 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, andto_port_range.
- securityGroup stringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- securityGroup stringId 
- The ID of the security group for which you want to create a rule.
- securityGroup stringName 
- The name of the security group.
- securityGroup stringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup stringRule Id 
- toPort numberRange 
- 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 rulesparameter and its subparameters.
- flow str
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- from_port_ floatrange 
- 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 rulesparameter and its subparameters.
- ip_protocol str
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter and its subparameters.
- net_id str
- The ID of the Net for the security group.
- request_id str
- rules
Sequence[SecurityGroup Rule Rule Args] 
- 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, andto_port_range.
- security_group_ straccount_ id_ to_ link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- security_group_ strid 
- The ID of the security group for which you want to create a rule.
- security_group_ strname 
- The name of the security group.
- security_group_ strname_ to_ link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- security_group_ strrule_ id 
- to_port_ floatrange 
- 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 rulesparameter and its subparameters.
- flow String
- The direction of the flow: InboundorOutbound. You can specifyOutboundfor Nets only.
- fromPort NumberRange 
- 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 rulesparameter and its subparameters.
- ipProtocol String
- The IP protocol name (tcp,udp,icmp, or-1for 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 therulesparameter 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 rulesparameter 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, andto_port_range.
- securityGroup StringAccount Id To Link 
- The account ID that owns the source or destination security group specified in the security_group_name_to_linkparameter.
- securityGroup StringId 
- The ID of the security group for which you want to create a rule.
- securityGroup StringName 
- The name of the security group.
- securityGroup StringName To Link 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup StringRule Id 
- toPort NumberRange 
- 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 rulesparameter and its subparameters.
Supporting Types
SecurityGroupRuleRule, SecurityGroupRuleRuleArgs        
- FromPort doubleRange 
- 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-1for 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).
- SecurityGroups List<SecurityMembers Group Rule Rule Security Groups Member> 
- 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.
- ToPort doubleRange 
- The end of the port range for the TCP and UDP protocols, or an ICMP code number.
- FromPort float64Range 
- 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-1for 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).
- SecurityGroups []SecurityMembers Group Rule Rule Security Groups Member 
- 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.
- ToPort float64Range 
- The end of the port range for the TCP and UDP protocols, or an ICMP code number.
- fromPort DoubleRange 
- 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-1for 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).
- securityGroups List<SecurityMembers Group Rule Rule Security Groups Member> 
- 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.
- toPort DoubleRange 
- The end of the port range for the TCP and UDP protocols, or an ICMP code number.
- fromPort numberRange 
- 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-1for 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).
- securityGroups SecurityMembers Group Rule Rule Security Groups Member[] 
- 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.
- toPort numberRange 
- The end of the port range for the TCP and UDP protocols, or an ICMP code number.
- from_port_ floatrange 
- 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-1for 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_ Sequence[Securitymembers Group Rule Rule Security Groups Member] 
- 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_ floatrange 
- The end of the port range for the TCP and UDP protocols, or an ICMP code number.
- fromPort NumberRange 
- 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-1for 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).
- securityGroups List<Property Map>Members 
- 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.
- toPort NumberRange 
- 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.
- SecurityGroup stringId 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- SecurityGroup stringName 
- (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.
- SecurityGroup stringId 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- SecurityGroup stringName 
- (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.
- securityGroup StringId 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup StringName 
- (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.
- securityGroup stringId 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup stringName 
- (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_ strid 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- security_group_ strname 
- (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.
- securityGroup StringId 
- The ID of a source or destination security group that you want to link to the security group of the rule.
- securityGroup StringName 
- (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
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 outscaleTerraform Provider.