{
  "typeName" : "AWS::NetworkFirewall::Firewall",
  "description" : "Resource type definition for AWS::NetworkFirewall::Firewall",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-networkfirewall.git",
  "additionalProperties" : false,
  "definitions" : {
    "ResourceArn" : {
      "description" : "A resource ARN.",
      "type" : "string",
      "pattern" : "^arn:aws.*$",
      "minLength" : 1,
      "maxLength" : 256
    },
    "EndpointId" : {
      "description" : "An endpoint Id.",
      "type" : "string"
    },
    "AvailabilityZoneMapping" : {
      "type" : "object",
      "properties" : {
        "AvailabilityZone" : {
          "description" : "A AvailabilityZone",
          "type" : "string"
        }
      },
      "required" : [ "AvailabilityZone" ],
      "additionalProperties" : false
    },
    "SubnetMapping" : {
      "type" : "object",
      "properties" : {
        "SubnetId" : {
          "description" : "A SubnetId.",
          "type" : "string"
        },
        "IPAddressType" : {
          "description" : "A IPAddressType",
          "type" : "string"
        }
      },
      "required" : [ "SubnetId" ],
      "additionalProperties" : false
    },
    "EnabledAnalysisType" : {
      "description" : "An analysis type.",
      "enum" : [ "TLS_SNI", "HTTP_HOST" ],
      "type" : "string"
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 255
        }
      },
      "required" : [ "Value", "Key" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "FirewallName" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 128,
      "pattern" : "^[a-zA-Z0-9-]+$"
    },
    "FirewallArn" : {
      "$ref" : "#/definitions/ResourceArn"
    },
    "FirewallId" : {
      "type" : "string",
      "minLength" : 36,
      "maxLength" : 36,
      "pattern" : "^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$"
    },
    "FirewallPolicyArn" : {
      "$ref" : "#/definitions/ResourceArn"
    },
    "VpcId" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 128,
      "pattern" : "^vpc-[0-9a-f]+$"
    },
    "SubnetMappings" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/SubnetMapping"
      }
    },
    "AvailabilityZoneMappings" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/AvailabilityZoneMapping"
      }
    },
    "DeleteProtection" : {
      "type" : "boolean"
    },
    "SubnetChangeProtection" : {
      "type" : "boolean"
    },
    "AvailabilityZoneChangeProtection" : {
      "type" : "boolean"
    },
    "FirewallPolicyChangeProtection" : {
      "type" : "boolean"
    },
    "TransitGatewayId" : {
      "type" : "string",
      "maxLength" : 128,
      "pattern" : "^tgw-[0-9a-z]+$"
    },
    "TransitGatewayAttachmentId" : {
      "type" : "string",
      "pattern" : "^tgw-attach-[0-9a-z]+$",
      "minLength" : 1,
      "maxLength" : 128
    },
    "Description" : {
      "type" : "string",
      "maxLength" : 512,
      "pattern" : "^.*$"
    },
    "EndpointIds" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/EndpointId"
      }
    },
    "EnabledAnalysisTypes" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/EnabledAnalysisType"
      },
      "description" : "The types of analysis to enable for the firewall. Can be TLS_SNI, HTTP_HOST, or both."
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "network-firewall:TagResource", "network-firewall:UntagResource", "network-firewall:ListTagsForResource" ]
  },
  "required" : [ "FirewallName", "FirewallPolicyArn" ],
  "readOnlyProperties" : [ "/properties/FirewallArn", "/properties/FirewallId", "/properties/TransitGatewayAttachmentId", "/properties/EndpointIds" ],
  "primaryIdentifier" : [ "/properties/FirewallArn" ],
  "createOnlyProperties" : [ "/properties/VpcId", "/properties/FirewallName" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ec2:CreateVpcEndpoint", "ec2:DescribeVpcEndpoints", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "iam:CreateServiceLinkedRole", "network-firewall:CreateFirewall", "network-firewall:DescribeFirewallPolicy", "network-firewall:DescribeRuleGroup", "network-firewall:TagResource", "network-firewall:AssociateSubnets", "network-firewall:AssociateAvailabilityZones", "network-firewall:AssociateFirewallPolicy", "network-firewall:DescribeFirewall" ]
    },
    "read" : {
      "permissions" : [ "network-firewall:DescribeFirewall", "network-firewall:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "network-firewall:AssociateSubnets", "network-firewall:DisassociateSubnets", "network-firewall:UpdateFirewallDescription", "network-firewall:UpdateFirewallDeleteProtection", "network-firewall:UpdateSubnetChangeProtection", "network-firewall:UpdateFirewallPolicyChangeProtection", "network-firewall:AssociateFirewallPolicy", "network-firewall:TagResource", "network-firewall:UntagResource", "network-firewall:DescribeFirewall", "network-firewall:UpdateFirewallAnalysisSettings", "network-firewall:DisassociateAvailabilityZones", "network-firewall:AssociateAvailabilityZones", "network-firewall:UpdateAvailabilityZoneChangeProtection" ]
    },
    "delete" : {
      "permissions" : [ "ec2:DeleteVpcEndpoints", "ec2:DescribeRouteTables", "logs:DescribeLogGroups", "logs:DescribeResourcePolicies", "logs:GetLogDelivery", "logs:ListLogDeliveries", "network-firewall:DeleteFirewall", "network-firewall:UntagResource", "network-firewall:DescribeFirewall" ]
    },
    "list" : {
      "permissions" : [ "network-firewall:ListFirewalls" ]
    }
  }
}