Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CloudWatch metrics in sumologic polling source #24

Merged
merged 3 commits into from
Jun 16, 2020

Conversation

vsinghal13
Copy link
Collaborator

@vsinghal13 vsinghal13 commented Jun 2, 2020

Sample TF File:

provider "sumologic" {}

provider "aws" {}

resource "sumologic_collector" "collector" {
    name = "MyTFCollector"
}

locals {
  filters = [{
            "type" = "TagFilters"
            "namespace" = "All"
            "tags" = ["k3=v3"]
          },{
            "type" = "TagFilters"
            "namespace" = "AWS/Route53"
            "tags" = ["k1=v1"]
          },{
            "type" = "TagFilters"
            "namespace" = "AWS/S3"
            "tags" = ["k2=v2"]
          }]
}

resource "sumologic_polling_source" "terraform_cw_metrics" {
  name          = "Terraform CW Metrics"
  description   = "My description"
  category      = "aws/terraform_cw"
  content_type  = "AwsCloudWatch"
  scan_interval = 300000
  paused        = false
  collector_id  = "${sumologic_collector.collector.id}"

  authentication {
    type = "AWSRoleBasedAuthentication"
    role_arn = "xxxx"
  }

  path {
    type = "CloudWatchPath"
    limit_to_regions = ["us-west-2"]
    limit_to_namespaces = ["AWS/Route53","AWS/S3","customNamepace"]
  
    dynamic "tag_filters" {
    for_each = local.filters
    content{
      type = tag_filters.value.type
      namespace = tag_filters.value.namespace
      tags = tag_filters.value.tags
    }
    }  
  }
}

@lei-sumo
Copy link

lei-sumo commented Jun 2, 2020

@vsinghal13 This needs to be reviewed by a CloudWatch source SME, Maisie or Yuting.

@vsinghal13
Copy link
Collaborator Author

Unable to tag anyone as reviewers.

"bucket_name": {
Type: schema.TypeString,
Required: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there some kind of validation we would lose in Terraform after making bucket_name and path_expression optional because now we have two path types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not that I know of

Copy link
Contributor

@yuting-liu yuting-liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@seansain
Copy link
Contributor

@vsinghal13 Have you manually tested everything?

@vsinghal13
Copy link
Collaborator Author

@vsinghal13 Have you manually tested everything?

Yes, and @sajain-sumologic will be verifying the same next week.

@vsinghal13 vsinghal13 merged commit a0f4dd2 into master Jun 16, 2020
@seansain seansain deleted the vsinghal-cw-metrics-polling-source branch June 19, 2020 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants