{
  "typeName" : "AWS::CodeGuruProfiler::ProfilingGroup",
  "description" : "This resource schema represents the Profiling Group resource in the Amazon CodeGuru Profiler service.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-codeguru-profiler",
  "definitions" : {
    "ProfilingGroupArn" : {
      "type" : "string",
      "pattern" : "^arn:aws([-\\w]*):codeguru-profiler:(([a-z]+-)+[0-9]+):([0-9]{12}):profilingGroup/[^.]+$"
    },
    "IamArn" : {
      "type" : "string",
      "pattern" : "^arn:aws([-\\w]*):iam::([0-9]{12}):[\\S]+$"
    },
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. The allowed characters across services are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length. The allowed characters across services are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Value", "Key" ]
    },
    "ChannelId" : {
      "description" : "Unique identifier for each Channel in the notification configuration of a Profiling Group",
      "type" : "string",
      "pattern" : "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"
    },
    "ChannelUri" : {
      "description" : "Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.",
      "type" : "string",
      "pattern" : "^arn:aws([-\\w]*):[a-z-]+:(([a-z]+-)+[0-9]+)?:([0-9]{12}):[^.]+$"
    },
    "Channel" : {
      "description" : "Notification medium for users to get alerted for events that occur in application profile. We support SNS topic as a notification channel.",
      "type" : "object",
      "required" : [ "channelUri" ],
      "properties" : {
        "channelId" : {
          "$ref" : "#/definitions/ChannelId"
        },
        "channelUri" : {
          "$ref" : "#/definitions/ChannelUri"
        }
      }
    }
  },
  "properties" : {
    "ProfilingGroupName" : {
      "description" : "The name of the profiling group.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 255,
      "pattern" : "^[\\w-]+$"
    },
    "ComputePlatform" : {
      "description" : "The compute platform of the profiling group.",
      "type" : "string",
      "enum" : [ "Default", "AWSLambda" ]
    },
    "AgentPermissions" : {
      "description" : "The agent permissions attached to this profiling group.",
      "type" : "object",
      "additionalProperties" : false,
      "required" : [ "Principals" ],
      "properties" : {
        "Principals" : {
          "description" : "The principals for the agent permissions.",
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/IamArn"
          }
        }
      }
    },
    "AnomalyDetectionNotificationConfiguration" : {
      "description" : "Configuration for Notification Channels for Anomaly Detection feature in CodeGuru Profiler which enables customers to detect anomalies in the application profile for those methods that represent the highest proportion of CPU time or latency",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Channel"
      }
    },
    "Arn" : {
      "description" : "The Amazon Resource Name (ARN) of the specified profiling group.",
      "$ref" : "#/definitions/ProfilingGroupArn",
      "examples" : [ "arn:aws:codeguru-profiler:us-east-1:000000000000:profilingGroup/My-example-profiling-group" ]
    },
    "Tags" : {
      "description" : "The tags associated with a profiling group.",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 50,
      "uniqueItems" : true
    }
  },
  "additionalProperties" : false,
  "required" : [ "ProfilingGroupName" ],
  "primaryIdentifier" : [ "/properties/ProfilingGroupName" ],
  "readOnlyProperties" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/ProfilingGroupName", "/properties/ComputePlatform" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "codeguru-profiler:TagResource", "codeguru-profiler:ListTagsForResource", "codeguru-profiler:UntagResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "sns:Publish", "codeguru-profiler:AddNotificationChannels", "codeguru-profiler:CreateProfilingGroup", "codeguru-profiler:PutPermission", "codeguru-profiler:TagResource" ]
    },
    "read" : {
      "permissions" : [ "codeguru-profiler:DescribeProfilingGroup", "codeguru-profiler:ListTagsForResource", "codeguru-profiler:GetNotificationConfiguration", "codeguru-profiler:GetPolicy" ]
    },
    "update" : {
      "permissions" : [ "sns:Publish", "codeguru-profiler:DescribeProfilingGroup", "codeguru-profiler:AddNotificationChannels", "codeguru-profiler:GetNotificationConfiguration", "codeguru-profiler:RemoveNotificationChannel", "codeguru-profiler:PutPermission", "codeguru-profiler:RemovePermission", "codeguru-profiler:GetPolicy", "codeguru-profiler:TagResource", "codeguru-profiler:UntagResource", "codeguru-profiler:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "codeguru-profiler:DeleteProfilingGroup" ]
    },
    "list" : {
      "permissions" : [ "codeguru-profiler:ListProfilingGroups", "codeguru-profiler:ListTagsForResource", "codeguru-profiler:GetNotificationConfiguration", "codeguru-profiler:GetPolicy" ]
    }
  }
}