{
  "Description": "(SO0158-Workload) - AWS CloudFormation template for deployment of the application-monitoring-with-amazon-cloudwatch workload infrastructure. Version v1.2.6",
  "AWSTemplateFormatVersion": "2010-09-09",
  "Metadata": {
    "AWS::CloudFormation::Interface": {
      "ParameterGroups": [
        {
          "Label": {
            "default": "Workload Configuration"
          },
          "Parameters": [
            "WorkloadName",
            "TagSchema",
            "DashboardName",
            "AccessLogGroup",
            "SSMParameterName"
          ]
        }
      ],
      "ParameterLabels": {
        "WorkloadName": {
          "default": "Workload Name"
        },
        "TagSchema": {
          "default": "Tag Schema"
        },
        "DashboardName": {
          "default": "CW Dashboard Name"
        },
        "AccessLogGroup": {
          "default": "Access Log Group"
        },
        "SSMParameterName": {
          "default": "SSM Parameter Name"
        }
      }
    }
  },
  "Parameters": {
    "WorkloadName": {
      "Type": "String",
      "AllowedValues": [
        "Apache",
        "Nginx",
        "Puma"
      ],
      "Description": "Name of the workload"
    },
    "TagSchema": {
      "Type": "String",
      "Description": "EC2 tag schema to identify workload instances. for eg. {\"Key\":\"CW-Dashboard\",\"Value\":\"Apache\"}"
    },
    "DashboardName": {
      "Type": "String",
      "Description": "Region will be appended to the name. for eg. ApacheDashboard-us-east-1"
    },
    "AccessLogGroup": {
      "Type": "String",
      "Description": "CloudWatch Log Group where instances push their access logs"
    },
    "SSMParameterName": {
      "Type": "String",
      "Description": "SSM parameter used for maintaining workload instance list"
    }
  },
  "Mappings": {
    "StackMap": {
      "Metric": {
        "SendAnonymizedMetric": "Yes",
        "MetricsEndpoint": "https://metrics.awssolutionsbuilder.com/generic"
      },
      "Solution": {
        "SolutionId": "SO0158",
        "SolutionVersion": "v1.2.6"
      }
    }
  },
  "Resources": {
    "HelperServiceRole21B0A5E5": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "AssumeRolePolicyDocument": {
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                "Service": "lambda.amazonaws.com"
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "ManagedPolicyArns": [
          {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
              ]
            ]
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/Helper/ServiceRole/Resource"
      }
    },
    "HelperD4411AF3": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Code": {
          "S3Bucket": {
            "Fn::Sub": "solutions-${AWS::Region}"
          },
          "S3Key": "application-monitoring-with-amazon-cloudwatch/v1.2.6/asset4bf219959be0b39aaecc18b6e412846cf5d75e9967641577556390182f0f710f.zip"
        },
        "Description": "DO NOT DELETE - CloudWatch Monitoring Framework - helper function",
        "Environment": {
          "Variables": {
            "METRICS_ENDPOINT": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "MetricsEndpoint"
              ]
            },
            "SEND_METRIC": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "SendAnonymizedMetric"
              ]
            },
            "LOG_LEVEL": "info",
            "CUSTOM_SDK_USER_AGENT": {
              "Fn::Join": [
                "",
                [
                  "AwsSolution/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionId"
                    ]
                  },
                  "/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionVersion"
                    ]
                  }
                ]
              ]
            }
          }
        },
        "Handler": "HelperIndex.handler",
        "MemorySize": 512,
        "Role": {
          "Fn::GetAtt": [
            "HelperServiceRole21B0A5E5",
            "Arn"
          ]
        },
        "Runtime": "nodejs18.x"
      },
      "DependsOn": [
        "HelperServiceRole21B0A5E5"
      ],
      "Metadata": {
        "cfn_nag": {
          "rules_to_suppress": [
            {
              "id": "W58",
              "reason": "CloudWatch logs write permissions added with managed role AWSLambdaBasicExecutionRole"
            },
            {
              "id": "W89",
              "reason": "Not valid use case to deploy Lambda in VPC"
            },
            {
              "id": "W92",
              "reason": "Not valid use case for ReservedConcurrentExecutions"
            }
          ]
        }
      }
    },
    "helperPolicy08B4DDB1": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": "cloudwatch:DeleteDashboards",
              "Effect": "Allow",
              "Resource": {
                "Fn::Join": [
                  "",
                  [
                    "arn:",
                    {
                      "Ref": "AWS::Partition"
                    },
                    ":cloudwatch::",
                    {
                      "Ref": "AWS::AccountId"
                    },
                    ":dashboard/",
                    {
                      "Ref": "DashboardName"
                    },
                    "-",
                    {
                      "Ref": "AWS::Region"
                    }
                  ]
                ]
              },
              "Sid": "CWWrite"
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "helperPolicy08B4DDB1",
        "Roles": [
          {
            "Ref": "HelperServiceRole21B0A5E5"
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/helperPolicy/Resource"
      }
    },
    "helperProviderframeworkonEventServiceRoleFA06E8E2": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "AssumeRolePolicyDocument": {
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                "Service": "lambda.amazonaws.com"
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "ManagedPolicyArns": [
          {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
              ]
            ]
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/helperProvider/framework-onEvent/ServiceRole/Resource"
      }
    },
    "helperProviderframeworkonEventServiceRoleDefaultPolicy0DFC22B9": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": "lambda:InvokeFunction",
              "Effect": "Allow",
              "Resource": [
                {
                  "Fn::GetAtt": [
                    "HelperD4411AF3",
                    "Arn"
                  ]
                },
                {
                  "Fn::Join": [
                    "",
                    [
                      {
                        "Fn::GetAtt": [
                          "HelperD4411AF3",
                          "Arn"
                        ]
                      },
                      ":*"
                    ]
                  ]
                }
              ]
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "helperProviderframeworkonEventServiceRoleDefaultPolicy0DFC22B9",
        "Roles": [
          {
            "Ref": "helperProviderframeworkonEventServiceRoleFA06E8E2"
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/helperProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource"
      }
    },
    "helperProviderframeworkonEvent35A99430": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Code": {
          "S3Bucket": {
            "Fn::Sub": "solutions-${AWS::Region}"
          },
          "S3Key": "application-monitoring-with-amazon-cloudwatch/v1.2.6/asset7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip"
        },
        "Description": "AWS CDK resource provider framework - onEvent (CW-Monitoring-Framework-Stack/Apache-Stack/helperProvider)",
        "Environment": {
          "Variables": {
            "USER_ON_EVENT_FUNCTION_ARN": {
              "Fn::GetAtt": [
                "HelperD4411AF3",
                "Arn"
              ]
            }
          }
        },
        "Handler": "framework.onEvent",
        "Role": {
          "Fn::GetAtt": [
            "helperProviderframeworkonEventServiceRoleFA06E8E2",
            "Arn"
          ]
        },
        "Runtime": "nodejs18.x",
        "Timeout": 900
      },
      "DependsOn": [
        "helperProviderframeworkonEventServiceRoleDefaultPolicy0DFC22B9",
        "helperProviderframeworkonEventServiceRoleFA06E8E2"
      ],
      "Metadata": {
        "cfn_nag": {
          "rules_to_suppress": [
            {
              "id": "W58",
              "reason": "CloudWatch logs write permissions added with managed role AWSLambdaBasicExecutionRole"
            },
            {
              "id": "W89",
              "reason": "Not valid use case to deploy Lambda in VPC"
            },
            {
              "id": "W92",
              "reason": "Not valid use case for ReservedConcurrentExecutions"
            }
          ]
        }
      }
    },
    "CreateUUID": {
      "Type": "Custom::CreateUUID",
      "Properties": {
        "ServiceToken": {
          "Fn::GetAtt": [
            "helperProviderframeworkonEvent35A99430",
            "Arn"
          ]
        }
      },
      "UpdateReplacePolicy": "Delete",
      "DeletionPolicy": "Delete",
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/CreateUUID/Default"
      }
    },
    "LaunchData": {
      "Type": "Custom::LaunchData",
      "Properties": {
        "ServiceToken": {
          "Fn::GetAtt": [
            "helperProviderframeworkonEvent35A99430",
            "Arn"
          ]
        },
        "SolutionId": {
          "Fn::FindInMap": [
            "StackMap",
            "Solution",
            "SolutionId"
          ]
        },
        "SolutionVersion": {
          "Fn::FindInMap": [
            "StackMap",
            "Solution",
            "SolutionVersion"
          ]
        },
        "SolutionUuid": {
          "Fn::GetAtt": [
            "CreateUUID",
            "UUID"
          ]
        },
        "Stack": {
          "Fn::Join": [
            "",
            [
              {
                "Ref": "WorkloadName"
              },
              "-Stack"
            ]
          ]
        }
      },
      "UpdateReplacePolicy": "Delete",
      "DeletionPolicy": "Delete",
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/LaunchData/Default"
      }
    },
    "DeleteDeployment": {
      "Type": "Custom::DeleteDeployment",
      "Properties": {
        "ServiceToken": {
          "Fn::GetAtt": [
            "helperProviderframeworkonEvent35A99430",
            "Arn"
          ]
        },
        "DashboardName": {
          "Fn::Join": [
            "",
            [
              {
                "Ref": "DashboardName"
              },
              "-",
              {
                "Ref": "AWS::Region"
              }
            ]
          ]
        }
      },
      "UpdateReplacePolicy": "Delete",
      "DeletionPolicy": "Delete",
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/DeleteDeployment/Default"
      }
    },
    "SSMParameter33C7AB85": {
      "Type": "AWS::SSM::Parameter",
      "Properties": {
        "Name": {
          "Ref": "SSMParameterName"
        },
        "Tier": "Advanced",
        "Type": "StringList",
        "Value": "NOP"
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/SSMParameter/Resource"
      }
    },
    "dlq09C78ACC": {
      "Type": "AWS::SQS::Queue",
      "Properties": {
        "KmsMasterKeyId": "alias/aws/sqs"
      },
      "UpdateReplacePolicy": "Delete",
      "DeletionPolicy": "Delete",
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/dlq/Resource"
      }
    },
    "TagHandlerServiceRole6954614A": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "AssumeRolePolicyDocument": {
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                "Service": "lambda.amazonaws.com"
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "ManagedPolicyArns": [
          {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
              ]
            ]
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/TagHandler/ServiceRole/Resource"
      }
    },
    "TagHandlerServiceRoleDefaultPolicy7F6375CB": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": "sqs:SendMessage",
              "Effect": "Allow",
              "Resource": {
                "Fn::GetAtt": [
                  "dlq09C78ACC",
                  "Arn"
                ]
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "TagHandlerServiceRoleDefaultPolicy7F6375CB",
        "Roles": [
          {
            "Ref": "TagHandlerServiceRole6954614A"
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/TagHandler/ServiceRole/DefaultPolicy/Resource"
      }
    },
    "TagHandlerE89DBFCE": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Code": {
          "S3Bucket": {
            "Fn::Sub": "solutions-${AWS::Region}"
          },
          "S3Key": "application-monitoring-with-amazon-cloudwatch/v1.2.6/asset812b3e018b2509d89cb5d4bb2f507ea8bb875fb37b3492193d93922ad4fdd9e3.zip"
        },
        "DeadLetterConfig": {
          "TargetArn": {
            "Fn::GetAtt": [
              "dlq09C78ACC",
              "Arn"
            ]
          }
        },
        "Description": {
          "Fn::Join": [
            "",
            [
              "DO NOT DELETE - CloudWatch Monitoring Framework - ",
              {
                "Ref": "WorkloadName"
              },
              " tag handler function"
            ]
          ]
        },
        "Environment": {
          "Variables": {
            "METRICS_ENDPOINT": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "MetricsEndpoint"
              ]
            },
            "SEND_METRIC": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "SendAnonymizedMetric"
              ]
            },
            "LOG_LEVEL": "info",
            "SSM_PARAMETER": {
              "Ref": "SSMParameter33C7AB85"
            },
            "TAG_SCHEMA": {
              "Ref": "TagSchema"
            },
            "CUSTOM_SDK_USER_AGENT": {
              "Fn::Join": [
                "",
                [
                  "AwsSolution/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionId"
                    ]
                  },
                  "/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionVersion"
                    ]
                  }
                ]
              ]
            }
          }
        },
        "Handler": "TagHandlerIndex.handler",
        "MemorySize": 512,
        "Role": {
          "Fn::GetAtt": [
            "TagHandlerServiceRole6954614A",
            "Arn"
          ]
        },
        "Runtime": "nodejs18.x"
      },
      "DependsOn": [
        "TagHandlerServiceRoleDefaultPolicy7F6375CB",
        "TagHandlerServiceRole6954614A"
      ],
      "Metadata": {
        "cfn_nag": {
          "rules_to_suppress": [
            {
              "id": "W58",
              "reason": "CloudWatch logs write permissions added with managed role AWSLambdaBasicExecutionRole"
            },
            {
              "id": "W89",
              "reason": "Not valid use case to deploy Lambda in VPC"
            },
            {
              "id": "W92",
              "reason": "Not valid use case for ReservedConcurrentExecutions"
            }
          ]
        }
      }
    },
    "tagHandlerPolicy01DEF55B": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": [
                "ssm:PutParameter",
                "ssm:GetParameter"
              ],
              "Effect": "Allow",
              "Resource": {
                "Fn::Join": [
                  "",
                  [
                    "arn:",
                    {
                      "Ref": "AWS::Partition"
                    },
                    ":ssm:",
                    {
                      "Ref": "AWS::Region"
                    },
                    ":",
                    {
                      "Ref": "AWS::AccountId"
                    },
                    ":parameter",
                    {
                      "Ref": "SSMParameter33C7AB85"
                    }
                  ]
                ]
              },
              "Sid": "SSMWrite"
            },
            {
              "Action": "ec2:DescribeTags",
              "Effect": "Allow",
              "Resource": "*",
              "Sid": "EC2Describe"
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "tagHandlerPolicy01DEF55B",
        "Roles": [
          {
            "Ref": "TagHandlerServiceRole6954614A"
          }
        ]
      },
      "Metadata": {
        "cfn_nag": {
          "rules_to_suppress": [
            {
              "id": "W12",
              "reason": "* is required for ec2:DescribeTags, as it does not support resource level permissions"
            }
          ]
        }
      }
    },
    "DashboardHandlerServiceRoleB33263F6": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "AssumeRolePolicyDocument": {
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                "Service": "lambda.amazonaws.com"
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "ManagedPolicyArns": [
          {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
              ]
            ]
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/DashboardHandler/ServiceRole/Resource"
      }
    },
    "DashboardHandlerServiceRoleDefaultPolicy91ADC4AD": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": "sqs:SendMessage",
              "Effect": "Allow",
              "Resource": {
                "Fn::GetAtt": [
                  "dlq09C78ACC",
                  "Arn"
                ]
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "DashboardHandlerServiceRoleDefaultPolicy91ADC4AD",
        "Roles": [
          {
            "Ref": "DashboardHandlerServiceRoleB33263F6"
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/DashboardHandler/ServiceRole/DefaultPolicy/Resource"
      }
    },
    "DashboardHandler5DC2C81F": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Code": {
          "S3Bucket": {
            "Fn::Sub": "solutions-${AWS::Region}"
          },
          "S3Key": "application-monitoring-with-amazon-cloudwatch/v1.2.6/asset8bb66537b6177ef07dd0a629428c50c71372c8ede89bc87e6b6969948f2653b5.zip"
        },
        "DeadLetterConfig": {
          "TargetArn": {
            "Fn::GetAtt": [
              "dlq09C78ACC",
              "Arn"
            ]
          }
        },
        "Description": {
          "Fn::Join": [
            "",
            [
              "DO NOT DELETE - CloudWatch Monitoring Framework - ",
              {
                "Ref": "WorkloadName"
              },
              " dashboard handler function"
            ]
          ]
        },
        "Environment": {
          "Variables": {
            "METRICS_ENDPOINT": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "MetricsEndpoint"
              ]
            },
            "SEND_METRIC": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "SendAnonymizedMetric"
              ]
            },
            "LOG_LEVEL": "info",
            "SSM_PARAMETER": {
              "Ref": "SSMParameter33C7AB85"
            },
            "ACCESS_LOG_GROUP": {
              "Ref": "AccessLogGroup"
            },
            "DASHBOARD_NAME": {
              "Fn::Join": [
                "",
                [
                  {
                    "Ref": "DashboardName"
                  },
                  "-",
                  {
                    "Ref": "AWS::Region"
                  }
                ]
              ]
            },
            "TAG_SCHEMA": {
              "Ref": "TagSchema"
            },
            "WORKLOAD": {
              "Ref": "WorkloadName"
            },
            "START_TIME": "-PT12H",
            "CUSTOM_SDK_USER_AGENT": {
              "Fn::Join": [
                "",
                [
                  "AwsSolution/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionId"
                    ]
                  },
                  "/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionVersion"
                    ]
                  }
                ]
              ]
            }
          }
        },
        "Handler": "index.handler",
        "MemorySize": 512,
        "Role": {
          "Fn::GetAtt": [
            "DashboardHandlerServiceRoleB33263F6",
            "Arn"
          ]
        },
        "Runtime": "nodejs18.x"
      },
      "DependsOn": [
        "DashboardHandlerServiceRoleDefaultPolicy91ADC4AD",
        "DashboardHandlerServiceRoleB33263F6"
      ],
      "Metadata": {
        "cfn_nag": {
          "rules_to_suppress": [
            {
              "id": "W58",
              "reason": "CloudWatch logs write permissions added with managed role AWSLambdaBasicExecutionRole"
            },
            {
              "id": "W89",
              "reason": "Not valid use case to deploy Lambda in VPC"
            },
            {
              "id": "W92",
              "reason": "Not valid use case for ReservedConcurrentExecutions"
            }
          ]
        }
      }
    },
    "dashboardHandlerPolicy3B0479F2": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": "ssm:GetParameter",
              "Effect": "Allow",
              "Resource": {
                "Fn::Join": [
                  "",
                  [
                    "arn:",
                    {
                      "Ref": "AWS::Partition"
                    },
                    ":ssm:",
                    {
                      "Ref": "AWS::Region"
                    },
                    ":",
                    {
                      "Ref": "AWS::AccountId"
                    },
                    ":parameter",
                    {
                      "Ref": "SSMParameter33C7AB85"
                    }
                  ]
                ]
              },
              "Sid": "SSMRead"
            },
            {
              "Action": [
                "cloudwatch:PutDashboard",
                "cloudwatch:DeleteDashboards"
              ],
              "Effect": "Allow",
              "Resource": {
                "Fn::Join": [
                  "",
                  [
                    "arn:",
                    {
                      "Ref": "AWS::Partition"
                    },
                    ":cloudwatch::",
                    {
                      "Ref": "AWS::AccountId"
                    },
                    ":dashboard/",
                    {
                      "Ref": "DashboardName"
                    },
                    "-",
                    {
                      "Ref": "AWS::Region"
                    }
                  ]
                ]
              },
              "Sid": "CWWrite"
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "dashboardHandlerPolicy3B0479F2",
        "Roles": [
          {
            "Ref": "DashboardHandlerServiceRoleB33263F6"
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/dashboardHandlerPolicy/Resource"
      }
    },
    "SSMRuleDEC7BD2D": {
      "Type": "AWS::Events::Rule",
      "Properties": {
        "EventPattern": {
          "source": [
            "aws.ssm"
          ],
          "detail-type": [
            "Parameter Store Change"
          ],
          "detail": {
            "name": [
              {
                "Ref": "SSMParameter33C7AB85"
              }
            ]
          }
        },
        "Name": {
          "Fn::Join": [
            "",
            [
              {
                "Ref": "WorkloadName"
              },
              "-SSMRule"
            ]
          ]
        },
        "State": "ENABLED",
        "Targets": [
          {
            "Arn": {
              "Fn::GetAtt": [
                "DashboardHandler5DC2C81F",
                "Arn"
              ]
            },
            "Id": "Target0"
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/SSMRule/Resource"
      }
    },
    "SSMRuleAllowEventRuleCWMonitoringFrameworkStackApacheStackDashboardHandler14AA3AE3FD1F27D8": {
      "Type": "AWS::Lambda::Permission",
      "Properties": {
        "Action": "lambda:InvokeFunction",
        "FunctionName": {
          "Fn::GetAtt": [
            "DashboardHandler5DC2C81F",
            "Arn"
          ]
        },
        "Principal": "events.amazonaws.com",
        "SourceArn": {
          "Fn::GetAtt": [
            "SSMRuleDEC7BD2D",
            "Arn"
          ]
        }
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/SSMRule/AllowEventRuleCWMonitoringFrameworkStackApacheStackDashboardHandler14AA3AE3"
      }
    },
    "EC2TagRuleF20A23D8": {
      "Type": "AWS::Events::Rule",
      "Properties": {
        "Name": {
          "Fn::Join": [
            "",
            [
              {
                "Ref": "WorkloadName"
              },
              "-EC2TagRule"
            ]
          ]
        },
        "ScheduleExpression": "rate(5 minutes)",
        "State": "ENABLED",
        "Targets": [
          {
            "Arn": {
              "Fn::GetAtt": [
                "TagHandlerE89DBFCE",
                "Arn"
              ]
            },
            "Id": "Target0"
          }
        ]
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/EC2TagRule/Resource"
      }
    },
    "EC2TagRuleAllowEventRuleCWMonitoringFrameworkStackApacheStackTagHandlerDC646994F48FE090": {
      "Type": "AWS::Lambda::Permission",
      "Properties": {
        "Action": "lambda:InvokeFunction",
        "FunctionName": {
          "Fn::GetAtt": [
            "TagHandlerE89DBFCE",
            "Arn"
          ]
        },
        "Principal": "events.amazonaws.com",
        "SourceArn": {
          "Fn::GetAtt": [
            "EC2TagRuleF20A23D8",
            "Arn"
          ]
        }
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/EC2TagRule/AllowEventRuleCWMonitoringFrameworkStackApacheStackTagHandlerDC646994"
      }
    },
    "CDKMetadata": {
      "Type": "AWS::CDK::Metadata",
      "Properties": {
        "Analytics": "v2:deflate64:H4sIAAAAAAAA/1WP3U7DMAyFn2X3qRnrBXDJJnHFT2kfoMpSM3lrkhI7nVDUd0cJ0zSuzmcd28fewNMDrFf6zJUZTtVIe0jvyIJDJ9qc1O7LNTpoi4IhF296msgdlD5zn0Zt94OG9BKdEfIuN9xyg8ESM3m3KNIWUutHzEbRxo9kfkpfoUVx3WtmFIbnLIpr2EZzQtlqRsVsIXUSyB1eieXfWddiUfzNkD4jxpJUYFE4oxOG1MbLAXHEZVEtso/BoCp5nehD/s1EFm/7cDEZmuBnGnJSca5TedENf0SZomTaeTeQlL+dHxCOfDffP8JmDfXqyERViE7IIrR/+guk1UqshgEAAA=="
      },
      "Metadata": {
        "aws:cdk:path": "CW-Monitoring-Framework-Stack/Apache-Stack/CDKMetadata/Default"
      },
      "Condition": "CDKMetadataAvailable"
    }
  },
  "Outputs": {
    "UUID": {
      "Description": "UUID for deployment",
      "Value": {
        "Fn::GetAtt": [
          "CreateUUID",
          "UUID"
        ]
      }
    },
    "Dashboard": {
      "Description": "CloudWatch Dashboard for the workload",
      "Value": {
        "Fn::Join": [
          "",
          [
            {
              "Ref": "DashboardName"
            },
            "-",
            {
              "Ref": "AWS::Region"
            }
          ]
        ]
      }
    }
  },
  "Conditions": {
    "CDKMetadataAvailable": {
      "Fn::Or": [
        {
          "Fn::Or": [
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "af-south-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "ap-east-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "ap-northeast-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "ap-northeast-2"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "ap-south-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "ap-southeast-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "ap-southeast-2"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "ca-central-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "cn-north-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "cn-northwest-1"
              ]
            }
          ]
        },
        {
          "Fn::Or": [
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "eu-central-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "eu-north-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "eu-south-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "eu-west-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "eu-west-2"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "eu-west-3"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "me-south-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "sa-east-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "us-east-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "us-east-2"
              ]
            }
          ]
        },
        {
          "Fn::Or": [
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "us-west-1"
              ]
            },
            {
              "Fn::Equals": [
                {
                  "Ref": "AWS::Region"
                },
                "us-west-2"
              ]
            }
          ]
        }
      ]
    }
  }
}