{
  "Description": "(SO0158) - AWS CloudFormation template for deployment of the amazon-cloudwatch-monitoring-framework workload infrastructure. Version v1.1.0",
  "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": {
        "SendAnonymousMetric": "Yes",
        "MetricsEndpoint": "https://metrics.awssolutionsbuilder.com/generic"
      },
      "Solution": {
        "SolutionId": "SO0158",
        "SolutionVersion": "v1.1.0"
      }
    }
  },
  "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": "amazon-cloudwatch-monitoring-framework/v1.1.0/assetfaa55cbfc087c2ceda27184b6e5ddfe20aea5fa820be530301c0c30ec9983cc5.zip"
        },
        "Role": {
          "Fn::GetAtt": [
            "HelperServiceRole21B0A5E5",
            "Arn"
          ]
        },
        "Description": "DO NOT DELETE - CloudWatch Monitoring Framework - helper function",
        "Environment": {
          "Variables": {
            "METRICS_ENDPOINT": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "MetricsEndpoint"
              ]
            },
            "SEND_METRIC": {
              "Fn::FindInMap": [
                "StackMap",
                "Metric",
                "SendAnonymousMetric"
              ]
            },
            "LOG_LEVEL": "info",
            "CUSTOM_SDK_USER_AGENT": {
              "Fn::Join": [
                "",
                [
                  "AwsSolution/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionId"
                    ]
                  },
                  "/",
                  {
                    "Fn::FindInMap": [
                      "StackMap",
                      "Solution",
                      "SolutionVersion"
                    ]
                  }
                ]
              ]
            }
          }
        },
        "Handler": "index.handler",
        "MemorySize": 512,
        "Runtime": "nodejs14.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"
                ]
              }
            }
          ],
          "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": "amazon-cloudwatch-monitoring-framework/v1.1.0/assetc691172cdeefa2c91b5a2907f9d81118e47597634943344795f1a844192dd49c.zip"
        },
        "Role": {
          "Fn::GetAtt": [
            "helperProviderframeworkonEventServiceRoleFA06E8E2",
            "Arn"
          ]
        },
        "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",
        "Runtime": "nodejs14.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": {
        "Type": "StringList",
        "Value": "NOP",
        "Name": {
          "Ref": "SSMParameterName"
        },
        "Tier": "Advanced"
      },
      "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": "amazon-cloudwatch-monitoring-framework/v1.1.0/asset4bb9b1977177cb8b3e9190bc7d09c9968f4a28f68c4408851fb2ee6224f1da02.zip"
        },
        "Role": {
          "Fn::GetAtt": [
            "TagHandlerServiceRole6954614A",
            "Arn"
          ]
        },
        "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",
                "SendAnonymousMetric"
              ]
            },
            "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": "index.handler",
        "MemorySize": 512,
        "Runtime": "nodejs14.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": "amazon-cloudwatch-monitoring-framework/v1.1.0/asset36ef4d7f477cff49c9a450ff957bcdf34d617e61ec87b142485a8618cc4aecb8.zip"
        },
        "Role": {
          "Fn::GetAtt": [
            "DashboardHandlerServiceRoleB33263F6",
            "Arn"
          ]
        },
        "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",
                "SendAnonymousMetric"
              ]
            },
            "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,
        "Runtime": "nodejs14.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/1VPy07DMBD8lt6dLSmVuEIr9cQjpF9g7KVyE9vBuw5CVv4d261QOe3Mamd2poV2s4W71aP8pkbpYZ2UDwjpFYlRH1mqQew/XSeDtMgYCnmR02TcSTwRIeeTUyF774hDVCz2kdjbHsnHoLAIbvFb5ClyQVmhDRvvFlGep1HaDy0hHaJTZV1ubnGHwRqiKjDSQur9eLEvs/OjUT/1rqJF0H0jS0KCGjRz2EU1IO8koSDKDkcOOfuzIf5X8I9kky+C9B4x1k8VLAJndNk29fEaIM9lEaoWb8K1LUEX/Gx0sXFeI5xpPbdbaB9gszqTMU2Ijo1F6C/zF6IAEu+MAQAA"
      },
      "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"
              ]
            }
          ]
        }
      ]
    }
  }
}