1. Packages
  2. Fastly Provider
  3. API Docs
  4. getApiSecurityOperationTags
Viewing docs for Fastly v12.0.0
published on Monday, Apr 20, 2026 by Pulumi
fastly logo
Viewing docs for Fastly v12.0.0
published on Monday, Apr 20, 2026 by Pulumi

    Use this data source to list API Security operation tags 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 a tag so the data source returns a predictable result
    const example = new fastly.ApiSecurityOperationTag("example", {
        serviceId: svc1.id,
        name: "example-tag",
        description: "Example tag",
    });
    const tags = fastly.getApiSecurityOperationTagsOutput({
        serviceId: svc1.id,
    });
    export const apiSecurityOperationTags = tags.apply(tags => tags.tags);
    export const apiSecurityOperationTagsTotal = tags.apply(tags => tags.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 a tag so the data source returns a predictable result
    example = fastly.ApiSecurityOperationTag("example",
        service_id=svc1.id,
        name="example-tag",
        description="Example tag")
    tags = fastly.get_api_security_operation_tags_output(service_id=svc1.id)
    pulumi.export("apiSecurityOperationTags", tags.tags)
    pulumi.export("apiSecurityOperationTagsTotal", tags.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 a tag so the data source returns a predictable result
    		_, err = fastly.NewApiSecurityOperationTag(ctx, "example", &fastly.ApiSecurityOperationTagArgs{
    			ServiceId:   svc1.ID(),
    			Name:        pulumi.String("example-tag"),
    			Description: pulumi.String("Example tag"),
    		})
    		if err != nil {
    			return err
    		}
    		tags := fastly.GetApiSecurityOperationTagsOutput(ctx, fastly.GetApiSecurityOperationTagsOutputArgs{
    			ServiceId: svc1.ID(),
    		}, nil)
    		ctx.Export("apiSecurityOperationTags", tags.ApplyT(func(tags fastly.GetApiSecurityOperationTagsResult) ([]fastly.GetApiSecurityOperationTagsTag, error) {
    			return []fastly.GetApiSecurityOperationTagsTag(tags.Tags), nil
    		}).([]fastly.GetApiSecurityOperationTagsTagOutput))
    		ctx.Export("apiSecurityOperationTagsTotal", tags.ApplyT(func(tags fastly.GetApiSecurityOperationTagsResult) (*int, error) {
    			return &tags.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 a tag so the data source returns a predictable result
        var example = new Fastly.Index.ApiSecurityOperationTag("example", new()
        {
            ServiceId = svc1.Id,
            Name = "example-tag",
            Description = "Example tag",
        });
    
        var tags = Fastly.Index.GetApiSecurityOperationTags.Invoke(new()
        {
            ServiceId = svc1.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["apiSecurityOperationTags"] = tags.Apply(getApiSecurityOperationTagsResult => getApiSecurityOperationTagsResult.Tags),
            ["apiSecurityOperationTagsTotal"] = tags.Apply(getApiSecurityOperationTagsResult => getApiSecurityOperationTagsResult.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.ApiSecurityOperationTag;
    import com.pulumi.fastly.ApiSecurityOperationTagArgs;
    import com.pulumi.fastly.FastlyFunctions;
    import com.pulumi.fastly.inputs.GetApiSecurityOperationTagsArgs;
    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 a tag so the data source returns a predictable result
            var example = new ApiSecurityOperationTag("example", ApiSecurityOperationTagArgs.builder()
                .serviceId(svc1.id())
                .name("example-tag")
                .description("Example tag")
                .build());
    
            final var tags = FastlyFunctions.getApiSecurityOperationTags(GetApiSecurityOperationTagsArgs.builder()
                .serviceId(svc1.id())
                .build());
    
            ctx.export("apiSecurityOperationTags", tags.applyValue(_tags -> _tags.tags()));
            ctx.export("apiSecurityOperationTagsTotal", tags.applyValue(_tags -> _tags.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 a tag so the data source returns a predictable result
      example:
        type: fastly:ApiSecurityOperationTag
        properties:
          serviceId: ${svc1.id}
          name: example-tag
          description: Example tag
    variables:
      tags:
        fn::invoke:
          function: fastly:getApiSecurityOperationTags
          arguments:
            serviceId: ${svc1.id}
    outputs:
      apiSecurityOperationTags: ${tags.tags}
      apiSecurityOperationTagsTotal: ${tags.total}
    

    Using getApiSecurityOperationTags

    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 getApiSecurityOperationTags(args: GetApiSecurityOperationTagsArgs, opts?: InvokeOptions): Promise<GetApiSecurityOperationTagsResult>
    function getApiSecurityOperationTagsOutput(args: GetApiSecurityOperationTagsOutputArgs, opts?: InvokeOptions): Output<GetApiSecurityOperationTagsResult>
    def get_api_security_operation_tags(service_id: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetApiSecurityOperationTagsResult
    def get_api_security_operation_tags_output(service_id: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetApiSecurityOperationTagsResult]
    func GetApiSecurityOperationTags(ctx *Context, args *GetApiSecurityOperationTagsArgs, opts ...InvokeOption) (*GetApiSecurityOperationTagsResult, error)
    func GetApiSecurityOperationTagsOutput(ctx *Context, args *GetApiSecurityOperationTagsOutputArgs, opts ...InvokeOption) GetApiSecurityOperationTagsResultOutput

    > Note: This function is named GetApiSecurityOperationTags in the Go SDK.

    public static class GetApiSecurityOperationTags 
    {
        public static Task<GetApiSecurityOperationTagsResult> InvokeAsync(GetApiSecurityOperationTagsArgs args, InvokeOptions? opts = null)
        public static Output<GetApiSecurityOperationTagsResult> Invoke(GetApiSecurityOperationTagsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetApiSecurityOperationTagsResult> getApiSecurityOperationTags(GetApiSecurityOperationTagsArgs args, InvokeOptions options)
    public static Output<GetApiSecurityOperationTagsResult> getApiSecurityOperationTags(GetApiSecurityOperationTagsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: fastly:index/getApiSecurityOperationTags:getApiSecurityOperationTags
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ServiceId string
    Service ID.
    ServiceId string
    Service ID.
    serviceId String
    Service ID.
    serviceId string
    Service ID.
    service_id str
    Service ID.
    serviceId String
    Service ID.

    getApiSecurityOperationTags Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceId string
    Service ID.
    Tags List<GetApiSecurityOperationTagsTag>
    Operation tags.
    Total int
    Total number of matching results, as returned by the API.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceId string
    Service ID.
    Tags []GetApiSecurityOperationTagsTag
    Operation tags.
    Total int
    Total number of matching results, as returned by the API.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceId String
    Service ID.
    tags List<GetApiSecurityOperationTagsTag>
    Operation tags.
    total Integer
    Total number of matching results, as returned by the API.
    id string
    The provider-assigned unique ID for this managed resource.
    serviceId string
    Service ID.
    tags GetApiSecurityOperationTagsTag[]
    Operation tags.
    total number
    Total number of matching results, as returned by the API.
    id str
    The provider-assigned unique ID for this managed resource.
    service_id str
    Service ID.
    tags Sequence[GetApiSecurityOperationTagsTag]
    Operation tags.
    total int
    Total number of matching results, as returned by the API.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceId String
    Service ID.
    tags List<Property Map>
    Operation tags.
    total Number
    Total number of matching results, as returned by the API.

    Supporting Types

    GetApiSecurityOperationTagsTag

    CreatedAt string
    Created timestamp (when present).
    Description string
    Tag description (when present).
    Id string
    Tag ID.
    Name string
    Tag name.
    OperationCount int
    Number of operations associated with this tag (when present).
    UpdatedAt string
    Updated timestamp (when present).
    CreatedAt string
    Created timestamp (when present).
    Description string
    Tag description (when present).
    Id string
    Tag ID.
    Name string
    Tag name.
    OperationCount int
    Number of operations associated with this tag (when present).
    UpdatedAt string
    Updated timestamp (when present).
    createdAt String
    Created timestamp (when present).
    description String
    Tag description (when present).
    id String
    Tag ID.
    name String
    Tag name.
    operationCount Integer
    Number of operations associated with this tag (when present).
    updatedAt String
    Updated timestamp (when present).
    createdAt string
    Created timestamp (when present).
    description string
    Tag description (when present).
    id string
    Tag ID.
    name string
    Tag name.
    operationCount number
    Number of operations associated with this tag (when present).
    updatedAt string
    Updated timestamp (when present).
    created_at str
    Created timestamp (when present).
    description str
    Tag description (when present).
    id str
    Tag ID.
    name str
    Tag name.
    operation_count int
    Number of operations associated with this tag (when present).
    updated_at str
    Updated timestamp (when present).
    createdAt String
    Created timestamp (when present).
    description String
    Tag description (when present).
    id String
    Tag ID.
    name String
    Tag name.
    operationCount Number
    Number of operations associated with this tag (when present).
    updatedAt String
    Updated timestamp (when present).

    Package Details

    Repository
    Fastly pulumi/pulumi-fastly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fastly Terraform Provider.
    fastly logo
    Viewing docs for Fastly v12.0.0
    published on Monday, Apr 20, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.