1. Packages
  2. Fastly Provider
  3. API Docs
  4. getDictionaries
Fastly v8.11.1 published on Monday, Sep 16, 2024 by Pulumi

fastly.getDictionaries

Explore with Pulumi AI

fastly logo
Fastly v8.11.1 published on Monday, Sep 16, 2024 by Pulumi

    Use this data source to get a list of Fastly dictionaries for the specified service/version.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    const exampleServiceVcl = new fastly.ServiceVcl("example", {
        name: "Example Service",
        domains: [{
            name: "example.com",
        }],
        dictionaries: [
            {
                name: "example_1",
            },
            {
                name: "example_2",
            },
            {
                name: "example_3",
            },
        ],
        forceDestroy: true,
    });
    const example = fastly.getDictionariesOutput({
        serviceId: exampleServiceVcl.id,
        serviceVersion: exampleServiceVcl.activeVersion,
    });
    export const serviceDictionaries = example;
    
    import pulumi
    import pulumi_fastly as fastly
    
    example_service_vcl = fastly.ServiceVcl("example",
        name="Example Service",
        domains=[{
            "name": "example.com",
        }],
        dictionaries=[
            {
                "name": "example_1",
            },
            {
                "name": "example_2",
            },
            {
                "name": "example_3",
            },
        ],
        force_destroy=True)
    example = fastly.get_dictionaries_output(service_id=example_service_vcl.id,
        service_version=example_service_vcl.active_version)
    pulumi.export("serviceDictionaries", example)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-fastly/sdk/v8/go/fastly"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleServiceVcl, err := fastly.NewServiceVcl(ctx, "example", &fastly.ServiceVclArgs{
    			Name: pulumi.String("Example Service"),
    			Domains: fastly.ServiceVclDomainArray{
    				&fastly.ServiceVclDomainArgs{
    					Name: pulumi.String("example.com"),
    				},
    			},
    			Dictionaries: fastly.ServiceVclDictionaryArray{
    				&fastly.ServiceVclDictionaryArgs{
    					Name: pulumi.String("example_1"),
    				},
    				&fastly.ServiceVclDictionaryArgs{
    					Name: pulumi.String("example_2"),
    				},
    				&fastly.ServiceVclDictionaryArgs{
    					Name: pulumi.String("example_3"),
    				},
    			},
    			ForceDestroy: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		example := fastly.GetDictionariesOutput(ctx, fastly.GetDictionariesOutputArgs{
    			ServiceId:      exampleServiceVcl.ID(),
    			ServiceVersion: exampleServiceVcl.ActiveVersion,
    		}, nil)
    		ctx.Export("serviceDictionaries", example)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleServiceVcl = new Fastly.ServiceVcl("example", new()
        {
            Name = "Example Service",
            Domains = new[]
            {
                new Fastly.Inputs.ServiceVclDomainArgs
                {
                    Name = "example.com",
                },
            },
            Dictionaries = new[]
            {
                new Fastly.Inputs.ServiceVclDictionaryArgs
                {
                    Name = "example_1",
                },
                new Fastly.Inputs.ServiceVclDictionaryArgs
                {
                    Name = "example_2",
                },
                new Fastly.Inputs.ServiceVclDictionaryArgs
                {
                    Name = "example_3",
                },
            },
            ForceDestroy = true,
        });
    
        var example = Fastly.GetDictionaries.Invoke(new()
        {
            ServiceId = exampleServiceVcl.Id,
            ServiceVersion = exampleServiceVcl.ActiveVersion,
        });
    
        return new Dictionary<string, object?>
        {
            ["serviceDictionaries"] = example,
        };
    });
    
    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.ServiceVclDomainArgs;
    import com.pulumi.fastly.inputs.ServiceVclDictionaryArgs;
    import com.pulumi.fastly.FastlyFunctions;
    import com.pulumi.fastly.inputs.GetDictionariesArgs;
    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 exampleServiceVcl = new ServiceVcl("exampleServiceVcl", ServiceVclArgs.builder()
                .name("Example Service")
                .domains(ServiceVclDomainArgs.builder()
                    .name("example.com")
                    .build())
                .dictionaries(            
                    ServiceVclDictionaryArgs.builder()
                        .name("example_1")
                        .build(),
                    ServiceVclDictionaryArgs.builder()
                        .name("example_2")
                        .build(),
                    ServiceVclDictionaryArgs.builder()
                        .name("example_3")
                        .build())
                .forceDestroy(true)
                .build());
    
            final var example = FastlyFunctions.getDictionaries(GetDictionariesArgs.builder()
                .serviceId(exampleServiceVcl.id())
                .serviceVersion(exampleServiceVcl.activeVersion())
                .build());
    
            ctx.export("serviceDictionaries", example.applyValue(getDictionariesResult -> getDictionariesResult));
        }
    }
    
    resources:
      exampleServiceVcl:
        type: fastly:ServiceVcl
        name: example
        properties:
          name: Example Service
          domains:
            - name: example.com
          dictionaries:
            - name: example_1
            - name: example_2
            - name: example_3
          forceDestroy: true
    variables:
      example:
        fn::invoke:
          Function: fastly:getDictionaries
          Arguments:
            serviceId: ${exampleServiceVcl.id}
            serviceVersion: ${exampleServiceVcl.activeVersion}
    outputs:
      serviceDictionaries: ${example}
    

    Using getDictionaries

    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 getDictionaries(args: GetDictionariesArgs, opts?: InvokeOptions): Promise<GetDictionariesResult>
    function getDictionariesOutput(args: GetDictionariesOutputArgs, opts?: InvokeOptions): Output<GetDictionariesResult>
    def get_dictionaries(service_id: Optional[str] = None,
                         service_version: Optional[int] = None,
                         opts: Optional[InvokeOptions] = None) -> GetDictionariesResult
    def get_dictionaries_output(service_id: Optional[pulumi.Input[str]] = None,
                         service_version: Optional[pulumi.Input[int]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetDictionariesResult]
    func GetDictionaries(ctx *Context, args *GetDictionariesArgs, opts ...InvokeOption) (*GetDictionariesResult, error)
    func GetDictionariesOutput(ctx *Context, args *GetDictionariesOutputArgs, opts ...InvokeOption) GetDictionariesResultOutput

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

    public static class GetDictionaries 
    {
        public static Task<GetDictionariesResult> InvokeAsync(GetDictionariesArgs args, InvokeOptions? opts = null)
        public static Output<GetDictionariesResult> Invoke(GetDictionariesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDictionariesResult> getDictionaries(GetDictionariesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: fastly:index/getDictionaries:getDictionaries
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ServiceId string
    Alphanumeric string identifying the service.
    ServiceVersion int
    Integer identifying a service version.
    ServiceId string
    Alphanumeric string identifying the service.
    ServiceVersion int
    Integer identifying a service version.
    serviceId String
    Alphanumeric string identifying the service.
    serviceVersion Integer
    Integer identifying a service version.
    serviceId string
    Alphanumeric string identifying the service.
    serviceVersion number
    Integer identifying a service version.
    service_id str
    Alphanumeric string identifying the service.
    service_version int
    Integer identifying a service version.
    serviceId String
    Alphanumeric string identifying the service.
    serviceVersion Number
    Integer identifying a service version.

    getDictionaries Result

    The following output properties are available:

    Dictionaries List<GetDictionariesDictionary>
    List of all dictionaries for the version of the service.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceId string
    Alphanumeric string identifying the service.
    ServiceVersion int
    Integer identifying a service version.
    Dictionaries []GetDictionariesDictionary
    List of all dictionaries for the version of the service.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceId string
    Alphanumeric string identifying the service.
    ServiceVersion int
    Integer identifying a service version.
    dictionaries List<GetDictionariesDictionary>
    List of all dictionaries for the version of the service.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceId String
    Alphanumeric string identifying the service.
    serviceVersion Integer
    Integer identifying a service version.
    dictionaries GetDictionariesDictionary[]
    List of all dictionaries for the version of the service.
    id string
    The provider-assigned unique ID for this managed resource.
    serviceId string
    Alphanumeric string identifying the service.
    serviceVersion number
    Integer identifying a service version.
    dictionaries Sequence[GetDictionariesDictionary]
    List of all dictionaries for the version of the service.
    id str
    The provider-assigned unique ID for this managed resource.
    service_id str
    Alphanumeric string identifying the service.
    service_version int
    Integer identifying a service version.
    dictionaries List<Property Map>
    List of all dictionaries for the version of the service.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceId String
    Alphanumeric string identifying the service.
    serviceVersion Number
    Integer identifying a service version.

    Supporting Types

    GetDictionariesDictionary

    Id string
    Alphanumeric string identifying the Dictionary.
    Name string
    Name for the Dictionary.
    WriteOnly bool
    Indicates if items in the dictionary are readable or not.
    Id string
    Alphanumeric string identifying the Dictionary.
    Name string
    Name for the Dictionary.
    WriteOnly bool
    Indicates if items in the dictionary are readable or not.
    id String
    Alphanumeric string identifying the Dictionary.
    name String
    Name for the Dictionary.
    writeOnly Boolean
    Indicates if items in the dictionary are readable or not.
    id string
    Alphanumeric string identifying the Dictionary.
    name string
    Name for the Dictionary.
    writeOnly boolean
    Indicates if items in the dictionary are readable or not.
    id str
    Alphanumeric string identifying the Dictionary.
    name str
    Name for the Dictionary.
    write_only bool
    Indicates if items in the dictionary are readable or not.
    id String
    Alphanumeric string identifying the Dictionary.
    name String
    Name for the Dictionary.
    writeOnly Boolean
    Indicates if items in the dictionary are readable or not.

    Package Details

    Repository
    Fastly pulumi/pulumi-fastly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fastly Terraform Provider.
    fastly logo
    Fastly v8.11.1 published on Monday, Sep 16, 2024 by Pulumi