# SCP::SecurityGroup::SecurityGroupRule

LLMS index: [llms.txt](https://docs.e.samsungsdscloud.com/en/templatereference/networking/security-group/llms.txt)

---

```
SCP::SecurityGroup::SecurityGroupRule
```





## Description
A Security Group Rule that allows or denies traffic to and from a server. The rule applies to a direction, protocol, and port range, and can be applied to an IP range, a remote security group, or an address group.

## Version
`1.1.0`

## Syntax

To declare this entity in your Infrastructure Builder template, use the following syntax:

**JSON**
```json
{
  "Type" : "SCP::SecurityGroup::SecurityGroupRule",
  "Properties" : {
    "SecurityGroupId" : "String",
    "Direction" : "String",
    "Ethertype" : "String",
    "Protocol" : "String",
    "PortRangeMin" : "Integer",
    "PortRangeMax" : "Integer",
    "RemoteIpPrefix" : "String",
    "RemoteGroupId" : "String",
    "RemoteAddressGroupId" : "String",
    "Description" : "String"
  }
}

```

**YAML**
```yaml
Type: SCP::SecurityGroup::SecurityGroupRule
Properties:
  SecurityGroupId: String
  Direction: String
  Ethertype: String
  Protocol: String
  PortRangeMin: Integer
  PortRangeMax: Integer
  RemoteIpPrefix: String
  RemoteGroupId: String
  RemoteAddressGroupId: String
  Description: String

```

## Properties


### SecurityGroupId

The identifier of the security group that the resource belongs to.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Update requires** | Replacement |






### Direction

The direction of the traffic the rule applies to.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Allowed values** | ingress \| egress |
| **Update requires** | Replacement |






### Ethertype

The Ethernet protocol type the rule applies to.

| Attribute | Value |
|-----------|-------|
| **Required** | Yes |
| **Type** | String |
| **Allowed values** | IPv4 |
| **Update requires** | Replacement |






### Protocol

The network protocol the rule applies to.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### PortRangeMin

The minimum port number of the rule's port range.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Integer |
| **Update requires** | Replacement |






### PortRangeMax

The maximum port number of the rule's port range.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | Integer |
| **Update requires** | Replacement |






### RemoteIpPrefix

The remote IP address range the rule applies to in CIDR notation.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### RemoteGroupId

The identifier of the remote security group the rule applies to.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### RemoteAddressGroupId

The identifier of the remote address group the rule applies to.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Update requires** | Replacement |






### Description

A brief explanation or note about this security group rule.

| Attribute | Value |
|-----------|-------|
| **Required** | No |
| **Type** | String |
| **Length constraints** | Max: 255 |
| **Update requires** | Replacement |







## Return Values

### Ref

When you pass the logical ID of this resource to the `Ref` function, Ref returns the value of the **Id**.


### Fn::GetAtt

| Attribute | Description |
|-----------|-------------|
| **SecurityGroupId** | The identifier of the security group that the resource belongs to. |
| **Direction** | The direction of the traffic the rule applies to. |
| **Ethertype** | The Ethernet protocol type the rule applies to. |
| **Protocol** | The network protocol the rule applies to. |
| **PortRangeMin** | The minimum port number of the rule's port range. |
| **PortRangeMax** | The maximum port number of the rule's port range. |
| **RemoteIpPrefix** | The remote IP address range the rule applies to in CIDR notation. |
| **RemoteGroupId** | The identifier of the remote security group the rule applies to. |
| **RemoteAddressGroupId** | The identifier of the remote address group the rule applies to. |
| **Description** | A brief explanation or note about this security group rule. |
| **RemoteGroupName** | The name of the remote security group the rule applies to. |
| **RemoteAddressGroupName** | The name of the remote address group the rule applies to. |
