1. Packages
  2. Vercel
  3. API Docs
  4. EdgeConfigToken
Vercel v1.11.0 published on Thursday, May 23, 2024 by Pulumiverse

vercel.EdgeConfigToken

Explore with Pulumi AI

vercel logo
Vercel v1.11.0 published on Thursday, May 23, 2024 by Pulumiverse

    Provides an Edge Config Token resource.

    An Edge Config is a global data store that enables experimentation with feature flags, A/B testing, critical redirects, and more.

    An Edge Config token is used to authenticate against an Edge Config’s endpoint.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vercel from "@pulumiverse/vercel";
    
    const exampleEdgeConfig = new vercel.EdgeConfig("exampleEdgeConfig", {});
    const exampleProject = new vercel.Project("exampleProject", {});
    const exampleEdgeConfigToken = new vercel.EdgeConfigToken("exampleEdgeConfigToken", {
        edgeConfigId: exampleEdgeConfig.id,
        label: "example token",
    });
    const exampleProjectEnvironmentVariable = new vercel.ProjectEnvironmentVariable("exampleProjectEnvironmentVariable", {
        projectId: exampleProject.id,
        targets: [
            "production",
            "preview",
            "development",
        ],
        key: "EDGE_CONFIG",
        value: exampleEdgeConfigToken.connectionString,
    });
    
    import pulumi
    import pulumiverse_vercel as vercel
    
    example_edge_config = vercel.EdgeConfig("exampleEdgeConfig")
    example_project = vercel.Project("exampleProject")
    example_edge_config_token = vercel.EdgeConfigToken("exampleEdgeConfigToken",
        edge_config_id=example_edge_config.id,
        label="example token")
    example_project_environment_variable = vercel.ProjectEnvironmentVariable("exampleProjectEnvironmentVariable",
        project_id=example_project.id,
        targets=[
            "production",
            "preview",
            "development",
        ],
        key="EDGE_CONFIG",
        value=example_edge_config_token.connection_string)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-vercel/sdk/go/vercel"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleEdgeConfig, err := vercel.NewEdgeConfig(ctx, "exampleEdgeConfig", nil)
    		if err != nil {
    			return err
    		}
    		exampleProject, err := vercel.NewProject(ctx, "exampleProject", nil)
    		if err != nil {
    			return err
    		}
    		exampleEdgeConfigToken, err := vercel.NewEdgeConfigToken(ctx, "exampleEdgeConfigToken", &vercel.EdgeConfigTokenArgs{
    			EdgeConfigId: exampleEdgeConfig.ID(),
    			Label:        pulumi.String("example token"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vercel.NewProjectEnvironmentVariable(ctx, "exampleProjectEnvironmentVariable", &vercel.ProjectEnvironmentVariableArgs{
    			ProjectId: exampleProject.ID(),
    			Targets: pulumi.StringArray{
    				pulumi.String("production"),
    				pulumi.String("preview"),
    				pulumi.String("development"),
    			},
    			Key:   pulumi.String("EDGE_CONFIG"),
    			Value: exampleEdgeConfigToken.ConnectionString,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vercel = Pulumiverse.Vercel;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleEdgeConfig = new Vercel.EdgeConfig("exampleEdgeConfig");
    
        var exampleProject = new Vercel.Project("exampleProject");
    
        var exampleEdgeConfigToken = new Vercel.EdgeConfigToken("exampleEdgeConfigToken", new()
        {
            EdgeConfigId = exampleEdgeConfig.Id,
            Label = "example token",
        });
    
        var exampleProjectEnvironmentVariable = new Vercel.ProjectEnvironmentVariable("exampleProjectEnvironmentVariable", new()
        {
            ProjectId = exampleProject.Id,
            Targets = new[]
            {
                "production",
                "preview",
                "development",
            },
            Key = "EDGE_CONFIG",
            Value = exampleEdgeConfigToken.ConnectionString,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vercel.EdgeConfig;
    import com.pulumi.vercel.Project;
    import com.pulumi.vercel.EdgeConfigToken;
    import com.pulumi.vercel.EdgeConfigTokenArgs;
    import com.pulumi.vercel.ProjectEnvironmentVariable;
    import com.pulumi.vercel.ProjectEnvironmentVariableArgs;
    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 exampleEdgeConfig = new EdgeConfig("exampleEdgeConfig");
    
            var exampleProject = new Project("exampleProject");
    
            var exampleEdgeConfigToken = new EdgeConfigToken("exampleEdgeConfigToken", EdgeConfigTokenArgs.builder()        
                .edgeConfigId(exampleEdgeConfig.id())
                .label("example token")
                .build());
    
            var exampleProjectEnvironmentVariable = new ProjectEnvironmentVariable("exampleProjectEnvironmentVariable", ProjectEnvironmentVariableArgs.builder()        
                .projectId(exampleProject.id())
                .targets(            
                    "production",
                    "preview",
                    "development")
                .key("EDGE_CONFIG")
                .value(exampleEdgeConfigToken.connectionString())
                .build());
    
        }
    }
    
    resources:
      exampleEdgeConfig:
        type: vercel:EdgeConfig
      exampleProject:
        type: vercel:Project
      exampleEdgeConfigToken:
        type: vercel:EdgeConfigToken
        properties:
          edgeConfigId: ${exampleEdgeConfig.id}
          label: example token
      exampleProjectEnvironmentVariable:
        type: vercel:ProjectEnvironmentVariable
        properties:
          projectId: ${exampleProject.id}
          targets:
            - production
            - preview
            - development
          key: EDGE_CONFIG
          value: ${exampleEdgeConfigToken.connectionString}
    

    Create EdgeConfigToken Resource

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

    Constructor syntax

    new EdgeConfigToken(name: string, args: EdgeConfigTokenArgs, opts?: CustomResourceOptions);
    @overload
    def EdgeConfigToken(resource_name: str,
                        args: EdgeConfigTokenArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def EdgeConfigToken(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        edge_config_id: Optional[str] = None,
                        label: Optional[str] = None,
                        team_id: Optional[str] = None)
    func NewEdgeConfigToken(ctx *Context, name string, args EdgeConfigTokenArgs, opts ...ResourceOption) (*EdgeConfigToken, error)
    public EdgeConfigToken(string name, EdgeConfigTokenArgs args, CustomResourceOptions? opts = null)
    public EdgeConfigToken(String name, EdgeConfigTokenArgs args)
    public EdgeConfigToken(String name, EdgeConfigTokenArgs args, CustomResourceOptions options)
    
    type: vercel:EdgeConfigToken
    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 EdgeConfigTokenArgs
    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 EdgeConfigTokenArgs
    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 EdgeConfigTokenArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EdgeConfigTokenArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EdgeConfigTokenArgs
    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 edgeConfigTokenResource = new Vercel.EdgeConfigToken("edgeConfigTokenResource", new()
    {
        EdgeConfigId = "string",
        Label = "string",
        TeamId = "string",
    });
    
    example, err := vercel.NewEdgeConfigToken(ctx, "edgeConfigTokenResource", &vercel.EdgeConfigTokenArgs{
    	EdgeConfigId: pulumi.String("string"),
    	Label:        pulumi.String("string"),
    	TeamId:       pulumi.String("string"),
    })
    
    var edgeConfigTokenResource = new EdgeConfigToken("edgeConfigTokenResource", EdgeConfigTokenArgs.builder()
        .edgeConfigId("string")
        .label("string")
        .teamId("string")
        .build());
    
    edge_config_token_resource = vercel.EdgeConfigToken("edgeConfigTokenResource",
        edge_config_id="string",
        label="string",
        team_id="string")
    
    const edgeConfigTokenResource = new vercel.EdgeConfigToken("edgeConfigTokenResource", {
        edgeConfigId: "string",
        label: "string",
        teamId: "string",
    });
    
    type: vercel:EdgeConfigToken
    properties:
        edgeConfigId: string
        label: string
        teamId: string
    

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

    EdgeConfigId string
    The ID of the Edge Config store.
    Label string
    The label of the Edge Config Token.
    TeamId string
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    EdgeConfigId string
    The ID of the Edge Config store.
    Label string
    The label of the Edge Config Token.
    TeamId string
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    edgeConfigId String
    The ID of the Edge Config store.
    label String
    The label of the Edge Config Token.
    teamId String
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    edgeConfigId string
    The ID of the Edge Config store.
    label string
    The label of the Edge Config Token.
    teamId string
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    edge_config_id str
    The ID of the Edge Config store.
    label str
    The label of the Edge Config Token.
    team_id str
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    edgeConfigId String
    The ID of the Edge Config store.
    label String
    The label of the Edge Config Token.
    teamId String
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.

    Outputs

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

    ConnectionString string
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    ConnectionString string
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connectionString String
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connectionString string
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connection_string str
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    id str
    The provider-assigned unique ID for this managed resource.
    token str
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connectionString String
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.

    Look up Existing EdgeConfigToken Resource

    Get an existing EdgeConfigToken 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?: EdgeConfigTokenState, opts?: CustomResourceOptions): EdgeConfigToken
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connection_string: Optional[str] = None,
            edge_config_id: Optional[str] = None,
            label: Optional[str] = None,
            team_id: Optional[str] = None,
            token: Optional[str] = None) -> EdgeConfigToken
    func GetEdgeConfigToken(ctx *Context, name string, id IDInput, state *EdgeConfigTokenState, opts ...ResourceOption) (*EdgeConfigToken, error)
    public static EdgeConfigToken Get(string name, Input<string> id, EdgeConfigTokenState? state, CustomResourceOptions? opts = null)
    public static EdgeConfigToken get(String name, Output<String> id, EdgeConfigTokenState 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.
    The following state arguments are supported:
    ConnectionString string
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    EdgeConfigId string
    The ID of the Edge Config store.
    Label string
    The label of the Edge Config Token.
    TeamId string
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    Token string
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    ConnectionString string
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    EdgeConfigId string
    The ID of the Edge Config store.
    Label string
    The label of the Edge Config Token.
    TeamId string
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    Token string
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connectionString String
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    edgeConfigId String
    The ID of the Edge Config store.
    label String
    The label of the Edge Config Token.
    teamId String
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    token String
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connectionString string
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    edgeConfigId string
    The ID of the Edge Config store.
    label string
    The label of the Edge Config Token.
    teamId string
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    token string
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connection_string str
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    edge_config_id str
    The ID of the Edge Config store.
    label str
    The label of the Edge Config Token.
    team_id str
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    token str
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.
    connectionString String
    A connection string is a URL that connects a project to an Edge Config. The variable can be called anything, but our Edge Config client SDK will search for process.env.EDGE_CONFIG by default.
    edgeConfigId String
    The ID of the Edge Config store.
    label String
    The label of the Edge Config Token.
    teamId String
    The ID of the team the Edge Config should exist under. Required when configuring a team resource if a default team has not been set in the provider.
    token String
    A read access token used for authenticating against the Edge Config's endpoint for high volume, low-latency requests.

    Import

    If importing into a personal account, or with a team configured on

    the provider, simply use the edge config id and token value.

    • edge_config_id can be found by navigating to the Edge Config in the Vercel UI. It should begin with ecfg_.

    • token can be found in the Vercel UI under Storage, Edge Config, the specific Edge Config, Tokens.

    $ pulumi import vercel:index/edgeConfigToken:EdgeConfigToken example ecfg_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    

    Alternatively, you can import via the team_id and edge_config_id.

    • team_id can be found in the team settings tab in the Vercel UI.

    • edge_config_id can be found by navigating to the Edge Config in the Vercel UI. It should begin with ecfg_.

    • token can be found in the Vercel UI under Storage, Edge Config, the specific Edge Config, Tokens.

    $ pulumi import vercel:index/edgeConfigToken:EdgeConfigToken example team_xxxxxxxxxxxxxxxxxxxxxxxx/ecfg_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    

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

    Package Details

    Repository
    vercel pulumiverse/pulumi-vercel
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vercel Terraform Provider.
    vercel logo
    Vercel v1.11.0 published on Thursday, May 23, 2024 by Pulumiverse