1. Registry
  2. Packages
  3. Fastly Provider
  4. API Docs
  5. AiRuntimeControlVirtualKey
Viewing docs for Fastly v12.7.0
published on Friday, Sep 18, 2026 by Pulumi
fastly logo
Viewing docs for Fastly v12.7.0
published on Friday, Sep 18, 2026 by Pulumi

    Provides a Fastly AI Runtime Control virtual key, used to authenticate requests to an AI service and to attribute usage and session logs back to a named key.

    Example Usage

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    const demo = new fastly.AiRuntimeControlVirtualKey("demo", {
        name: "prod website chatbot",
        model: "claude-sonnet-4-20250514",
        providerName: "Anthropic",
        userId: "6zhNCY1236787aJIwUgN",
        expiresAt: "2026-08-05T17:13:36Z",
    });
    
    import pulumi
    import pulumi_fastly as fastly
    
    demo = fastly.AiRuntimeControlVirtualKey("demo",
        name="prod website chatbot",
        model="claude-sonnet-4-20250514",
        provider_name="Anthropic",
        user_id="6zhNCY1236787aJIwUgN",
        expires_at="2026-08-05T17:13:36Z")
    
    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 {
    		_, err := fastly.NewAiRuntimeControlVirtualKey(ctx, "demo", &fastly.AiRuntimeControlVirtualKeyArgs{
    			Name:         pulumi.String("prod website chatbot"),
    			Model:        pulumi.String("claude-sonnet-4-20250514"),
    			ProviderName: pulumi.String("Anthropic"),
    			UserId:       pulumi.String("6zhNCY1236787aJIwUgN"),
    			ExpiresAt:    pulumi.String("2026-08-05T17:13:36Z"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var demo = new Fastly.AiRuntimeControlVirtualKey("demo", new()
        {
            Name = "prod website chatbot",
            Model = "claude-sonnet-4-20250514",
            ProviderName = "Anthropic",
            UserId = "6zhNCY1236787aJIwUgN",
            ExpiresAt = "2026-08-05T17:13:36Z",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fastly.AiRuntimeControlVirtualKey;
    import com.pulumi.fastly.AiRuntimeControlVirtualKeyArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 demo = new AiRuntimeControlVirtualKey("demo", AiRuntimeControlVirtualKeyArgs.builder()
                .name("prod website chatbot")
                .model("claude-sonnet-4-20250514")
                .providerName("Anthropic")
                .userId("6zhNCY1236787aJIwUgN")
                .expiresAt("2026-08-05T17:13:36Z")
                .build());
    
        }
    }
    
    resources:
      demo:
        type: fastly:AiRuntimeControlVirtualKey
        properties:
          name: prod website chatbot
          model: claude-sonnet-4-20250514
          providerName: Anthropic
          userId: 6zhNCY1236787aJIwUgN
          expiresAt: 2026-08-05T17:13:36Z
    
    pulumi {
      required_providers {
        fastly = {
          source = "pulumi/fastly"
        }
      }
    }
    
    resource "fastly_airuntimecontrolvirtualkey" "demo" {
      name          = "prod website chatbot"
      model         = "claude-sonnet-4-20250514"
      provider_name = "Anthropic"
      user_id       = "6zhNCY1236787aJIwUgN"
      expires_at    = "2026-08-05T17:13:36Z"
    }
    

    Create AiRuntimeControlVirtualKey Resource

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

    Constructor syntax

    new AiRuntimeControlVirtualKey(name: string, args: AiRuntimeControlVirtualKeyArgs, opts?: CustomResourceOptions);
    @overload
    def AiRuntimeControlVirtualKey(resource_name: str,
                                   args: AiRuntimeControlVirtualKeyArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def AiRuntimeControlVirtualKey(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   model: Optional[str] = None,
                                   provider_name: Optional[str] = None,
                                   user_id: Optional[str] = None,
                                   expires_at: Optional[str] = None,
                                   name: Optional[str] = None)
    func NewAiRuntimeControlVirtualKey(ctx *Context, name string, args AiRuntimeControlVirtualKeyArgs, opts ...ResourceOption) (*AiRuntimeControlVirtualKey, error)
    public AiRuntimeControlVirtualKey(string name, AiRuntimeControlVirtualKeyArgs args, CustomResourceOptions? opts = null)
    public AiRuntimeControlVirtualKey(String name, AiRuntimeControlVirtualKeyArgs args)
    public AiRuntimeControlVirtualKey(String name, AiRuntimeControlVirtualKeyArgs args, CustomResourceOptions options)
    
    type: fastly:AiRuntimeControlVirtualKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "fastly_ai_runtime_control_virtual_key" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args AiRuntimeControlVirtualKeyArgs
    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 AiRuntimeControlVirtualKeyArgs
    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 AiRuntimeControlVirtualKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AiRuntimeControlVirtualKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AiRuntimeControlVirtualKeyArgs
    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 aiRuntimeControlVirtualKeyResource = new Fastly.AiRuntimeControlVirtualKey("aiRuntimeControlVirtualKeyResource", new()
    {
        Model = "string",
        ProviderName = "string",
        UserId = "string",
        ExpiresAt = "string",
        Name = "string",
    });
    
    example, err := fastly.NewAiRuntimeControlVirtualKey(ctx, "aiRuntimeControlVirtualKeyResource", &fastly.AiRuntimeControlVirtualKeyArgs{
    	Model:        pulumi.String("string"),
    	ProviderName: pulumi.String("string"),
    	UserId:       pulumi.String("string"),
    	ExpiresAt:    pulumi.String("string"),
    	Name:         pulumi.String("string"),
    })
    
    resource "fastly_ai_runtime_control_virtual_key" "aiRuntimeControlVirtualKeyResource" {
      lifecycle {
        create_before_destroy = true
      }
      model         = "string"
      provider_name = "string"
      user_id       = "string"
      expires_at    = "string"
      name          = "string"
    }
    
    var aiRuntimeControlVirtualKeyResource = new AiRuntimeControlVirtualKey("aiRuntimeControlVirtualKeyResource", AiRuntimeControlVirtualKeyArgs.builder()
        .model("string")
        .providerName("string")
        .userId("string")
        .expiresAt("string")
        .name("string")
        .build());
    
    ai_runtime_control_virtual_key_resource = fastly.AiRuntimeControlVirtualKey("aiRuntimeControlVirtualKeyResource",
        model="string",
        provider_name="string",
        user_id="string",
        expires_at="string",
        name="string")
    
    const aiRuntimeControlVirtualKeyResource = new fastly.AiRuntimeControlVirtualKey("aiRuntimeControlVirtualKeyResource", {
        model: "string",
        providerName: "string",
        userId: "string",
        expiresAt: "string",
        name: "string",
    });
    
    type: fastly:AiRuntimeControlVirtualKey
    properties:
        expiresAt: string
        model: string
        name: string
        providerName: string
        userId: string
    

    AiRuntimeControlVirtualKey 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 AiRuntimeControlVirtualKey resource accepts the following input properties:

    Model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    ProviderName string
    The AI model provider name, e.g. Anthropic.
    UserId string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    ExpiresAt string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    Name string
    A human-readable name for the virtual key.
    Model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    ProviderName string
    The AI model provider name, e.g. Anthropic.
    UserId string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    ExpiresAt string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    Name string
    A human-readable name for the virtual key.
    model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    provider_name string
    The AI model provider name, e.g. Anthropic.
    user_id string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    expires_at string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    name string
    A human-readable name for the virtual key.
    model String
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    providerName String
    The AI model provider name, e.g. Anthropic.
    userId String
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    expiresAt String
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    name String
    A human-readable name for the virtual key.
    model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    providerName string
    The AI model provider name, e.g. Anthropic.
    userId string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    expiresAt string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    name string
    A human-readable name for the virtual key.
    model str
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    provider_name str
    The AI model provider name, e.g. Anthropic.
    user_id str
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    expires_at str
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    name str
    A human-readable name for the virtual key.
    model String
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    providerName String
    The AI model provider name, e.g. Anthropic.
    userId String
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    expiresAt String
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    name String
    A human-readable name for the virtual key.

    Outputs

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

    AccessToken string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    CreatedAt string
    Timestamp (UTC) of when the virtual key was created.
    CreatedBy string
    The display name of the user who created the virtual key.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUsedAt string
    Timestamp (UTC) of when the virtual key was last used.
    Type string
    The type of the virtual key.
    UpdatedAt string
    Timestamp (UTC) of when the virtual key was last updated.
    AccessToken string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    CreatedAt string
    Timestamp (UTC) of when the virtual key was created.
    CreatedBy string
    The display name of the user who created the virtual key.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUsedAt string
    Timestamp (UTC) of when the virtual key was last used.
    Type string
    The type of the virtual key.
    UpdatedAt string
    Timestamp (UTC) of when the virtual key was last updated.
    access_token string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    created_at string
    Timestamp (UTC) of when the virtual key was created.
    created_by string
    The display name of the user who created the virtual key.
    id string
    The provider-assigned unique ID for this managed resource.
    last_used_at string
    Timestamp (UTC) of when the virtual key was last used.
    type string
    The type of the virtual key.
    updated_at string
    Timestamp (UTC) of when the virtual key was last updated.
    accessToken String
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    createdAt String
    Timestamp (UTC) of when the virtual key was created.
    createdBy String
    The display name of the user who created the virtual key.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUsedAt String
    Timestamp (UTC) of when the virtual key was last used.
    type String
    The type of the virtual key.
    updatedAt String
    Timestamp (UTC) of when the virtual key was last updated.
    accessToken string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    createdAt string
    Timestamp (UTC) of when the virtual key was created.
    createdBy string
    The display name of the user who created the virtual key.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUsedAt string
    Timestamp (UTC) of when the virtual key was last used.
    type string
    The type of the virtual key.
    updatedAt string
    Timestamp (UTC) of when the virtual key was last updated.
    access_token str
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    created_at str
    Timestamp (UTC) of when the virtual key was created.
    created_by str
    The display name of the user who created the virtual key.
    id str
    The provider-assigned unique ID for this managed resource.
    last_used_at str
    Timestamp (UTC) of when the virtual key was last used.
    type str
    The type of the virtual key.
    updated_at str
    Timestamp (UTC) of when the virtual key was last updated.
    accessToken String
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    createdAt String
    Timestamp (UTC) of when the virtual key was created.
    createdBy String
    The display name of the user who created the virtual key.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUsedAt String
    Timestamp (UTC) of when the virtual key was last used.
    type String
    The type of the virtual key.
    updatedAt String
    Timestamp (UTC) of when the virtual key was last updated.

    Look up Existing AiRuntimeControlVirtualKey Resource

    Get an existing AiRuntimeControlVirtualKey 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?: AiRuntimeControlVirtualKeyState, opts?: CustomResourceOptions): AiRuntimeControlVirtualKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_token: Optional[str] = None,
            created_at: Optional[str] = None,
            created_by: Optional[str] = None,
            expires_at: Optional[str] = None,
            last_used_at: Optional[str] = None,
            model: Optional[str] = None,
            name: Optional[str] = None,
            provider_name: Optional[str] = None,
            type: Optional[str] = None,
            updated_at: Optional[str] = None,
            user_id: Optional[str] = None) -> AiRuntimeControlVirtualKey
    func GetAiRuntimeControlVirtualKey(ctx *Context, name string, id IDInput, state *AiRuntimeControlVirtualKeyState, opts ...ResourceOption) (*AiRuntimeControlVirtualKey, error)
    public static AiRuntimeControlVirtualKey Get(string name, Input<string> id, AiRuntimeControlVirtualKeyState? state, CustomResourceOptions? opts = null)
    public static AiRuntimeControlVirtualKey get(String name, Output<String> id, AiRuntimeControlVirtualKeyState state, CustomResourceOptions options)
    resources:  _:    type: fastly:AiRuntimeControlVirtualKey    get:      id: ${id}
    import {
      to = fastly_ai_runtime_control_virtual_key.example
      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:
    AccessToken string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    CreatedAt string
    Timestamp (UTC) of when the virtual key was created.
    CreatedBy string
    The display name of the user who created the virtual key.
    ExpiresAt string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    LastUsedAt string
    Timestamp (UTC) of when the virtual key was last used.
    Model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    Name string
    A human-readable name for the virtual key.
    ProviderName string
    The AI model provider name, e.g. Anthropic.
    Type string
    The type of the virtual key.
    UpdatedAt string
    Timestamp (UTC) of when the virtual key was last updated.
    UserId string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    AccessToken string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    CreatedAt string
    Timestamp (UTC) of when the virtual key was created.
    CreatedBy string
    The display name of the user who created the virtual key.
    ExpiresAt string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    LastUsedAt string
    Timestamp (UTC) of when the virtual key was last used.
    Model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    Name string
    A human-readable name for the virtual key.
    ProviderName string
    The AI model provider name, e.g. Anthropic.
    Type string
    The type of the virtual key.
    UpdatedAt string
    Timestamp (UTC) of when the virtual key was last updated.
    UserId string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    access_token string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    created_at string
    Timestamp (UTC) of when the virtual key was created.
    created_by string
    The display name of the user who created the virtual key.
    expires_at string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    last_used_at string
    Timestamp (UTC) of when the virtual key was last used.
    model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    name string
    A human-readable name for the virtual key.
    provider_name string
    The AI model provider name, e.g. Anthropic.
    type string
    The type of the virtual key.
    updated_at string
    Timestamp (UTC) of when the virtual key was last updated.
    user_id string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    accessToken String
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    createdAt String
    Timestamp (UTC) of when the virtual key was created.
    createdBy String
    The display name of the user who created the virtual key.
    expiresAt String
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    lastUsedAt String
    Timestamp (UTC) of when the virtual key was last used.
    model String
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    name String
    A human-readable name for the virtual key.
    providerName String
    The AI model provider name, e.g. Anthropic.
    type String
    The type of the virtual key.
    updatedAt String
    Timestamp (UTC) of when the virtual key was last updated.
    userId String
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    accessToken string
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    createdAt string
    Timestamp (UTC) of when the virtual key was created.
    createdBy string
    The display name of the user who created the virtual key.
    expiresAt string
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    lastUsedAt string
    Timestamp (UTC) of when the virtual key was last used.
    model string
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    name string
    A human-readable name for the virtual key.
    providerName string
    The AI model provider name, e.g. Anthropic.
    type string
    The type of the virtual key.
    updatedAt string
    Timestamp (UTC) of when the virtual key was last updated.
    userId string
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    access_token str
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    created_at str
    Timestamp (UTC) of when the virtual key was created.
    created_by str
    The display name of the user who created the virtual key.
    expires_at str
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    last_used_at str
    Timestamp (UTC) of when the virtual key was last used.
    model str
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    name str
    A human-readable name for the virtual key.
    provider_name str
    The AI model provider name, e.g. Anthropic.
    type str
    The type of the virtual key.
    updated_at str
    Timestamp (UTC) of when the virtual key was last updated.
    user_id str
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.
    accessToken String
    The generated access token used to authenticate as this virtual key. Only returned by the API when the key is created.
    createdAt String
    Timestamp (UTC) of when the virtual key was created.
    createdBy String
    The display name of the user who created the virtual key.
    expiresAt String
    The expiration timestamp of the virtual key, in RFC 3339 format. Once set, this value cannot be unset, only changed.
    lastUsedAt String
    Timestamp (UTC) of when the virtual key was last used.
    model String
    The AI model identifier, e.g. claude-sonnet-4-20250514.
    name String
    A human-readable name for the virtual key.
    providerName String
    The AI model provider name, e.g. Anthropic.
    type String
    The type of the virtual key.
    updatedAt String
    Timestamp (UTC) of when the virtual key was last updated.
    userId String
    The ID of the user creating the virtual key. Changing this forces a new virtual key to be created.

    Import

    Fastly AI Runtime Control virtual keys can be imported using their key ID, e.g.

    $ pulumi import fastly:index/aiRuntimeControlVirtualKey:AiRuntimeControlVirtualKey demo xxxxxxxxxxxxxxxxxxxx
    

    Note: Since accessToken is only returned by the API at creation time, it will be empty after importing an existing virtual key.

    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 v12.7.0
    published on Friday, Sep 18, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial