fastly.Configstore
Explore with Pulumi AI
Provides a container that lets you store data in key-value pairs that are accessible to Compute@Edge services during request processing.
In order for a Config Store (fastly.Configstore
) to be accessible to a Compute@Edge service you’ll first need to define a Compute service (fastly.ServiceCompute
) in your configuration, and then create a link to the Config Store from within the service using the resource_link
block (shown in the below examples).
Example Usage
Basic usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fastly = Pulumi.Fastly;
return await Deployment.RunAsync(() =>
{
// IMPORTANT: Deleting a Config Store requires first deleting its resource_link.
// This requires a two-step `pulumi up` as we can't guarantee deletion order.
// e.g. resource_link deletion within fastly_service_compute might not finish first.
var exampleConfigstore = new Fastly.Configstore("exampleConfigstore");
var examplePackageHash = Fastly.GetPackageHash.Invoke(new()
{
Filename = "package.tar.gz",
});
var exampleServiceCompute = new Fastly.ServiceCompute("exampleServiceCompute", new()
{
Domains = new[]
{
new Fastly.Inputs.ServiceComputeDomainArgs
{
Name = "demo.example.com",
},
},
Package = new Fastly.Inputs.ServiceComputePackageArgs
{
Filename = "package.tar.gz",
SourceCodeHash = examplePackageHash.Apply(getPackageHashResult => getPackageHashResult.Hash),
},
ResourceLinks = new[]
{
new Fastly.Inputs.ServiceComputeResourceLinkArgs
{
Name = "my_resource_link",
ResourceId = exampleConfigstore.Id,
},
},
ForceDestroy = true,
});
});
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 {
exampleConfigstore, err := fastly.NewConfigstore(ctx, "exampleConfigstore", nil)
if err != nil {
return err
}
examplePackageHash, err := fastly.GetPackageHash(ctx, &fastly.GetPackageHashArgs{
Filename: pulumi.StringRef("package.tar.gz"),
}, nil)
if err != nil {
return err
}
_, err = fastly.NewServiceCompute(ctx, "exampleServiceCompute", &fastly.ServiceComputeArgs{
Domains: fastly.ServiceComputeDomainArray{
&fastly.ServiceComputeDomainArgs{
Name: pulumi.String("demo.example.com"),
},
},
Package: &fastly.ServiceComputePackageArgs{
Filename: pulumi.String("package.tar.gz"),
SourceCodeHash: *pulumi.String(examplePackageHash.Hash),
},
ResourceLinks: fastly.ServiceComputeResourceLinkArray{
&fastly.ServiceComputeResourceLinkArgs{
Name: pulumi.String("my_resource_link"),
ResourceId: exampleConfigstore.ID(),
},
},
ForceDestroy: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.fastly.Configstore;
import com.pulumi.fastly.FastlyFunctions;
import com.pulumi.fastly.inputs.GetPackageHashArgs;
import com.pulumi.fastly.ServiceCompute;
import com.pulumi.fastly.ServiceComputeArgs;
import com.pulumi.fastly.inputs.ServiceComputeDomainArgs;
import com.pulumi.fastly.inputs.ServiceComputePackageArgs;
import com.pulumi.fastly.inputs.ServiceComputeResourceLinkArgs;
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 exampleConfigstore = new Configstore("exampleConfigstore");
final var examplePackageHash = FastlyFunctions.getPackageHash(GetPackageHashArgs.builder()
.filename("package.tar.gz")
.build());
var exampleServiceCompute = new ServiceCompute("exampleServiceCompute", ServiceComputeArgs.builder()
.domains(ServiceComputeDomainArgs.builder()
.name("demo.example.com")
.build())
.package_(ServiceComputePackageArgs.builder()
.filename("package.tar.gz")
.sourceCodeHash(examplePackageHash.applyValue(getPackageHashResult -> getPackageHashResult.hash()))
.build())
.resourceLinks(ServiceComputeResourceLinkArgs.builder()
.name("my_resource_link")
.resourceId(exampleConfigstore.id())
.build())
.forceDestroy(true)
.build());
}
}
import pulumi
import pulumi_fastly as fastly
# IMPORTANT: Deleting a Config Store requires first deleting its resource_link.
# This requires a two-step `pulumi up` as we can't guarantee deletion order.
# e.g. resource_link deletion within fastly_service_compute might not finish first.
example_configstore = fastly.Configstore("exampleConfigstore")
example_package_hash = fastly.get_package_hash(filename="package.tar.gz")
example_service_compute = fastly.ServiceCompute("exampleServiceCompute",
domains=[fastly.ServiceComputeDomainArgs(
name="demo.example.com",
)],
package=fastly.ServiceComputePackageArgs(
filename="package.tar.gz",
source_code_hash=example_package_hash.hash,
),
resource_links=[fastly.ServiceComputeResourceLinkArgs(
name="my_resource_link",
resource_id=example_configstore.id,
)],
force_destroy=True)
import * as pulumi from "@pulumi/pulumi";
import * as fastly from "@pulumi/fastly";
// IMPORTANT: Deleting a Config Store requires first deleting its resource_link.
// This requires a two-step `pulumi up` as we can't guarantee deletion order.
// e.g. resource_link deletion within fastly_service_compute might not finish first.
const exampleConfigstore = new fastly.Configstore("exampleConfigstore", {});
const examplePackageHash = fastly.getPackageHash({
filename: "package.tar.gz",
});
const exampleServiceCompute = new fastly.ServiceCompute("exampleServiceCompute", {
domains: [{
name: "demo.example.com",
}],
"package": {
filename: "package.tar.gz",
sourceCodeHash: examplePackageHash.then(examplePackageHash => examplePackageHash.hash),
},
resourceLinks: [{
name: "my_resource_link",
resourceId: exampleConfigstore.id,
}],
forceDestroy: true,
});
resources:
# IMPORTANT: Deleting a Config Store requires first deleting its resource_link.
# This requires a two-step `pulumi up` as we can't guarantee deletion order.
# e.g. resource_link deletion within fastly_service_compute might not finish first.
exampleConfigstore:
type: fastly:Configstore
exampleServiceCompute:
type: fastly:ServiceCompute
properties:
domains:
- name: demo.example.com
package:
filename: package.tar.gz
sourceCodeHash: ${examplePackageHash.hash}
resourceLinks:
- name: my_resource_link
resourceId: ${exampleConfigstore.id}
forceDestroy: true
variables:
examplePackageHash:
fn::invoke:
Function: fastly:getPackageHash
Arguments:
filename: package.tar.gz
Create Configstore Resource
new Configstore(name: string, args?: ConfigstoreArgs, opts?: CustomResourceOptions);
@overload
def Configstore(resource_name: str,
opts: Optional[ResourceOptions] = None,
force_destroy: Optional[bool] = None,
name: Optional[str] = None)
@overload
def Configstore(resource_name: str,
args: Optional[ConfigstoreArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewConfigstore(ctx *Context, name string, args *ConfigstoreArgs, opts ...ResourceOption) (*Configstore, error)
public Configstore(string name, ConfigstoreArgs? args = null, CustomResourceOptions? opts = null)
public Configstore(String name, ConfigstoreArgs args)
public Configstore(String name, ConfigstoreArgs args, CustomResourceOptions options)
type: fastly:Configstore
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConfigstoreArgs
- 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 ConfigstoreArgs
- 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 ConfigstoreArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConfigstoreArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ConfigstoreArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Configstore Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Configstore resource accepts the following input properties:
- Force
Destroy bool Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- Name string
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- Force
Destroy bool Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- Name string
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force
Destroy Boolean Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name String
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force
Destroy boolean Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name string
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force_
destroy bool Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name str
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force
Destroy Boolean Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name String
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
Outputs
All input properties are implicitly available as output properties. Additionally, the Configstore 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 Configstore Resource
Get an existing Configstore 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?: ConfigstoreState, opts?: CustomResourceOptions): Configstore
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
force_destroy: Optional[bool] = None,
name: Optional[str] = None) -> Configstore
func GetConfigstore(ctx *Context, name string, id IDInput, state *ConfigstoreState, opts ...ResourceOption) (*Configstore, error)
public static Configstore Get(string name, Input<string> id, ConfigstoreState? state, CustomResourceOptions? opts = null)
public static Configstore get(String name, Output<String> id, ConfigstoreState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Force
Destroy bool Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- Name string
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- Force
Destroy bool Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- Name string
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force
Destroy Boolean Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name String
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force
Destroy boolean Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name string
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force_
destroy bool Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name str
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
- force
Destroy Boolean Allow the Config Store to be deleted, even if it contains entries. Defaults to false.
- name String
A unique name to identify the Config Store. It is important to note that changing this attribute will delete and recreate the Config Store, and discard the current entries. You MUST first delete the associated resource_link block from your service before modifying this field.
Import
Fastly Config Stores can be imported using their Store ID, e.g.
$ pulumi import fastly:index/configstore:Configstore example xxxxxxxxxxxxxxxxxxxx
Package Details
- Repository
- Fastly pulumi/pulumi-fastly
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
fastly
Terraform Provider.