From 77d105e29cf8c246a75c1d276273d7f9c142b5c7 Mon Sep 17 00:00:00 2001 From: Yiting Han Date: Wed, 8 Nov 2023 11:35:18 -0800 Subject: [PATCH 1/3] SUMO-227092: Support terraform for azure event hub log source --- CHANGELOG.md | 2 + sumologic/provider.go | 1 + ...mologic_azure_event_hub_log_source_test.go | 188 ++++++++++++++++++ ...source_sumologic_generic_polling_source.go | 58 +++++- sumologic/sumologic_polling_source.go | 6 + .../azure_event_hub_log_source.html.markdown | 57 ++++++ website/docs/r/polling_source.html.markdown | 2 +- 7 files changed, 308 insertions(+), 6 deletions(-) create mode 100644 sumologic/resource_sumologic_azure_event_hub_log_source_test.go create mode 100644 website/docs/r/azure_event_hub_log_source.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f3c505..8b8be947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## 2.27.1 (Unreleased) +FEATURES: +* **New Resource:** sumologic_azure_event_hub_log_source (GH-57X) ## 2.27.0 (September 28, 2023) FEATURES: diff --git a/sumologic/provider.go b/sumologic/provider.go index 2b5df9d6..93c71849 100644 --- a/sumologic/provider.go +++ b/sumologic/provider.go @@ -116,6 +116,7 @@ func Provider() terraform.ResourceProvider { "sumologic_log_search": resourceSumologicLogSearch(), "sumologic_metrics_search": resourceSumologicMetricsSearch(), "sumologic_rum_source": resourceSumologicRumSource(), + "sumologic_azure_event_hub_log_source": resourceSumologicGenericPollingSource(), }, DataSourcesMap: map[string]*schema.Resource{ "sumologic_cse_log_mapping_vendor_product": dataSourceCSELogMappingVendorAndProduct(), diff --git a/sumologic/resource_sumologic_azure_event_hub_log_source_test.go b/sumologic/resource_sumologic_azure_event_hub_log_source_test.go new file mode 100644 index 00000000..076cad58 --- /dev/null +++ b/sumologic/resource_sumologic_azure_event_hub_log_source_test.go @@ -0,0 +1,188 @@ +package sumologic + +import ( + "fmt" + "os" + "strconv" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccSumologicAzureEventHubLogSource_create(t *testing.T) { + var azureEventHubLogSource PollingSource + var collector Collector + cName, cDescription, cCategory := getRandomizedParams() + sName, sDescription, sCategory := getRandomizedParams() + azureEventHubLogResourceName := "sumologic_azure_event_hub_log_source.azure" + testNamespace := os.Getenv("SUMOLOGIC_TEST_NAMESPACE") + testEventHub := os.Getenv("SUMOLOGIC_TEST_EVENT_HUB") + testConsumerGroup := os.Getenv("SUMOLOGIC_TEST_CONSUMER_GROUP") + testRegion := os.Getenv("SUMOLOGIC_TEST_REGION") + testSASKeyName := os.Getenv("SUMOLOGIC_TEST_SAS_KEY_NAME") + testSASKey := os.Getenv("SUMOLOGIC_TEST_SAS_KEY") + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAzureEventHubLogSourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSumologicAzureEventHubLogSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testSASKeyName, testSASKey, testNamespace, testEventHub, testConsumerGroup, testRegion), + Check: resource.ComposeTestCheckFunc( + testAccCheckAzureEventHubLogSourceExists(azureEventHubLogResourceName, &azureEventHubLogSource), + testAccCheckAzureEventHubLogSourceValues(&azureEventHubLogSource, sName, sDescription, sCategory), + testAccCheckCollectorExists("sumologic_collector.test", &collector), + testAccCheckCollectorValues(&collector, cName, cDescription, cCategory, "Etc/UTC", ""), + resource.TestCheckResourceAttrSet(azureEventHubLogResourceName, "id"), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "name", sName), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "description", sDescription), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "category", sCategory), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "content_type", "AzureEventHubLog"), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "path.0.type", "AzureEventHubPath"), + ), + }, + }, + }) +} +func TestAccSumologicAzureEventHubLogSource_update(t *testing.T) { + var azureEventHubLogSource PollingSource + cName, cDescription, cCategory := getRandomizedParams() + sName, sDescription, sCategory := getRandomizedParams() + sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams() + azureEventHubLogResourceName := "sumologic_azure_event_hub_log_source.azure" + testNamespace := os.Getenv("SUMOLOGIC_TEST_NAMESPACE") + testEventHub := os.Getenv("SUMOLOGIC_TEST_EVENT_HUB") + testConsumerGroup := os.Getenv("SUMOLOGIC_TEST_CONSUMER_GROUP") + testRegion := os.Getenv("SUMOLOGIC_TEST_REGION") + testSASKeyName := os.Getenv("SUMOLOGIC_TEST_SAS_KEY_NAME") + testSASKey := os.Getenv("SUMOLOGIC_TEST_SAS_KEY") + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAzureEventHubLogSourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSumologicAzureEventHubLogSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testSASKeyName, testSASKey, testNamespace, testEventHub, testConsumerGroup, testRegion), + Check: resource.ComposeTestCheckFunc( + testAccCheckAzureEventHubLogSourceExists(azureEventHubLogResourceName, &azureEventHubLogSource), + testAccCheckAzureEventHubLogSourceValues(&azureEventHubLogSource, sName, sDescription, sCategory), + resource.TestCheckResourceAttrSet(azureEventHubLogResourceName, "id"), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "name", sName), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "description", sDescription), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "category", sCategory), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "content_type", "AzureEventHubLog"), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "path.0.type", "AzureEventHubPath"), + ), + }, + { + Config: testAccSumologicAzureEventHubLogSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testSASKeyName, testSASKey, testNamespace, testEventHub, testConsumerGroup, testRegion), + Check: resource.ComposeTestCheckFunc( + testAccCheckAzureEventHubLogSourceExists(azureEventHubLogResourceName, &azureEventHubLogSource), + testAccCheckAzureEventHubLogSourceValues(&azureEventHubLogSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated), + resource.TestCheckResourceAttrSet(azureEventHubLogResourceName, "id"), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "name", sNameUpdated), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "description", sDescriptionUpdated), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "category", sCategoryUpdated), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "content_type", "AzureEventHubLog"), + resource.TestCheckResourceAttr(azureEventHubLogResourceName, "path.0.type", "AzureEventHubPath"), + ), + }, + }, + }) +} +func testAccCheckAzureEventHubLogSourceDestroy(s *terraform.State) error { + client := testAccProvider.Meta().(*Client) + for _, rs := range s.RootModule().Resources { + if rs.Type != "sumologic_azure_event_hub_log_source" { + continue + } + if rs.Primary.ID == "" { + return fmt.Errorf("Azure Event Hub Log Source destruction check: Azure Event Hub Log Source ID is not set") + } + id, err := strconv.Atoi(rs.Primary.ID) + if err != nil { + return fmt.Errorf("Encountered an error: " + err.Error()) + } + collectorID, err := strconv.Atoi(rs.Primary.Attributes["collector_id"]) + if err != nil { + return fmt.Errorf("Encountered an error: " + err.Error()) + } + s, err := client.GetPollingSource(collectorID, id) + if err != nil { + return fmt.Errorf("Encountered an error: " + err.Error()) + } + if s != nil { + return fmt.Errorf("Polling Source still exists") + } + } + return nil +} +func testAccCheckAzureEventHubLogSourceExists(n string, pollingSource *PollingSource) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("not found: %s", n) + } + if rs.Primary.ID == "" { + return fmt.Errorf("Polling Source ID is not set") + } + id, err := strconv.Atoi(rs.Primary.ID) + if err != nil { + return fmt.Errorf("Polling Source id should be int; got %s", rs.Primary.ID) + } + collectorID, err := strconv.Atoi(rs.Primary.Attributes["collector_id"]) + if err != nil { + return fmt.Errorf("Encountered an error: " + err.Error()) + } + c := testAccProvider.Meta().(*Client) + pollingSourceResp, err := c.GetPollingSource(collectorID, id) + if err != nil { + return err + } + *pollingSource = *pollingSourceResp + return nil + } +} +func testAccCheckAzureEventHubLogSourceValues(pollingSource *PollingSource, name, description, category string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if pollingSource.Name != name { + return fmt.Errorf("bad name, expected \"%s\", got: %#v", name, pollingSource.Name) + } + if pollingSource.Description != description { + return fmt.Errorf("bad description, expected \"%s\", got: %#v", description, pollingSource.Description) + } + if pollingSource.Category != category { + return fmt.Errorf("bad category, expected \"%s\", got: %#v", category, pollingSource.Category) + } + return nil + } +} +func testAccSumologicAzureEventHubLogSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testSASKeyName, testSASKey, testNamespace, testEventHub, testConsumerGroup, testRegion string) string { + return fmt.Sprintf(` +resource "sumologic_collector" "test" { + name = "%s" + description = "%s" + category = "%s" +} +resource "sumologic_azure_event_hub_log_source" "azure" { + name = "%s" + description = "%s" + category = "%s" + content_type = "AzureEventHubLog" + collector_id = "${sumologic_collector.test.id}" + authentication { + type = "AzureEventHubAuthentication" + shared_access_policy_name = "%s" + shared_access_policy_key = "%s" + } + + path { + type = "AzureEventHubPath" + namespace = "%s" + event_hub_name = "%s" + consumer_group = "%s" + region = "%s" + } +}`, cName, cDescription, cCategory, sName, sDescription, sCategory, testSASKeyName, testSASKey, testNamespace, testEventHub, testConsumerGroup, testRegion) +} diff --git a/sumologic/resource_sumologic_generic_polling_source.go b/sumologic/resource_sumologic_generic_polling_source.go index ad7b4463..558f0dbd 100644 --- a/sumologic/resource_sumologic_generic_polling_source.go +++ b/sumologic/resource_sumologic_generic_polling_source.go @@ -25,18 +25,19 @@ func resourceSumologicGenericPollingSource() *schema.Resource { Required: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{"AwsS3Bucket", "AwsElbBucket", "AwsCloudFrontBucket", - "AwsCloudTrailBucket", "AwsS3AuditBucket", "AwsCloudWatch", "AwsInventory", "AwsXRay", "GcpMetrics", "AwsS3ArchiveBucket"}, false), + "AwsCloudTrailBucket", "AwsS3AuditBucket", "AwsCloudWatch", "AwsInventory", "AwsXRay", "GcpMetrics", "AwsS3ArchiveBucket", "AzureEventHubLog"}, false), } pollingSource.Schema["scan_interval"] = &schema.Schema{ Type: schema.TypeInt, - Required: true, + Optional: true, } pollingSource.Schema["paused"] = &schema.Schema{ Type: schema.TypeBool, - Required: true, + Optional: true, } pollingSource.Schema["url"] = &schema.Schema{ Type: schema.TypeString, + Optional: true, Computed: true, } pollingSource.Schema["authentication"] = &schema.Schema{ @@ -50,7 +51,7 @@ func resourceSumologicGenericPollingSource() *schema.Resource { "type": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"S3BucketAuthentication", "AWSRoleBasedAuthentication", "service_account"}, false), + ValidateFunc: validation.StringInSlice([]string{"S3BucketAuthentication", "AWSRoleBasedAuthentication", "service_account", "AzureEventHubAuthentication"}, false), }, "access_key": { Type: schema.TypeString, @@ -104,6 +105,14 @@ func resourceSumologicGenericPollingSource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "shared_access_policy_name": { + Type: schema.TypeString, + Optional: true, + }, + "shared_access_policy_key": { + Type: schema.TypeString, + Optional: true, + }, }, }, } @@ -119,7 +128,7 @@ func resourceSumologicGenericPollingSource() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{"S3BucketPathExpression", "CloudWatchPath", - "AwsInventoryPath", "AwsXRayPath", "GcpMetricsPath"}, false), + "AwsInventoryPath", "AwsXRayPath", "GcpMetricsPath", "AzureEventHubPath"}, false), }, "bucket_name": { Type: schema.TypeString, @@ -220,6 +229,22 @@ func resourceSumologicGenericPollingSource() *schema.Resource { }, }, }, + "namespace": { + Type: schema.TypeString, + Optional: true, + }, + "event_hub_name": { + Type: schema.TypeString, + Optional: true, + }, + "consumer_group": { + Type: schema.TypeString, + Optional: true, + }, + "region": { + Type: schema.TypeString, + Optional: true, + }, }, }, } @@ -315,6 +340,11 @@ func resourceToGenericPollingSource(d *schema.ResourceData) (PollingSource, erro URL: d.Get("url").(string), } + if source.ContentType == "AzureEventHubLog" { + pollingSource.Paused = false + pollingSource.ScanInterval = 300000 + } + authSettings, errAuthSettings := getPollingAuthentication(d) if errAuthSettings != nil { return pollingSource, errAuthSettings @@ -352,6 +382,10 @@ func getPollingThirdPartyPathAttributes(pollingResource []PollingResource) []map "custom_services": flattenCustomServices(t.Path.CustomServices), "tag_filters": flattenPollingTagFilters(t.Path.TagFilters), "sns_topic_or_subscription_arn": flattenPollingSnsTopicOrSubscriptionArn(t.Path.SnsTopicOrSubscriptionArn), + "namespace": t.Path.Namespace, + "event_hub_name": t.Path.EventHubName, + "consumer_group": t.Path.ConsumerGroup, + "region": t.Path.Region, } s = append(s, mapping) } @@ -378,6 +412,8 @@ func getPollingThirdPartyAuthenticationAttributes(pollingResource []PollingResou "token_uri": t.Authentication.TokenUrl, "auth_provider_x509_cert_url": t.Authentication.AuthProviderX509CertUrl, "client_x509_cert_url": t.Authentication.ClientX509CertUrl, + "shared_access_policy_name": t.Authentication.SharedAccessPolicyName, + "shared_access_policy_key": t.Authentication.SharedAccessPolicyKey, } s = append(s, mapping) } @@ -539,6 +575,10 @@ func getPollingAuthentication(d *schema.ResourceData) (PollingAuthentication, er if err != nil { return authSettings, err } + case "AzureEventHubAuthentication": + authSettings.Type = "AzureEventHubAuthentication" + authSettings.SharedAccessPolicyName = auth["shared_access_policy_name"].(string) + authSettings.SharedAccessPolicyKey = auth["shared_access_policy_key"].(string) default: errorMessage := fmt.Sprintf("[ERROR] Unknown authType: %v", authType) @@ -625,6 +665,14 @@ func getPollingPathSettings(d *schema.ResourceData) (PollingPath, error) { case "GcpMetricsPath": pathSettings.Type = pathType addGcpMetricsPathSettings(&pathSettings, path) + case "AzureEventHubPath": + pathSettings.Type = "AzureEventHubPath" + pathSettings.Namespace = path["namespace"].(string) + pathSettings.EventHubName = path["event_hub_name"].(string) + pathSettings.ConsumerGroup = path["consumer_group"].(string) + if path["region"] != nil { + pathSettings.Region = path["region"].(string) + } default: errorMessage := fmt.Sprintf("[ERROR] Unknown resourceType in path: %v", pathType) log.Print(errorMessage) diff --git a/sumologic/sumologic_polling_source.go b/sumologic/sumologic_polling_source.go index 4765574b..cf367d4e 100644 --- a/sumologic/sumologic_polling_source.go +++ b/sumologic/sumologic_polling_source.go @@ -39,6 +39,8 @@ type PollingAuthentication struct { TokenUrl string `json:"token_uri"` AuthProviderX509CertUrl string `json:"auth_provider_x509_cert_url"` ClientX509CertUrl string `json:"client_x509_cert_url"` + SharedAccessPolicyName string `json:"sharedAccessPolicyName"` + SharedAccessPolicyKey string `json:"sharedAccessPolicyKey"` } type PollingPath struct { @@ -52,6 +54,10 @@ type PollingPath struct { TagFilters []TagFilter `json:"tagFilters,omitempty"` SnsTopicOrSubscriptionArn PollingSnsTopicOrSubscriptionArn `json:"snsTopicOrSubscriptionArn,omitempty"` UseVersionedApi *bool `json:"useVersionedApi,omitempty"` + Namespace string `json:"namespace,omitempty"` + EventHubName string `json:"eventHubName,omitempty"` + ConsumerGroup string `json:"consumerGroup,omitempty"` + Region string `json:"region,omitempty"` } type TagFilter struct { diff --git a/website/docs/r/azure_event_hub_log_source.html.markdown b/website/docs/r/azure_event_hub_log_source.html.markdown new file mode 100644 index 00000000..5244a434 --- /dev/null +++ b/website/docs/r/azure_event_hub_log_source.html.markdown @@ -0,0 +1,57 @@ +--- +layout: "sumologic" +page_title: "SumoLogic: sumologic_azure_event_hub_log_source" +description: |- + Provides a Sumologic Azure Event Hub Log Source. +--- + +# sumologic_azure_event_hub_log_source +Provides a [Sumologic Azure Event Hub Log Source][2]. + +__IMPORTANT:__ The Azure Event Hub credentials are stored in plain-text in the state. This is a potential security issue. + +## Example Usage +```hcl +resource "sumologic_azure_event_hub_log_source" "terraform_azure_event_hub_log_source" { + name = "Azure Event Hub Log Source" + description = "My description" + category = "azure/eventhub" + content_type = "AzureEventHubLog" + collector_id = "${sumologic_collector.collector.id}" + authentication { + type = "AzureEventHubAuthentication" + shared_access_policy_name = "%s" + shared_access_policy_key = "%s" + } + path { + type = "AzureEventHubPath" + namespace = "%s" + event_hub_name = "%s" + consumer_group = "%s" + region = "%s" + } +} +resource "sumologic_collector" "collector" { + name = "my-collector" + description = "Just testing this" +} +``` + +## Argument reference + +In addition to the [Common Source Properties](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs#common-source-properties), the following arguments are supported: + + - `content_type` - (Required) The content-type of the collected data. Details can be found in the [Sumologic documentation for hosted sources][1]. + - `authentication` - (Required) Authentication details for connecting to the S3 bucket. + + `type` - (Required) Must be `AzureEventHubAuthentication`. + + `shared_access_policy_name` - (Required) Your shared access policy key name. + + `shared_access_policy_key` - (Required) Your shared access policy key. + - `path` - (Required) The location to scan for new data. + + `type` - (Required) Must be `AzureEventHubPath`. + + `namespace` - (Required) The namespace of the event hub. + + `event_hub_name` - (Required) The name of the event hub. + + `consumer_group` - (Required) The consumer group of the event hub. + + `region` - (Required) The value must be either "Commercial" for azure or "US Gov" for azure gov. + +[1]: https://help.sumologic.com/Send_Data/Sources/03Use_JSON_to_Configure_Sources/JSON_Parameters_for_Hosted_Sources +[2]: https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/XXX diff --git a/website/docs/r/polling_source.html.markdown b/website/docs/r/polling_source.html.markdown index 6ae4d2e7..a8c770a5 100644 --- a/website/docs/r/polling_source.html.markdown +++ b/website/docs/r/polling_source.html.markdown @@ -2,7 +2,7 @@ layout: "sumologic" page_title: "SumoLogic: sumologic_polling_source" description: |- - Provides a Sumologic Polling source. This source is used to import data from various AWS products. + Provides a Sumologic Polling source. This source is used to import data from various AWS products as well as Azure Event Hub. --- # sumologic_polling_source From f48d0fcc82fa0b8dacb482159ebb3db0e4364f59 Mon Sep 17 00:00:00 2001 From: Yiting Han Date: Wed, 8 Nov 2023 13:35:54 -0800 Subject: [PATCH 2/3] SUMO-227092: update docs --- CHANGELOG.md | 2 +- website/docs/r/azure_event_hub_log_source.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b8be947..e2322bb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.27.1 (Unreleased) FEATURES: -* **New Resource:** sumologic_azure_event_hub_log_source (GH-57X) +* **New Resource:** sumologic_azure_event_hub_log_source (GH-590) ## 2.27.0 (September 28, 2023) FEATURES: diff --git a/website/docs/r/azure_event_hub_log_source.html.markdown b/website/docs/r/azure_event_hub_log_source.html.markdown index 5244a434..b6a0033a 100644 --- a/website/docs/r/azure_event_hub_log_source.html.markdown +++ b/website/docs/r/azure_event_hub_log_source.html.markdown @@ -51,7 +51,7 @@ In addition to the [Common Source Properties](https://registry.terraform.io/prov + `namespace` - (Required) The namespace of the event hub. + `event_hub_name` - (Required) The name of the event hub. + `consumer_group` - (Required) The consumer group of the event hub. - + `region` - (Required) The value must be either "Commercial" for azure or "US Gov" for azure gov. + + `region` - (Optional) The value can be either "Commercial" for azure or "US Gov" for azure gov. Default is for azure. [1]: https://help.sumologic.com/Send_Data/Sources/03Use_JSON_to_Configure_Sources/JSON_Parameters_for_Hosted_Sources [2]: https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/XXX From c42a47abba3768463e46ad1e692f481c1b177031 Mon Sep 17 00:00:00 2001 From: Yiting Han Date: Thu, 9 Nov 2023 11:34:19 -0800 Subject: [PATCH 3/3] SUMO-227092: update documents --- .../r/azure_event_hub_log_source.html.markdown | 15 +++++++-------- website/docs/r/polling_source.html.markdown | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/website/docs/r/azure_event_hub_log_source.html.markdown b/website/docs/r/azure_event_hub_log_source.html.markdown index b6a0033a..f57eeac8 100644 --- a/website/docs/r/azure_event_hub_log_source.html.markdown +++ b/website/docs/r/azure_event_hub_log_source.html.markdown @@ -2,11 +2,11 @@ layout: "sumologic" page_title: "SumoLogic: sumologic_azure_event_hub_log_source" description: |- - Provides a Sumologic Azure Event Hub Log Source. + Provides a Sumologic Azure Event Hub Log Source in Beta. --- # sumologic_azure_event_hub_log_source -Provides a [Sumologic Azure Event Hub Log Source][2]. +Provides a [Sumologic Azure Event Hub Log Source][1]. __IMPORTANT:__ The Azure Event Hub credentials are stored in plain-text in the state. This is a potential security issue. @@ -41,17 +41,16 @@ resource "sumologic_collector" "collector" { In addition to the [Common Source Properties](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs#common-source-properties), the following arguments are supported: - - `content_type` - (Required) The content-type of the collected data. Details can be found in the [Sumologic documentation for hosted sources][1]. - - `authentication` - (Required) Authentication details for connecting to the S3 bucket. + - `content_type` - (Required) Must be `AzureEventHubLog`. + - `authentication` - (Required) Authentication details for connecting to Azure Event Hub. + `type` - (Required) Must be `AzureEventHubAuthentication`. - + `shared_access_policy_name` - (Required) Your shared access policy key name. + + `shared_access_policy_name` - (Required) Your shared access policy name. + `shared_access_policy_key` - (Required) Your shared access policy key. - `path` - (Required) The location to scan for new data. + `type` - (Required) Must be `AzureEventHubPath`. + `namespace` - (Required) The namespace of the event hub. + `event_hub_name` - (Required) The name of the event hub. + `consumer_group` - (Required) The consumer group of the event hub. - + `region` - (Optional) The value can be either "Commercial" for azure or "US Gov" for azure gov. Default is for azure. + + `region` - (Optional) The region of the event hub. The value can be either `Commercial` for Azure, or `US Gov` for Azure Government. Defaults to `Commercial`. -[1]: https://help.sumologic.com/Send_Data/Sources/03Use_JSON_to_Configure_Sources/JSON_Parameters_for_Hosted_Sources -[2]: https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/XXX +[1]: https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/XXX diff --git a/website/docs/r/polling_source.html.markdown b/website/docs/r/polling_source.html.markdown index a8c770a5..ac695853 100644 --- a/website/docs/r/polling_source.html.markdown +++ b/website/docs/r/polling_source.html.markdown @@ -2,7 +2,7 @@ layout: "sumologic" page_title: "SumoLogic: sumologic_polling_source" description: |- - Provides a Sumologic Polling source. This source is used to import data from various AWS products as well as Azure Event Hub. + Provides a Sumologic Polling source. This source is used to import data from various AWS and Azure products. --- # sumologic_polling_source