|
| 1 | +--- |
| 2 | +layout: "sumologic" |
| 3 | +page_title: "SumoLogic: sumologic_metadata_source" |
| 4 | +description: |- |
| 5 | + Provides a Sumologic Metadata (Tag) source. This source allows you to collect tags from EC2 instances running on AWS. |
| 6 | +--- |
| 7 | + |
| 8 | +# sumologic_polling_source |
| 9 | +Provides a Sumologic Metadata (Tag) source. This source allows you to collect tags from EC2 instances running on AWS. |
| 10 | + |
| 11 | +__IMPORTANT:__ The AWS credentials are stored in plain-text in the state. This is a potential security issue. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | +```hcl |
| 15 | +resource "sumologic_metadata_source" "terraform_metadata" { |
| 16 | + name = "Metadata source" |
| 17 | + description = "My description" |
| 18 | + category = "aws/metadata" |
| 19 | + content_type = "AwsMetadata" |
| 20 | + scan_interval = 300000 |
| 21 | + paused = false |
| 22 | + collector_id = "${sumologic_collector.collector.id}" |
| 23 | +
|
| 24 | + authentication { |
| 25 | + type = "AWSRoleBasedAuthentication" |
| 26 | + role_arn = "arn:aws:iam::604066827510:role/cw-role-SumoRole-4AOLS73TGKYI" |
| 27 | + } |
| 28 | +
|
| 29 | + path { |
| 30 | + type = "AwsMetadataPath" |
| 31 | + limit_to_regions = ["us-west-2"] |
| 32 | + limit_to_namespaces = ["AWS/EC2"] |
| 33 | + tag_filters = ["Deploy*,", "!DeployStatus,", "Cluster"] |
| 34 | +} |
| 35 | +
|
| 36 | +resource "sumologic_collector" "collector" { |
| 37 | + name = "my-collector" |
| 38 | + description = "Just testing this" |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +## Argument reference |
| 43 | + |
| 44 | +In addition to the common properties, the following arguments are supported: |
| 45 | + |
| 46 | + - `content_type` - (Required) The content-type of the collected data. For Metadata source this is `AwsMetadata`. Details can be found in the [Sumologic documentation for hosted sources][1]. |
| 47 | + - `scan_interval` - (Required) Time interval in milliseconds of scans for new data. The default is 300000 and the minimum value is 1000 milliseconds. |
| 48 | + - `paused` - (Required) When set to true, the scanner is paused. To disable, set to false. |
| 49 | + - `authentication` - (Required) Authentication details for AWS access. |
| 50 | + + `type` - (Required) Must be either `S3BucketAuthentication` or `AWSRoleBasedAuthentication` |
| 51 | + + `access_key` - (Required) Your AWS access key if using type `S3BucketAuthentication` |
| 52 | + + `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication` |
| 53 | + + `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication` |
| 54 | + - `path` - (Required) The location to scan for new data. |
| 55 | + + `type` - (Required) type of polling source. Only allowed value is `AwsMetadataPath`. |
| 56 | + + `limit_to_regions` - (Optional) List of Amazon regions. |
| 57 | + + `limit_to_namespaces` - List of namespaces. For `AwsMetadataPath` the only valid namespace is `AWS/EC2`. |
| 58 | + + `tag_filters` - (Optional) Leave this field blank to collect all tags configured for the EC2 instance. To collect a subset of tags, follow the instructions in [Define EC2 tag filters][2] |
| 59 | + |
| 60 | +### See also |
| 61 | + * [Sumologic > Sources > Sources for Hosted Collectors > AWS > AWS Metadata (Tag) Source][3] |
| 62 | + * [Common Source Properties][4] |
| 63 | + |
| 64 | +## Attributes Reference |
| 65 | +The following attributes are exported: |
| 66 | + |
| 67 | +- `id` - The internal ID of the source. |
| 68 | +- `url` - The HTTP endpoint to use with [SNS to notify Sumo Logic of new files](https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/Amazon-Web-Services/AWS-S3-Source#Set_up_SNS_in_AWS_(Optional)). |
| 69 | + |
| 70 | +## Import |
| 71 | +Metadata sources can be imported using the collector and source IDs (`collector/source`), e.g.: |
| 72 | + |
| 73 | +```hcl |
| 74 | +terraform import sumologic_metadata_source.test 123/456 |
| 75 | +``` |
| 76 | + |
| 77 | +Metadata sources can be imported using the collector name and source name (`collectorName/sourceName`), e.g.: |
| 78 | + |
| 79 | +```hcl |
| 80 | +terraform import sumologic_metadata_source.test my-test-collector/my-test-source |
| 81 | +``` |
| 82 | + |
| 83 | +[1]: https://help.sumologic.com/Send_Data/Sources/03Use_JSON_to_Configure_Sources/JSON_Parameters_for_Hosted_Sources |
| 84 | +[2]:https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/Amazon-Web-Services/AWS-Metadata-(Tag)-Source#Define_EC2_tag_filters |
| 85 | +[3]:https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/Amazon-Web-Services/AWS-Metadata-(Tag)-Source |
| 86 | +[4]:https://github.com/terraform-providers/terraform-provider-sumologic/tree/master/website#common-source-properties |
0 commit comments