» nutanix_network_security_rule

Describes a Network security rule

» Example Usage

resource "nutanix_category_key" "test-category-key"{
    name = "TIER-1"
  description = "TIER Category Key"
}


resource "nutanix_category_value" "WEB"{
    name = "${nutanix_category_key.test-category-key.id}"
    description = "WEB Category Value"
   value = "WEB-1"
}

resource "nutanix_category_value" "APP"{
    name = "${nutanix_category_key.test-category-key.id}"
    description = "APP Category Value"
   value = "APP-1"
}

resource "nutanix_category_value" "DB"{
    name = "${nutanix_category_key.test-category-key.id}"
    description = "DB Category Value"
    value = "DB-1"
}

resource "nutanix_category_value" "ashwini"{
    name = "${nutanix_category_key.test-category-key.id}"
    description = "ashwini Category Value"
    value = "ashwini-1"
}


resource "nutanix_network_security_rule" "TEST-TIER" {
  name        = "RULE-1-TIERS"
  description = "rule 1 tiers"

  app_rule_action = "APPLY"

  app_rule_inbound_allow_list = [
    {
      peer_specification_type = "FILTER"
      filter_type             = "CATEGORIES_MATCH_ALL"
      filter_kind_list        = ["vm"]

      filter_params = [
        {
          name   = "${nutanix_category_key.test-category-key.id}"
          values = ["${nutanix_category_value.WEB.id}"]
        },
      ]
    },
  ]

  app_rule_target_group_default_internal_policy = "DENY_ALL"

  app_rule_target_group_peer_specification_type = "FILTER"

  app_rule_target_group_filter_type = "CATEGORIES_MATCH_ALL"

  app_rule_target_group_filter_kind_list = ["vm"]

  app_rule_target_group_filter_params = [
    {
      name   = "${nutanix_category_key.test-category-key.id}"
      values = ["${nutanix_category_value.APP.id}"]
    },
    {
      name   = "${nutanix_category_key.test-category-key.id}"
      values = ["${nutanix_category_value.ashwini.id}"]
    },
  ]

  app_rule_outbound_allow_list = [
    {
      peer_specification_type = "FILTER"
      filter_type             = "CATEGORIES_MATCH_ALL"
      filter_kind_list        = ["vm"]

      filter_params = [
        {
          name   = "${nutanix_category_key.test-category-key.id}"
          values = ["${nutanix_category_value.DB.id}"]
        },
      ]
    },
  ]
}

data "nutanix_network_security_rule" "test" {
  network_security_rule_id = "${nutanix_network_security_rule.TEST-TIER.id}"
}

» Argument Reference

The following arguments are supported:

» Attribute Reference

The following attributes are exported:

The following arguments are supported:

» Metadata

The metadata attribute exports the following:

  • last_update_time: - UTC date and time in RFC-3339 format when image was last updated.
  • UUID: - image UUID.
  • creation_time: - UTC date and time in RFC-3339 format when image was created.
  • spec_version: - Version number of the latest spec.
  • spec_hash: - Hash of the spec. This will be returned from server.
  • name: - image name.

» Categories

The categories attribute supports the following:

  • name: - the key name.
  • value: - value of the key.

» Reference

The project_reference, owner_reference, availability_zone_reference, cluster_reference, attributes supports the following:

  • kind: - The kind name (Default value: project).
  • name: - the name.
  • uuid: - the UUID.

» Version

The version attribute supports the following:

  • product_name: - Name of the producer/distribution of the image. For example windows or red hat.
  • product_version: - Version string for the disk image.

See detailed information in Nutanix Image.