---
layout: "fastly"
page_title: "Fastly: fastly_api_security_operations"
sidebar_current: "docs-fastly-datasource-fastly_api_security_operations"
description: |-
  Get API Security operations for a Fastly service.
---

# fastly_api_security_operations

Use this data source to list API Security operations for a Fastly service.

## Example Usage

```terraform
resource "fastly_service_vcl" "svc1" {
  name          = "test-svc-1-example"
  force_destroy = true

  backend {
    address = "example.com"
    name    = "tf-test-backend-1"
  }
}

# Optional: create an operation (so the data source returns something predictable)
resource "fastly_api_security_operation" "example" {
  service_id  = fastly_service_vcl.svc1.id
  method      = "GET"
  domain      = "api.example.com"
  path        = "/v1/things"
  description = "Retrieve things"
}

data "fastly_api_security_operations" "ops" {
  service_id = fastly_service_vcl.svc1.id

  # Optional filters
  method = ["GET"]
  domain = ["api.example.com"]
  path   = "/v1/things"

  depends_on = [fastly_api_security_operation.example]
}

output "api_security_operations" {
  value = data.fastly_api_security_operations.ops.operations
}

output "api_security_operations_total" {
  value = data.fastly_api_security_operations.ops.total
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `service_id` (String) Service ID.

### Optional

- `domain` (Set of String) Filter by one or more domains (exact match).
- `method` (Set of String) Filter by one or more HTTP methods.
- `path` (String) Filter by path (exact match).
- `tag_id` (String) Filter by tag ID.

### Read-Only

- `id` (String) The ID of this resource.
- `operations` (Set of Object) Matching API Security operations. (see [below for nested schema](#nestedatt--operations))
- `total` (Number) Total number of matching results, as returned by the API.

<a id="nestedatt--operations"></a>
### Nested Schema for `operations`

Read-Only:

- `created_at` (String)
- `description` (String)
- `domain` (String)
- `id` (String)
- `last_seen_at` (String)
- `method` (String)
- `path` (String)
- `rps` (Number)
- `status` (String)
- `tag_ids` (Set of String)
- `updated_at` (String)
