1. Packages
  2. Fastly Provider
  3. API Docs
  4. ServiceDictionaryItems
Viewing docs for Fastly v11.5.0
published on Tuesday, Mar 31, 2026 by Pulumi
fastly logo
Viewing docs for Fastly v11.5.0
published on Tuesday, Mar 31, 2026 by Pulumi

    Defines a map of Fastly dictionary items that can be used to populate a service dictionary. This resource will populate a dictionary with the items and will track their state.

    Note: By default the Terraform provider allows you to externally manage the items via API or UI. If you wish to apply your changes in the HCL, then you should explicitly set the manageItems attribute. An example of this configuration is provided below.

    Limitations

    • writeOnly dictionaries are not supported

    Example Usage

    Terraform >= 0.12.6)

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    const config = new pulumi.Config();
    const mydictName = config.get("mydictName") || "My Dictionary";
    const myservice = new fastly.ServiceVcl("myservice", {
        name: "demofastly",
        domains: [{
            name: "demo.notexample.com",
            comment: "demo",
        }],
        backends: [{
            address: "http-me.fastly.dev",
            name: "Glitch Test Site",
            port: 80,
        }],
        dictionaries: [{
            name: mydictName,
        }],
        forceDestroy: true,
    });
    const items: fastly.ServiceDictionaryItems[] = [];
    myservice.dictionaries.apply(dictionaries => {
        const items: fastly.ServiceDictionaryItems[] = [];
    pulumi.all(.filter(d => d.name == mydictName).reduce((__obj, d) => ({ ...__obj, [d.name]: d }))).apply(rangeBody => {
            for (const range of Object.entries(rangeBody).map(([k, v]) => ({key: k, value: v}))) {
                items.push(new fastly.ServiceDictionaryItems(`items-${range.key}`, {
                    serviceId: myservice.id,
                    dictionaryId: range.value.dictionaryId,
                    items: {
                        key1: "value1",
                        key2: "value2",
                    },
                }));
            }
        });
    });
    
    import pulumi
    import pulumi_fastly as fastly
    
    config = pulumi.Config()
    mydict_name = config.get("mydictName")
    if mydict_name is None:
        mydict_name = "My Dictionary"
    myservice = fastly.ServiceVcl("myservice",
        name="demofastly",
        domains=[{
            "name": "demo.notexample.com",
            "comment": "demo",
        }],
        backends=[{
            "address": "http-me.fastly.dev",
            "name": "Glitch Test Site",
            "port": 80,
        }],
        dictionaries=[{
            "name": mydict_name,
        }],
        force_destroy=True)
    items = []
    def create_items(range_body):
        for range in [{"key": k, "value": v} for [k, v] in enumerate(range_body)]:
            items.append(fastly.ServiceDictionaryItems(f"items-{range['key']}",
                service_id=myservice.id,
                dictionary_id=range["value"].dictionary_id,
                items={
                    "key1": "value1",
                    "key2": "value2",
                }))
    
    myservice.dictionaries.apply(lambda resolved_outputs: create_items({d.name: d for d in resolved_outputs['dictionaries'] if d.name == mydict_name}))
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var mydictName = config.Get("mydictName") ?? "My Dictionary";
        var myservice = new Fastly.ServiceVcl("myservice", new()
        {
            Name = "demofastly",
            Domains = new[]
            {
                new Fastly.Inputs.ServiceVclDomainArgs
                {
                    Name = "demo.notexample.com",
                    Comment = "demo",
                },
            },
            Backends = new[]
            {
                new Fastly.Inputs.ServiceVclBackendArgs
                {
                    Address = "http-me.fastly.dev",
                    Name = "Glitch Test Site",
                    Port = 80,
                },
            },
            Dictionaries = new[]
            {
                new Fastly.Inputs.ServiceVclDictionaryArgs
                {
                    Name = mydictName,
                },
            },
            ForceDestroy = true,
        });
    
        var items = new List<Fastly.ServiceDictionaryItems>();
        foreach (var range in myservice.Dictionaries.Apply(dictionaries => ).Select(pair => new { pair.Key, pair.Value }))
        {
            items.Add(new Fastly.ServiceDictionaryItems($"items-{range.Key}", new()
            {
                ServiceId = myservice.Id,
                DictionaryId = range.Value.DictionaryId,
                Items = 
                {
                    { "key1", "value1" },
                    { "key2", "value2" },
                },
            }));
        }
    });
    
    Example coming soon!
    
    configuration:
      mydictName:
        type: string
        default: My Dictionary
    resources:
      myservice:
        type: fastly:ServiceVcl
        properties:
          name: demofastly
          domains:
            - name: demo.notexample.com
              comment: demo
          backends:
            - address: http-me.fastly.dev
              name: Glitch Test Site
              port: 80
          dictionaries:
            - name: ${mydictName}
          forceDestroy: true
      items:
        type: fastly:ServiceDictionaryItems
        properties:
          serviceId: ${myservice.id}
          dictionaryId: ${range.value.dictionaryId}
          items:
            key1: value1
            key2: value2
        options: {}
    

    Complex object usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    const config = new pulumi.Config();
    const mydict = config.getObject<{items?: Record<string, string>, name?: string}>("mydict") || {
        items: {
            key1: "value1x",
            key2: "value2x",
        },
        name: "My Dictionary",
    };
    const myservice = new fastly.ServiceVcl("myservice", {
        name: "demofastly",
        domains: [{
            name: "demo.notexample.com",
            comment: "demo",
        }],
        backends: [{
            address: "http-me.fastly.dev",
            name: "Glitch Test Site",
            port: 80,
        }],
        dictionaries: [{
            name: mydict.name,
        }],
        forceDestroy: true,
    });
    const items: fastly.ServiceDictionaryItems[] = [];
    myservice.dictionaries.apply(dictionaries => {
        const items: fastly.ServiceDictionaryItems[] = [];
    pulumi.all(.filter(d => d.name == mydict.name).reduce((__obj, d) => ({ ...__obj, [d.name]: d }))).apply(rangeBody => {
            for (const range of Object.entries(rangeBody).map(([k, v]) => ({key: k, value: v}))) {
                items.push(new fastly.ServiceDictionaryItems(`items-${range.key}`, {
                    serviceId: myservice.id,
                    dictionaryId: range.value.dictionaryId,
                    items: mydict.items,
                }));
            }
        });
    });
    
    import pulumi
    import pulumi_fastly as fastly
    
    config = pulumi.Config()
    mydict = config.get_object("mydict")
    if mydict is None:
        mydict = {
            "items": {
                "key1": "value1x",
                "key2": "value2x",
            },
            "name": "My Dictionary",
        }
    myservice = fastly.ServiceVcl("myservice",
        name="demofastly",
        domains=[{
            "name": "demo.notexample.com",
            "comment": "demo",
        }],
        backends=[{
            "address": "http-me.fastly.dev",
            "name": "Glitch Test Site",
            "port": 80,
        }],
        dictionaries=[{
            "name": mydict["name"],
        }],
        force_destroy=True)
    items = []
    def create_items(range_body):
        for range in [{"key": k, "value": v} for [k, v] in enumerate(range_body)]:
            items.append(fastly.ServiceDictionaryItems(f"items-{range['key']}",
                service_id=myservice.id,
                dictionary_id=range["value"].dictionary_id,
                items=mydict["items"]))
    
    myservice.dictionaries.apply(lambda resolved_outputs: create_items({d.name: d for d in resolved_outputs['dictionaries'] if d.name == mydict["name"]}))
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var mydict = config.GetObject<Mydict>("mydict") ?? 
        {
            { "items", 
            {
                { "key1", "value1x" },
                { "key2", "value2x" },
            } },
            { "name", "My Dictionary" },
        };
        var myservice = new Fastly.ServiceVcl("myservice", new()
        {
            Name = "demofastly",
            Domains = new[]
            {
                new Fastly.Inputs.ServiceVclDomainArgs
                {
                    Name = "demo.notexample.com",
                    Comment = "demo",
                },
            },
            Backends = new[]
            {
                new Fastly.Inputs.ServiceVclBackendArgs
                {
                    Address = "http-me.fastly.dev",
                    Name = "Glitch Test Site",
                    Port = 80,
                },
            },
            Dictionaries = new[]
            {
                new Fastly.Inputs.ServiceVclDictionaryArgs
                {
                    Name = mydict.Name,
                },
            },
            ForceDestroy = true,
        });
    
        var items = new List<Fastly.ServiceDictionaryItems>();
        foreach (var range in myservice.Dictionaries.Apply(dictionaries => ).Select(pair => new { pair.Key, pair.Value }))
        {
            items.Add(new Fastly.ServiceDictionaryItems($"items-{range.Key}", new()
            {
                ServiceId = myservice.Id,
                DictionaryId = range.Value.DictionaryId,
                Items = mydict.Items,
            }));
        }
    });
    
    public class Mydict
    {
        public Dictionary<string, string> items { get; set; }
        public string name { get; set; }
    }
    
    Example coming soon!
    
    configuration:
      mydict:
        type: object({items = union(map(string), none), name = union(none, string)})
        default:
          items:
            key1: value1x
            key2: value2x
          name: My Dictionary
    resources:
      myservice:
        type: fastly:ServiceVcl
        properties:
          name: demofastly
          domains:
            - name: demo.notexample.com
              comment: demo
          backends:
            - address: http-me.fastly.dev
              name: Glitch Test Site
              port: 80
          dictionaries:
            - name: ${mydict.name}
          forceDestroy: true
      items:
        type: fastly:ServiceDictionaryItems
        properties:
          serviceId: ${myservice.id}
          dictionaryId: ${range.value.dictionaryId}
          items: ${mydict.items}
        options: {}
    

    Expression and functions usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    import * as std from "@pulumi/std";
    
    const dictionaryName = "My Project Dictionary";
    const hostBase = "demo.ocnotexample.com";
    const hostDivisions = [
        "alpha",
        "beta",
        "gamma",
        "delta",
    ];
    // Define the standard service that will be used to manage the dictionaries.
    const myservice = new fastly.ServiceVcl("myservice", {
        name: "demofastly",
        domains: [{
            name: "demo.ocnotexample.com",
            comment: "demo",
        }],
        backends: [{
            address: "http-me.fastly.dev",
            name: "Glitch Test Site",
            port: 80,
        }],
        dictionaries: [{
            name: dictionaryName,
        }],
        forceDestroy: true,
    });
    // This resource is dynamically creating the items from the local variables through for expressions and functions.
    const project: fastly.ServiceDictionaryItems[] = [];
    myservice.dictionaries.apply(dictionaries => {
        const project: fastly.ServiceDictionaryItems[] = [];
    pulumi.all(.filter(d => d.name == dictionaryName).reduce((__obj, d) => ({ ...__obj, [d.name]: d }))).apply(rangeBody => {
            for (const range of Object.entries(rangeBody).map(([k, v]) => ({key: k, value: v}))) {
                project.push(new fastly.ServiceDictionaryItems(`project-${range.key}`, {
                    serviceId: myservice.id,
                    dictionaryId: range.value.dictionaryId,
                    items: hostDivisions.reduce((__obj, division) => ({ ...__obj, [division]: std.index.format({
                        input: "%s.%s",
                        args: [
                            division,
                            hostBase,
                        ],
                    }).result })),
                }));
            }
        });
    });
    
    import pulumi
    import pulumi_fastly as fastly
    import pulumi_std as std
    
    dictionary_name = "My Project Dictionary"
    host_base = "demo.ocnotexample.com"
    host_divisions = [
        "alpha",
        "beta",
        "gamma",
        "delta",
    ]
    # Define the standard service that will be used to manage the dictionaries.
    myservice = fastly.ServiceVcl("myservice",
        name="demofastly",
        domains=[{
            "name": "demo.ocnotexample.com",
            "comment": "demo",
        }],
        backends=[{
            "address": "http-me.fastly.dev",
            "name": "Glitch Test Site",
            "port": 80,
        }],
        dictionaries=[{
            "name": dictionary_name,
        }],
        force_destroy=True)
    # This resource is dynamically creating the items from the local variables through for expressions and functions.
    project = []
    def create_project(range_body):
        for range in [{"key": k, "value": v} for [k, v] in enumerate(range_body)]:
            project.append(fastly.ServiceDictionaryItems(f"project-{range['key']}",
                service_id=myservice.id,
                dictionary_id=range["value"].dictionary_id,
                items={division: std.index.format(input="%s.%s",
                    args=[
                        division,
                        host_base,
                    ])["result"] for division in host_divisions}))
    
    myservice.dictionaries.apply(lambda resolved_outputs: create_project({d.name: d for d in resolved_outputs['dictionaries'] if d.name == dictionary_name}))
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var dictionaryName = "My Project Dictionary";
    
        var hostBase = "demo.ocnotexample.com";
    
        var hostDivisions = new[]
        {
            "alpha",
            "beta",
            "gamma",
            "delta",
        };
    
        // Define the standard service that will be used to manage the dictionaries.
        var myservice = new Fastly.ServiceVcl("myservice", new()
        {
            Name = "demofastly",
            Domains = new[]
            {
                new Fastly.Inputs.ServiceVclDomainArgs
                {
                    Name = "demo.ocnotexample.com",
                    Comment = "demo",
                },
            },
            Backends = new[]
            {
                new Fastly.Inputs.ServiceVclBackendArgs
                {
                    Address = "http-me.fastly.dev",
                    Name = "Glitch Test Site",
                    Port = 80,
                },
            },
            Dictionaries = new[]
            {
                new Fastly.Inputs.ServiceVclDictionaryArgs
                {
                    Name = dictionaryName,
                },
            },
            ForceDestroy = true,
        });
    
        // This resource is dynamically creating the items from the local variables through for expressions and functions.
        var project = new List<Fastly.ServiceDictionaryItems>();
        foreach (var range in myservice.Dictionaries.Apply(dictionaries => ).Select(pair => new { pair.Key, pair.Value }))
        {
            project.Add(new Fastly.ServiceDictionaryItems($"project-{range.Key}", new()
            {
                ServiceId = myservice.Id,
                DictionaryId = range.Value.DictionaryId,
                Items = hostDivisions.ToDictionary(item => {
                    var division = item.Value;
                    return division;
                }, item => {
                    var division = item.Value;
                    return Std.Index.Format.Invoke(new()
                    {
                        Input = "%s.%s",
                        Args = new[]
                        {
                            division,
                            hostBase,
                        },
                    }).Result;
                }),
            }));
        }
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Terraform >= 0.12.0 && < 0.12.6)

    forEach attributes were not available in Terraform before 0.12.6, however, users can still use for expressions to achieve similar behaviour as seen in the example below.

    Warning: Terraform might not properly calculate implicit dependencies on computed attributes when using for expressions

    For scenarios such as adding a Dictionary to a service and at the same time, creating the Dictionary entries (fastly.ServiceDictionaryItems) resource, Terraform will not calculate implicit dependencies correctly on for expressions. This will result in index lookup problems and the execution will fail.

    For those scenarios, it’s recommended to split the changes into two distinct steps:

    1. Add the dictionary block to the fastly.ServiceVcl and apply the changes
    2. Add the fastly.ServiceDictionaryItems resource with the for expressions to the HCL and apply the changes

    Usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    const config = new pulumi.Config();
    const mydictName = config.get("mydictName") || "My Dictionary";
    const myservice = new fastly.ServiceVcl("myservice", {
        name: "demofastly",
        domains: [{
            name: "demo.notexample.com",
            comment: "demo",
        }],
        dictionaries: [{
            name: mydictName,
        }],
    });
    const items = new fastly.ServiceDictionaryItems("items", {
        serviceId: myservice.id,
        dictionaryId: myservice.dictionaries.apply(dictionaries => .reduce((__obj, s) => ({ ...__obj, [s.name]: s.dictionaryId }))[mydictName]),
        items: {
            key1: "value1",
            key2: "value2",
        },
    });
    
    import pulumi
    import pulumi_fastly as fastly
    
    config = pulumi.Config()
    mydict_name = config.get("mydictName")
    if mydict_name is None:
        mydict_name = "My Dictionary"
    myservice = fastly.ServiceVcl("myservice",
        name="demofastly",
        domains=[{
            "name": "demo.notexample.com",
            "comment": "demo",
        }],
        dictionaries=[{
            "name": mydict_name,
        }])
    items = fastly.ServiceDictionaryItems("items",
        service_id=myservice.id,
        dictionary_id=myservice.dictionaries.apply(lambda dictionaries: {s.name: s.dictionary_id for s in dictionaries}[mydict_name]),
        items={
            "key1": "value1",
            "key2": "value2",
        })
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var mydictName = config.Get("mydictName") ?? "My Dictionary";
        var myservice = new Fastly.ServiceVcl("myservice", new()
        {
            Name = "demofastly",
            Domains = new[]
            {
                new Fastly.Inputs.ServiceVclDomainArgs
                {
                    Name = "demo.notexample.com",
                    Comment = "demo",
                },
            },
            Dictionaries = new[]
            {
                new Fastly.Inputs.ServiceVclDictionaryArgs
                {
                    Name = mydictName,
                },
            },
        });
    
        var items = new Fastly.ServiceDictionaryItems("items", new()
        {
            ServiceId = myservice.Id,
            DictionaryId = myservice.Dictionaries.Apply(dictionaries => .ToDictionary(item => {
                var s = item.Value;
                return s.Name;
            }, item => {
                var s = item.Value;
                return s.DictionaryId;
            })[mydictName]),
            Items = 
            {
                { "key1", "value1" },
                { "key2", "value2" },
            },
        });
    
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Reapplying original items with managedItems if the state of the items drifts

    By default the user is opted out from reapplying the original changes if the items are managed externally. The following example demonstrates how the manageItems field can be used to reapply the changes defined in the HCL if the state of the items drifts. When the value is explicitly set to ’true’, Terraform will keep the original changes and discard any other changes made under this resource outside of Terraform.

    Warning: You will lose externally managed items if manage_items=true.

    Note: The ignoreChanges built-in meta-argument takes precedence over manageItems regardless of its value.

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    //...
    const items: fastly.ServiceDictionaryItems[] = [];
    for (const range of Object.entries(.filter(d => d.name == mydictName).reduce((__obj, d) => ({ ...__obj, [d.name]: d }))).map(([k, v]) => ({key: k, value: v}))) {
        items.push(new fastly.ServiceDictionaryItems(`items-${range.key}`, {
            serviceId: myservice.id,
            dictionaryId: range.value.dictionaryId,
            manageItems: true,
            items: {
                key1: "value1",
                key2: "value2",
            },
        }));
    }
    
    import pulumi
    import pulumi_fastly as fastly
    
    #...
    items = []
    for range in [{"key": k, "value": v} for [k, v] in enumerate({d.name: d for d in myservice.dictionary if d.name == mydict_name})]:
        items.append(fastly.ServiceDictionaryItems(f"items-{range['key']}",
            service_id=myservice["id"],
            dictionary_id=range["value"]["dictionaryId"],
            manage_items=True,
            items={
                "key1": "value1",
                "key2": "value2",
            }))
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        //...
        var items = new List<Fastly.ServiceDictionaryItems>();
        foreach (var range in .ToDictionary(item => {
            var d = item.Value;
            return d.Name;
        }, item => {
            var d = item.Value;
            return d;
        }).Select(pair => new { pair.Key, pair.Value }))
        {
            items.Add(new Fastly.ServiceDictionaryItems($"items-{range.Key}", new()
            {
                ServiceId = myservice.Id,
                DictionaryId = range.Value.DictionaryId,
                ManageItems = true,
                Items = 
                {
                    { "key1", "value1" },
                    { "key2", "value2" },
                },
            }));
        }
    });
    
    Example coming soon!
    
    resources:
      #...
      items:
        type: fastly:ServiceDictionaryItems
        properties:
          serviceId: ${myservice.id}
          dictionaryId: ${range.value.dictionaryId}
          manageItems: true
          items:
            key1: value1
            key2: value2
        options: {}
    

    Create ServiceDictionaryItems Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ServiceDictionaryItems(name: string, args: ServiceDictionaryItemsArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceDictionaryItems(resource_name: str,
                               args: ServiceDictionaryItemsArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceDictionaryItems(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               dictionary_id: Optional[str] = None,
                               service_id: Optional[str] = None,
                               items: Optional[Mapping[str, str]] = None,
                               manage_items: Optional[bool] = None)
    func NewServiceDictionaryItems(ctx *Context, name string, args ServiceDictionaryItemsArgs, opts ...ResourceOption) (*ServiceDictionaryItems, error)
    public ServiceDictionaryItems(string name, ServiceDictionaryItemsArgs args, CustomResourceOptions? opts = null)
    public ServiceDictionaryItems(String name, ServiceDictionaryItemsArgs args)
    public ServiceDictionaryItems(String name, ServiceDictionaryItemsArgs args, CustomResourceOptions options)
    
    type: fastly:ServiceDictionaryItems
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ServiceDictionaryItemsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ServiceDictionaryItemsArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ServiceDictionaryItemsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceDictionaryItemsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceDictionaryItemsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var serviceDictionaryItemsResource = new Fastly.Index.ServiceDictionaryItems("serviceDictionaryItemsResource", new()
    {
        DictionaryId = "string",
        ServiceId = "string",
        Items = 
        {
            { "string", "string" },
        },
        ManageItems = false,
    });
    
    example, err := fastly.NewServiceDictionaryItems(ctx, "serviceDictionaryItemsResource", &fastly.ServiceDictionaryItemsArgs{
    	DictionaryId: pulumi.String("string"),
    	ServiceId:    pulumi.String("string"),
    	Items: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	ManageItems: pulumi.Bool(false),
    })
    
    var serviceDictionaryItemsResource = new ServiceDictionaryItems("serviceDictionaryItemsResource", ServiceDictionaryItemsArgs.builder()
        .dictionaryId("string")
        .serviceId("string")
        .items(Map.of("string", "string"))
        .manageItems(false)
        .build());
    
    service_dictionary_items_resource = fastly.ServiceDictionaryItems("serviceDictionaryItemsResource",
        dictionary_id="string",
        service_id="string",
        items={
            "string": "string",
        },
        manage_items=False)
    
    const serviceDictionaryItemsResource = new fastly.ServiceDictionaryItems("serviceDictionaryItemsResource", {
        dictionaryId: "string",
        serviceId: "string",
        items: {
            string: "string",
        },
        manageItems: false,
    });
    
    type: fastly:ServiceDictionaryItems
    properties:
        dictionaryId: string
        items:
            string: string
        manageItems: false
        serviceId: string
    

    ServiceDictionaryItems Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ServiceDictionaryItems resource accepts the following input properties:

    DictionaryId string
    The ID of the dictionary that the items belong to
    ServiceId string
    The ID of the service that the dictionary belongs to
    Items Dictionary<string, string>
    A map representing an entry in the dictionary, (key/value)
    ManageItems bool
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    DictionaryId string
    The ID of the dictionary that the items belong to
    ServiceId string
    The ID of the service that the dictionary belongs to
    Items map[string]string
    A map representing an entry in the dictionary, (key/value)
    ManageItems bool
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    dictionaryId String
    The ID of the dictionary that the items belong to
    serviceId String
    The ID of the service that the dictionary belongs to
    items Map<String,String>
    A map representing an entry in the dictionary, (key/value)
    manageItems Boolean
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    dictionaryId string
    The ID of the dictionary that the items belong to
    serviceId string
    The ID of the service that the dictionary belongs to
    items {[key: string]: string}
    A map representing an entry in the dictionary, (key/value)
    manageItems boolean
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    dictionary_id str
    The ID of the dictionary that the items belong to
    service_id str
    The ID of the service that the dictionary belongs to
    items Mapping[str, str]
    A map representing an entry in the dictionary, (key/value)
    manage_items bool
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    dictionaryId String
    The ID of the dictionary that the items belong to
    serviceId String
    The ID of the service that the dictionary belongs to
    items Map<String>
    A map representing an entry in the dictionary, (key/value)
    manageItems Boolean
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ServiceDictionaryItems resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ServiceDictionaryItems Resource

    Get an existing ServiceDictionaryItems resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ServiceDictionaryItemsState, opts?: CustomResourceOptions): ServiceDictionaryItems
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dictionary_id: Optional[str] = None,
            items: Optional[Mapping[str, str]] = None,
            manage_items: Optional[bool] = None,
            service_id: Optional[str] = None) -> ServiceDictionaryItems
    func GetServiceDictionaryItems(ctx *Context, name string, id IDInput, state *ServiceDictionaryItemsState, opts ...ResourceOption) (*ServiceDictionaryItems, error)
    public static ServiceDictionaryItems Get(string name, Input<string> id, ServiceDictionaryItemsState? state, CustomResourceOptions? opts = null)
    public static ServiceDictionaryItems get(String name, Output<String> id, ServiceDictionaryItemsState state, CustomResourceOptions options)
    resources:  _:    type: fastly:ServiceDictionaryItems    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DictionaryId string
    The ID of the dictionary that the items belong to
    Items Dictionary<string, string>
    A map representing an entry in the dictionary, (key/value)
    ManageItems bool
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    ServiceId string
    The ID of the service that the dictionary belongs to
    DictionaryId string
    The ID of the dictionary that the items belong to
    Items map[string]string
    A map representing an entry in the dictionary, (key/value)
    ManageItems bool
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    ServiceId string
    The ID of the service that the dictionary belongs to
    dictionaryId String
    The ID of the dictionary that the items belong to
    items Map<String,String>
    A map representing an entry in the dictionary, (key/value)
    manageItems Boolean
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    serviceId String
    The ID of the service that the dictionary belongs to
    dictionaryId string
    The ID of the dictionary that the items belong to
    items {[key: string]: string}
    A map representing an entry in the dictionary, (key/value)
    manageItems boolean
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    serviceId string
    The ID of the service that the dictionary belongs to
    dictionary_id str
    The ID of the dictionary that the items belong to
    items Mapping[str, str]
    A map representing an entry in the dictionary, (key/value)
    manage_items bool
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    service_id str
    The ID of the service that the dictionary belongs to
    dictionaryId String
    The ID of the dictionary that the items belong to
    items Map<String>
    A map representing an entry in the dictionary, (key/value)
    manageItems Boolean
    Whether to reapply changes if the state of the items drifts, i.e. if items are managed externally
    serviceId String
    The ID of the service that the dictionary belongs to

    Import

    Note: The dictionary resource should be empty before importing

    This is an example of the import command being applied to the resource named fastly_service_dictionary_items.items The resource ID is a combined value of the serviceId and dictionaryId separated by a forward slash.

    $ pulumi import fastly:index/serviceDictionaryItems:ServiceDictionaryItems items xxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxx
    

    If Terraform is already managing remote dictionary items against a resource being imported then the user will be asked to remove it from the existing Terraform state. The following is an example of the Terraform state command to remove the resource named fastly_service_dictionary_items.items from the Terraform state file.

    $ terraform state rm fastly_service_dictionary_items.items
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v11.5.0
    published on Tuesday, Mar 31, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.