terraform の aws_security_group で同じプロトコル＆ポートで self とか cidr_blocks とか複数指定するとき

`ingress` は `protocol` と `from_port` と `to_port` で一意にしなければいけません。

なので、下記は誤り。

```js
resource "aws_security_group" "test" {
    vpc_id = "${aws_vpc.test.id}"
    name = "test"
    description = "test"
    tags {
        Name = "test"
    }
    ingress {
        protocol = -1
        from_port = 0
        to_port = 0
        self = true
    }
    ingress {
        protocol = -1
        from_port = 0
        to_port = 0
        cidr_blocks = ["192.0.2.123/32"]
    }
    egress {
        protocol = -1
        from_port = 0
        to_port = 0
        cidr_blocks = ["0.0.0.0/0"]
    }
}
```

いちおう、apply すればその通りに作成されますが・・

```
aws_security_group.test: Creating...
  description:                          "" => "test"
  egress.#:                             "" => "1"
  egress.482069346.cidr_blocks.#:       "" => "1"
  egress.482069346.cidr_blocks.0:       "" => "0.0.0.0/0"
  egress.482069346.from_port:           "" => "0"
  egress.482069346.protocol:            "" => "-1"
  egress.482069346.security_groups.#:   "" => "0"
  egress.482069346.self:                "" => "0"
  egress.482069346.to_port:             "" => "0"
  ingress.#:                            "" => "2"
  ingress.1472312197.cidr_blocks.#:     "" => "1"
  ingress.1472312197.cidr_blocks.0:     "" => "192.0.2.123/32"
  ingress.1472312197.from_port:         "" => "0"
  ingress.1472312197.protocol:          "" => "-1"
  ingress.1472312197.security_groups.#: "" => "0"
  ingress.1472312197.self:              "" => "0"
  ingress.1472312197.to_port:           "" => "0"
  ingress.753360330.cidr_blocks.#:      "" => "0"
  ingress.753360330.from_port:          "" => "0"
  ingress.753360330.protocol:           "" => "-1"
  ingress.753360330.security_groups.#:  "" => "0"
  ingress.753360330.self:               "" => "1"
  ingress.753360330.to_port:            "" => "0"
  name:                                 "" => "test"
  owner_id:                             "" => "<computed>"
  tags.#:                               "" => "1"
  tags.Name:                            "" => "test"
  vpc_id:                               "" => "vpc-12345678"
aws_security_group.test: Creation complete
```

もう一回実行しても `1 changed` になります。

```
aws_security_group.test: Modifying...
  ingress.#:                            "1" => "2"
  ingress.1472312197.cidr_blocks.#:     "0" => "1"
  ingress.1472312197.cidr_blocks.0:     "" => "192.0.2.123/32"
  ingress.1472312197.from_port:         "" => "0"
  ingress.1472312197.protocol:          "" => "-1"
  ingress.1472312197.security_groups.#: "0" => "0"
  ingress.1472312197.self:              "" => "0"
  ingress.1472312197.to_port:           "" => "0"
  ingress.3460855338.cidr_blocks.#:     "1" => "0"
  ingress.3460855338.cidr_blocks.0:     "192.0.2.123/32" => ""
  ingress.3460855338.from_port:         "0" => "0"
  ingress.3460855338.protocol:          "-1" => ""
  ingress.3460855338.security_groups.#: "0" => "0"
  ingress.3460855338.self:              "1" => "0"
  ingress.3460855338.to_port:           "0" => "0"
  ingress.753360330.cidr_blocks.#:      "0" => "0"
  ingress.753360330.from_port:          "" => "0"
  ingress.753360330.protocol:           "" => "-1"
  ingress.753360330.security_groups.#:  "0" => "0"
  ingress.753360330.self:               "" => "1"
  ingress.753360330.to_port:            "" => "0"
aws_security_group.test: Modifications complete
```

下記のように、同じプロトコル＆ポートの `self` や `cidr_blocks` は 1 つにまとめる必要があります。

```js
resource "aws_security_group" "test" {
    vpc_id = "${aws_vpc.test.id}"
    name = "test"
    description = "test"
    tags {
        Name = "test"
    }
    ingress {
        protocol = -1
        from_port = 0
        to_port = 0
        self = true
        cidr_blocks = ["192.0.2.123/32"]
    }
    egress {
        protocol = -1
        from_port = 0
        to_port = 0
        cidr_blocks = ["0.0.0.0/0"]
    }
}
```