Viewing docs for Fastly v12.0.0
published on Monday, Apr 20, 2026 by Pulumi
published on Monday, Apr 20, 2026 by Pulumi
Viewing docs for Fastly v12.0.0
published on Monday, Apr 20, 2026 by Pulumi
published on Monday, Apr 20, 2026 by Pulumi
Use this data source to list API Security operations for a Fastly service.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as fastly from "@pulumi/fastly";
const svc1 = new fastly.ServiceVcl("svc1", {
name: "test-svc-1-example",
forceDestroy: true,
backends: [{
address: "example.com",
name: "tf-test-backend-1",
}],
});
// Optional: create an operation (so the data source returns something predictable)
const example = new fastly.ApiSecurityOperation("example", {
serviceId: svc1.id,
method: "GET",
domain: "api.example.com",
path: "/v1/things",
description: "Retrieve things",
});
const ops = fastly.getApiSecurityOperationsOutput({
serviceId: svc1.id,
methods: ["GET"],
domains: ["api.example.com"],
path: "/v1/things",
});
export const apiSecurityOperations = ops.apply(ops => ops.operations);
export const apiSecurityOperationsTotal = ops.apply(ops => ops.total);
import pulumi
import pulumi_fastly as fastly
svc1 = fastly.ServiceVcl("svc1",
name="test-svc-1-example",
force_destroy=True,
backends=[{
"address": "example.com",
"name": "tf-test-backend-1",
}])
# Optional: create an operation (so the data source returns something predictable)
example = fastly.ApiSecurityOperation("example",
service_id=svc1.id,
method="GET",
domain="api.example.com",
path="/v1/things",
description="Retrieve things")
ops = fastly.get_api_security_operations_output(service_id=svc1.id,
methods=["GET"],
domains=["api.example.com"],
path="/v1/things")
pulumi.export("apiSecurityOperations", ops.operations)
pulumi.export("apiSecurityOperationsTotal", ops.total)
package main
import (
"github.com/pulumi/pulumi-fastly/sdk/v12/go/fastly"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
svc1, err := fastly.NewServiceVcl(ctx, "svc1", &fastly.ServiceVclArgs{
Name: pulumi.String("test-svc-1-example"),
ForceDestroy: pulumi.Bool(true),
Backends: fastly.ServiceVclBackendArray{
&fastly.ServiceVclBackendArgs{
Address: pulumi.String("example.com"),
Name: pulumi.String("tf-test-backend-1"),
},
},
})
if err != nil {
return err
}
// Optional: create an operation (so the data source returns something predictable)
_, err = fastly.NewApiSecurityOperation(ctx, "example", &fastly.ApiSecurityOperationArgs{
ServiceId: svc1.ID(),
Method: pulumi.String("GET"),
Domain: pulumi.String("api.example.com"),
Path: pulumi.String("/v1/things"),
Description: pulumi.String("Retrieve things"),
})
if err != nil {
return err
}
ops := fastly.GetApiSecurityOperationsOutput(ctx, fastly.GetApiSecurityOperationsOutputArgs{
ServiceId: svc1.ID(),
Methods: pulumi.StringArray{
pulumi.String("GET"),
},
Domains: pulumi.StringArray{
pulumi.String("api.example.com"),
},
Path: pulumi.String("/v1/things"),
}, nil)
ctx.Export("apiSecurityOperations", ops.ApplyT(func(ops fastly.GetApiSecurityOperationsResult) ([]fastly.GetApiSecurityOperationsOperation, error) {
return []fastly.GetApiSecurityOperationsOperation(ops.Operations), nil
}).([]fastly.GetApiSecurityOperationsOperationOutput))
ctx.Export("apiSecurityOperationsTotal", ops.ApplyT(func(ops fastly.GetApiSecurityOperationsResult) (*int, error) {
return &ops.Total, nil
}).(pulumi.IntPtrOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fastly = Pulumi.Fastly;
return await Deployment.RunAsync(() =>
{
var svc1 = new Fastly.Index.ServiceVcl("svc1", new()
{
Name = "test-svc-1-example",
ForceDestroy = true,
Backends = new[]
{
new Fastly.Inputs.ServiceVclBackendArgs
{
Address = "example.com",
Name = "tf-test-backend-1",
},
},
});
// Optional: create an operation (so the data source returns something predictable)
var example = new Fastly.Index.ApiSecurityOperation("example", new()
{
ServiceId = svc1.Id,
Method = "GET",
Domain = "api.example.com",
Path = "/v1/things",
Description = "Retrieve things",
});
var ops = Fastly.Index.GetApiSecurityOperations.Invoke(new()
{
ServiceId = svc1.Id,
Methods = new[]
{
"GET",
},
Domains = new[]
{
"api.example.com",
},
Path = "/v1/things",
});
return new Dictionary<string, object?>
{
["apiSecurityOperations"] = ops.Apply(getApiSecurityOperationsResult => getApiSecurityOperationsResult.Operations),
["apiSecurityOperationsTotal"] = ops.Apply(getApiSecurityOperationsResult => getApiSecurityOperationsResult.Total),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.fastly.ServiceVcl;
import com.pulumi.fastly.ServiceVclArgs;
import com.pulumi.fastly.inputs.ServiceVclBackendArgs;
import com.pulumi.fastly.ApiSecurityOperation;
import com.pulumi.fastly.ApiSecurityOperationArgs;
import com.pulumi.fastly.FastlyFunctions;
import com.pulumi.fastly.inputs.GetApiSecurityOperationsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var svc1 = new ServiceVcl("svc1", ServiceVclArgs.builder()
.name("test-svc-1-example")
.forceDestroy(true)
.backends(ServiceVclBackendArgs.builder()
.address("example.com")
.name("tf-test-backend-1")
.build())
.build());
// Optional: create an operation (so the data source returns something predictable)
var example = new ApiSecurityOperation("example", ApiSecurityOperationArgs.builder()
.serviceId(svc1.id())
.method("GET")
.domain("api.example.com")
.path("/v1/things")
.description("Retrieve things")
.build());
final var ops = FastlyFunctions.getApiSecurityOperations(GetApiSecurityOperationsArgs.builder()
.serviceId(svc1.id())
.methods("GET")
.domains("api.example.com")
.path("/v1/things")
.build());
ctx.export("apiSecurityOperations", ops.applyValue(_ops -> _ops.operations()));
ctx.export("apiSecurityOperationsTotal", ops.applyValue(_ops -> _ops.total()));
}
}
resources:
svc1:
type: fastly:ServiceVcl
properties:
name: test-svc-1-example
forceDestroy: true
backends:
- address: example.com
name: tf-test-backend-1
# Optional: create an operation (so the data source returns something predictable)
example:
type: fastly:ApiSecurityOperation
properties:
serviceId: ${svc1.id}
method: GET
domain: api.example.com
path: /v1/things
description: Retrieve things
variables:
ops:
fn::invoke:
function: fastly:getApiSecurityOperations
arguments:
serviceId: ${svc1.id}
methods:
- GET
domains:
- api.example.com
path: /v1/things
outputs:
apiSecurityOperations: ${ops.operations}
apiSecurityOperationsTotal: ${ops.total}
Using getApiSecurityOperations
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getApiSecurityOperations(args: GetApiSecurityOperationsArgs, opts?: InvokeOptions): Promise<GetApiSecurityOperationsResult>
function getApiSecurityOperationsOutput(args: GetApiSecurityOperationsOutputArgs, opts?: InvokeOptions): Output<GetApiSecurityOperationsResult>def get_api_security_operations(domains: Optional[Sequence[str]] = None,
methods: Optional[Sequence[str]] = None,
path: Optional[str] = None,
service_id: Optional[str] = None,
tag_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetApiSecurityOperationsResult
def get_api_security_operations_output(domains: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
methods: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
path: Optional[pulumi.Input[str]] = None,
service_id: Optional[pulumi.Input[str]] = None,
tag_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetApiSecurityOperationsResult]func GetApiSecurityOperations(ctx *Context, args *GetApiSecurityOperationsArgs, opts ...InvokeOption) (*GetApiSecurityOperationsResult, error)
func GetApiSecurityOperationsOutput(ctx *Context, args *GetApiSecurityOperationsOutputArgs, opts ...InvokeOption) GetApiSecurityOperationsResultOutput> Note: This function is named GetApiSecurityOperations in the Go SDK.
public static class GetApiSecurityOperations
{
public static Task<GetApiSecurityOperationsResult> InvokeAsync(GetApiSecurityOperationsArgs args, InvokeOptions? opts = null)
public static Output<GetApiSecurityOperationsResult> Invoke(GetApiSecurityOperationsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetApiSecurityOperationsResult> getApiSecurityOperations(GetApiSecurityOperationsArgs args, InvokeOptions options)
public static Output<GetApiSecurityOperationsResult> getApiSecurityOperations(GetApiSecurityOperationsArgs args, InvokeOptions options)
fn::invoke:
function: fastly:index/getApiSecurityOperations:getApiSecurityOperations
arguments:
# arguments dictionaryThe following arguments are supported:
- service_
id str - Service ID.
- domains Sequence[str]
- Filter by one or more domains (exact match).
- methods Sequence[str]
- Filter by one or more HTTP methods.
- path str
- Filter by path (exact match).
- tag_
id str - Filter by tag ID.
getApiSecurityOperations Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Operations
List<Get
Api Security Operations Operation> - Matching API Security operations.
- Service
Id string - Service ID.
- Total int
- Total number of matching results, as returned by the API.
- Domains List<string>
- Filter by one or more domains (exact match).
- Methods List<string>
- Filter by one or more HTTP methods.
- Path string
- Filter by path (exact match).
- Tag
Id string - Filter by tag ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- Operations
[]Get
Api Security Operations Operation - Matching API Security operations.
- Service
Id string - Service ID.
- Total int
- Total number of matching results, as returned by the API.
- Domains []string
- Filter by one or more domains (exact match).
- Methods []string
- Filter by one or more HTTP methods.
- Path string
- Filter by path (exact match).
- Tag
Id string - Filter by tag ID.
- id String
- The provider-assigned unique ID for this managed resource.
- operations
List<Get
Api Security Operations Operation> - Matching API Security operations.
- service
Id String - Service ID.
- total Integer
- Total number of matching results, as returned by the API.
- domains List<String>
- Filter by one or more domains (exact match).
- methods List<String>
- Filter by one or more HTTP methods.
- path String
- Filter by path (exact match).
- tag
Id String - Filter by tag ID.
- id string
- The provider-assigned unique ID for this managed resource.
- operations
Get
Api Security Operations Operation[] - Matching API Security operations.
- service
Id string - Service ID.
- total number
- Total number of matching results, as returned by the API.
- domains string[]
- Filter by one or more domains (exact match).
- methods string[]
- Filter by one or more HTTP methods.
- path string
- Filter by path (exact match).
- tag
Id string - Filter by tag ID.
- id str
- The provider-assigned unique ID for this managed resource.
- operations
Sequence[Get
Api Security Operations Operation] - Matching API Security operations.
- service_
id str - Service ID.
- total int
- Total number of matching results, as returned by the API.
- domains Sequence[str]
- Filter by one or more domains (exact match).
- methods Sequence[str]
- Filter by one or more HTTP methods.
- path str
- Filter by path (exact match).
- tag_
id str - Filter by tag ID.
- id String
- The provider-assigned unique ID for this managed resource.
- operations List<Property Map>
- Matching API Security operations.
- service
Id String - Service ID.
- total Number
- Total number of matching results, as returned by the API.
- domains List<String>
- Filter by one or more domains (exact match).
- methods List<String>
- Filter by one or more HTTP methods.
- path String
- Filter by path (exact match).
- tag
Id String - Filter by tag ID.
Supporting Types
GetApiSecurityOperationsOperation
- Created
At string - Created timestamp (when present).
- Description string
- Operation description (when present).
- Domain string
- Operation domain.
- Id string
- Operation ID.
- Last
Seen stringAt - Last seen timestamp (when present).
- Method string
- Operation HTTP method.
- Path string
- Operation path.
- Rps double
- Observed requests per second (when present).
- Status string
- Discovery status (when present). One of
DISCOVERED,SAVED, orIGNORED. - Tag
Ids List<string> - Associated operation tag IDs.
- Updated
At string - Updated timestamp (when present).
- Created
At string - Created timestamp (when present).
- Description string
- Operation description (when present).
- Domain string
- Operation domain.
- Id string
- Operation ID.
- Last
Seen stringAt - Last seen timestamp (when present).
- Method string
- Operation HTTP method.
- Path string
- Operation path.
- Rps float64
- Observed requests per second (when present).
- Status string
- Discovery status (when present). One of
DISCOVERED,SAVED, orIGNORED. - Tag
Ids []string - Associated operation tag IDs.
- Updated
At string - Updated timestamp (when present).
- created
At String - Created timestamp (when present).
- description String
- Operation description (when present).
- domain String
- Operation domain.
- id String
- Operation ID.
- last
Seen StringAt - Last seen timestamp (when present).
- method String
- Operation HTTP method.
- path String
- Operation path.
- rps Double
- Observed requests per second (when present).
- status String
- Discovery status (when present). One of
DISCOVERED,SAVED, orIGNORED. - tag
Ids List<String> - Associated operation tag IDs.
- updated
At String - Updated timestamp (when present).
- created
At string - Created timestamp (when present).
- description string
- Operation description (when present).
- domain string
- Operation domain.
- id string
- Operation ID.
- last
Seen stringAt - Last seen timestamp (when present).
- method string
- Operation HTTP method.
- path string
- Operation path.
- rps number
- Observed requests per second (when present).
- status string
- Discovery status (when present). One of
DISCOVERED,SAVED, orIGNORED. - tag
Ids string[] - Associated operation tag IDs.
- updated
At string - Updated timestamp (when present).
- created_
at str - Created timestamp (when present).
- description str
- Operation description (when present).
- domain str
- Operation domain.
- id str
- Operation ID.
- last_
seen_ strat - Last seen timestamp (when present).
- method str
- Operation HTTP method.
- path str
- Operation path.
- rps float
- Observed requests per second (when present).
- status str
- Discovery status (when present). One of
DISCOVERED,SAVED, orIGNORED. - tag_
ids Sequence[str] - Associated operation tag IDs.
- updated_
at str - Updated timestamp (when present).
- created
At String - Created timestamp (when present).
- description String
- Operation description (when present).
- domain String
- Operation domain.
- id String
- Operation ID.
- last
Seen StringAt - Last seen timestamp (when present).
- method String
- Operation HTTP method.
- path String
- Operation path.
- rps Number
- Observed requests per second (when present).
- status String
- Discovery status (when present). One of
DISCOVERED,SAVED, orIGNORED. - tag
Ids List<String> - Associated operation tag IDs.
- updated
At String - Updated timestamp (when present).
Package Details
- Repository
- Fastly pulumi/pulumi-fastly
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
fastlyTerraform Provider.
Viewing docs for Fastly v12.0.0
published on Monday, Apr 20, 2026 by Pulumi
published on Monday, Apr 20, 2026 by Pulumi
