func DataSourceProcessorCommunityId()

in internal/elasticsearch/ingest/processor_community_id_data_source.go [15:126]


func DataSourceProcessorCommunityId() *schema.Resource {
	processorSchema := map[string]*schema.Schema{
		"id": {
			Description: "Internal identifier of the resource",
			Type:        schema.TypeString,
			Computed:    true,
		},
		"source_ip": {
			Description: "Field containing the source IP address.",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"source_port": {
			Description: "Field containing the source port.",
			Type:        schema.TypeInt,
			Optional:    true,
		},
		"destination_ip": {
			Description: "Field containing the destination IP address.",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"destination_port": {
			Description: "Field containing the destination port.",
			Type:        schema.TypeInt,
			Optional:    true,
		},
		"iana_number": {
			Description: "Field containing the IANA number.",
			Type:        schema.TypeInt,
			Optional:    true,
		},
		"icmp_type": {
			Description: "Field containing the ICMP type.",
			Type:        schema.TypeInt,
			Optional:    true,
		},
		"icmp_code": {
			Description: "Field containing the ICMP code.",
			Type:        schema.TypeInt,
			Optional:    true,
		},
		"seed": {
			Description:  "Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The seed can prevent hash collisions between network domains, such as a staging and production network that use the same addressing scheme.",
			Type:         schema.TypeInt,
			Optional:     true,
			Default:      0,
			ValidateFunc: validation.IntBetween(0, 65535),
		},
		"transport": {
			Description: "Field containing the transport protocol. Used only when the `iana_number` field is not present.",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"target_field": {
			Description: "Output field for the community ID.",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"ignore_missing": {
			Description: "If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.",
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
		},
		"description": {
			Description: "Description of the processor. ",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"if": {
			Description: "Conditionally execute the processor",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"ignore_failure": {
			Description: "Ignore failures for the processor. ",
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
		},
		"on_failure": {
			Description: "Handle failures for the processor.",
			Type:        schema.TypeList,
			Optional:    true,
			MinItems:    1,
			Elem: &schema.Schema{
				Type:             schema.TypeString,
				ValidateFunc:     validation.StringIsJSON,
				DiffSuppressFunc: utils.DiffJsonSuppress,
			},
		},
		"tag": {
			Description: "Identifier for the processor.",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"json": {
			Description: "JSON representation of this data source.",
			Type:        schema.TypeString,
			Computed:    true,
		},
	}

	return &schema.Resource{
		Description: "Computes the Community ID for network flow data as defined in the Community ID Specification. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/community-id-processor.html",

		ReadContext: dataSourceProcessorCommunityIdRead,

		Schema: processorSchema,
	}
}