Skip to content

Commit

Permalink
Merge pull request #188 from SumoLogic/sumo_242311
Browse files Browse the repository at this point in the history
Moved fields into common template from individual child templates
  • Loading branch information
akhil-sumologic authored Jun 13, 2024
2 parents 0ea182f + d6a1808 commit f7fdb36
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 165 deletions.
12 changes: 1 addition & 11 deletions aws-observability/apps/alb/alb_app.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to setup the ALB app with AWS and Sumo Logic resources for AWS Observability Solution."
Description: "Version - v2.9.0: Template to setup the ALB app with AWS and Sumo Logic resources for AWS Observability Solution."

Metadata:
'AWS::CloudFormation::Interface':
Expand Down Expand Up @@ -384,16 +384,6 @@ Resources:
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment

AddLoadBalancerField:
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !Ref Section6aParentStackLambdaARN
FieldName: "loadbalancer"
RemoveOnDeleteStack: false
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment

Outputs:
ExistingMetricSourceName:
Description: "Existing CloudWatch Metrics Source Name"
Expand Down
25 changes: 1 addition & 24 deletions aws-observability/apps/apigateway/api_gateway_app.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to setup the API Gateway app with AWS and Sumo Logic resources for AWS Observability Solution."
Description: "Version - v2.9.0: Template to setup the API Gateway app with AWS and Sumo Logic resources for AWS Observability Solution."

Metadata:
'AWS::CloudFormation::Interface':
Expand Down Expand Up @@ -205,9 +205,6 @@ Resources:
AccessLogsFieldExtractionRule:
Type: Custom::SumoLogicFieldExtractionRule
Condition: create_fer
DependsOn:
- AddApiNameField
- AddApiIdField
Properties:
ServiceToken: !Ref Section4aParentStackLambdaARN
RemoveOnDeleteStack: false
Expand All @@ -234,23 +231,3 @@ Resources:
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment

AddApiNameField:
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !Ref Section4aParentStackLambdaARN
FieldName: "apiname"
RemoveOnDeleteStack: false
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment

AddApiIdField:
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !Ref Section4aParentStackLambdaARN
FieldName: "apiid"
RemoveOnDeleteStack: false
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to setup Auto Enable ALB Access Logging and Lambda Auto Subscribe Log Groups for AWS Observability Solution."
Description: "Version - v2.9.0: Template to setup Auto Enable ALB Access Logging and Lambda Auto Subscribe Log Groups for AWS Observability Solution."

Parameters:
SumoLogicResourceRemoveOnDeleteStack:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to Setup Sumo Logic CloudWatch Metric Source. The template setup CW Metrics Sources for Namespaces."
Description: "Version - v2.9.0: Template to Setup Sumo Logic CloudWatch Metric Source. The template setup CW Metrics Sources for Namespaces."

Parameters:
SumoLogicDeployment:
Expand Down
167 changes: 166 additions & 1 deletion aws-observability/apps/common/resources.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to Setup Sumo Logic Sources and supporting AWS Resources for CloudTrail, ALB, Lambda CloudWatch Logs and CloudWatch Metrics."
Description: "Version - v2.9.0: Template to Setup Sumo Logic Sources and supporting AWS Resources for CloudTrail, ALB, Lambda CloudWatch Logs and CloudWatch Metrics."

Parameters:
SumoLogicDeployment:
Expand Down Expand Up @@ -49,6 +49,15 @@ Parameters:
Description: "Provide the Sumo Logic Account ID for trust relationship."
Default: ""

InstallObservabilityApps:
Type: String
Default: 'Yes'
Description: "Yes - Installs Apps (EC2, Application Load Balancer, RDS, API Gateway, Lambda, Dynamo DB, ECS, ElastiCache and NLB) and Alerts for the Sumo Logic AWS Observability Solution. All the Apps are installed in the folder 'AWS Observability'.
No - Skips the installation of Apps and Alerts."
AllowedValues:
- 'Yes'
- 'No'

CreateMetaDataSource:
Type: String
Description: "Yes - Creates Sumo Logic MetaData Source. A common metadata source will be created with the region selected.
Expand Down Expand Up @@ -247,6 +256,7 @@ Parameters:

Conditions:
# Sources Conditions
install_observability_apps: !Equals [ !Ref InstallObservabilityApps, 'Yes' ]
install_metadata_source: !Equals [ !Ref CreateMetaDataSource, 'Yes' ]
install_cloud_watch_metric_source: !Equals [ !Ref CreateCloudWatchMetricsSource, 'Yes' ]
install_alb_logs_source: !Equals [ !Ref CreateALBLogSource, 'Yes' ]
Expand Down Expand Up @@ -883,6 +893,161 @@ Resources:
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# ALB App
AddLoadBalancerField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "loadbalancer"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# Dynamodb App
AddTableNameField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "tablename"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# ELb App
AddLoadBalancerNameField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "loadbalancername"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# Lambda App
AddFunctionNameField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "functionname"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# EC2 App
AddInstanceIdField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "instanceid"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# RDS App
AddDBIdentifierField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "dbidentifier"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# Elastic App
AddCacheClusterIdField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "cacheclusterid"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# API gateway App
AddApiNameField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "apiname"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# API gateway App
AddApiIdField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "apiid"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# SNS App
AddTopicNameField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "topicname"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# SQS App
AddQueueNameField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "queuename"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# ECS App
AddClusterNameField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "clustername"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment

# NLB App
AddNETLoadBalancerField:
Condition: install_observability_apps
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !GetAtt LambdaHelper.Arn
FieldName: "networkloadbalancer"
RemoveOnDeleteStack: false
SumoAccessID: !Ref SumoLogicAccessID
SumoAccessKey: !Ref SumoLogicAccessKey
SumoDeployment: !Ref SumoLogicDeployment
############# START - RESOURCES FOR METADATA SOURCE #################

SumoLogicMetaDataSource:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: "Version - v2.8.0: The Template should be deployed in Master account. This template setup the Lambda trigger for new account created using AWS Control Tower Account Factory process. The Lambda install the AWS Observability CF template on the regions of new AWS account using stack Sets."
Description: "Version - v2.9.0: The Template should be deployed in Master account. This template setup the Lambda trigger for new account created using AWS Control Tower Account Factory process. The Lambda install the AWS Observability CF template on the regions of new AWS account using stack Sets."

Globals:
Function:
Expand Down Expand Up @@ -212,7 +212,7 @@ Resources:
from botocore.exceptions import ClientError
name = 'SUMO-LOGIC-AWS-OBSERVABILITY'
templateURL = "https://sumologic-appdev-aws-sam-apps.s3.amazonaws.com/aws-observability-versions/v2.8.0/sumologic_observability.master.template.yaml"
templateURL = "https://sumologic-appdev-aws-sam-apps.s3.amazonaws.com/aws-observability-versions/v2.9.0/sumologic_observability.master.template.yaml"
ALL = ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"]
Expand Down
12 changes: 1 addition & 11 deletions aws-observability/apps/dynamodb/dynamodb_app.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to setup the DynamoDB app with AWS and Sumo Logic resources for AWS Observability Solution."
Description: "Version - v2.9.0: Template to setup the DynamoDB app with AWS and Sumo Logic resources for AWS Observability Solution."

Metadata:
'AWS::CloudFormation::Interface':
Expand Down Expand Up @@ -200,13 +200,3 @@ Resources:
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment

AddTableNameField:
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !Ref Section4aParentStackLambdaARN
FieldName: "tablename"
RemoveOnDeleteStack: false
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment
12 changes: 1 addition & 11 deletions aws-observability/apps/ec2metrics/ec2_metrics_app.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to setup the EC2 Metrics app with AWS and Sumo Logic resources for AWS Observability Solution."
Description: "Version - v2.9.0: Template to setup the EC2 Metrics app with AWS and Sumo Logic resources for AWS Observability Solution."

Metadata:
AWS::CloudFormation::Interface:
Expand Down Expand Up @@ -265,13 +265,3 @@ Resources:
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment
orgid: !Ref Section1eOrgId

AddInstanceIdField:
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !Ref Section3aParentStackLambdaARN
FieldName: "instanceid"
RemoveOnDeleteStack: false
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment
12 changes: 1 addition & 11 deletions aws-observability/apps/ecs/ecs_app.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to setup the ECS app with AWS and Sumo Logic resources for AWS Observability Solution."
Description: "Version - v2.9.0: Template to setup the ECS app with AWS and Sumo Logic resources for AWS Observability Solution."

Metadata:
'AWS::CloudFormation::Interface':
Expand Down Expand Up @@ -161,16 +161,6 @@ Conditions:

Resources:

AddClusterNameField:
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !Ref Section4aParentStackLambdaARN
FieldName: "clustername"
RemoveOnDeleteStack: false
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment

sumoApp:
Type: Custom::App
Condition: install_app
Expand Down
12 changes: 1 addition & 11 deletions aws-observability/apps/elasticache/elasticache_app.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: "Version - v2.8.0: Template to setup the ElastiCache app with AWS and Sumo Logic resources for AWS Observability Solution."
Description: "Version - v2.9.0: Template to setup the ElastiCache app with AWS and Sumo Logic resources for AWS Observability Solution."

Metadata:
'AWS::CloudFormation::Interface':
Expand Down Expand Up @@ -201,13 +201,3 @@ Resources:
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment

AddCacheClusterIdField:
Type: Custom::SumoLogicFieldsSchema
Properties:
ServiceToken: !Ref Section4aParentStackLambdaARN
FieldName: "cacheclusterid"
RemoveOnDeleteStack: false
SumoAccessID: !Ref Section1bSumoAccessID
SumoAccessKey: !Ref Section1cSumoAccessKey
SumoDeployment: !Ref Section1aSumoDeployment
Loading

0 comments on commit f7fdb36

Please sign in to comment.