1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. ApigwEnvironmentVariableV2
opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud

opentelekomcloud.ApigwEnvironmentVariableV2

Explore with Pulumi AI

Up-to-date reference of API arguments for API Gateway environment variable service you can get at documentation portal

Manages an APIGW environment variable resource within OpenTelekomCloud.

A maximum of 50 variables can be created on the same environment.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";

const config = new pulumi.Config();
const gatewayId = config.requireObject("gatewayId");
const environmentId = config.requireObject("environmentId");
const groupId = config.requireObject("groupId");
const variableName = config.requireObject("variableName");
const variableValue = config.requireObject("variableValue");
const _var = new opentelekomcloud.ApigwEnvironmentVariableV2("var", {
    gatewayId: gatewayId,
    environmentId: environmentId,
    groupId: groupId,
    value: variableValue,
});
Copy
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud

config = pulumi.Config()
gateway_id = config.require_object("gatewayId")
environment_id = config.require_object("environmentId")
group_id = config.require_object("groupId")
variable_name = config.require_object("variableName")
variable_value = config.require_object("variableValue")
var = opentelekomcloud.ApigwEnvironmentVariableV2("var",
    gateway_id=gateway_id,
    environment_id=environment_id,
    group_id=group_id,
    value=variable_value)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		gatewayId := cfg.RequireObject("gatewayId")
		environmentId := cfg.RequireObject("environmentId")
		groupId := cfg.RequireObject("groupId")
		variableName := cfg.RequireObject("variableName")
		variableValue := cfg.RequireObject("variableValue")
		_, err := opentelekomcloud.NewApigwEnvironmentVariableV2(ctx, "var", &opentelekomcloud.ApigwEnvironmentVariableV2Args{
			GatewayId:     pulumi.Any(gatewayId),
			EnvironmentId: pulumi.Any(environmentId),
			GroupId:       pulumi.Any(groupId),
			Value:         pulumi.Any(variableValue),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var gatewayId = config.RequireObject<dynamic>("gatewayId");
    var environmentId = config.RequireObject<dynamic>("environmentId");
    var groupId = config.RequireObject<dynamic>("groupId");
    var variableName = config.RequireObject<dynamic>("variableName");
    var variableValue = config.RequireObject<dynamic>("variableValue");
    var @var = new Opentelekomcloud.ApigwEnvironmentVariableV2("var", new()
    {
        GatewayId = gatewayId,
        EnvironmentId = environmentId,
        GroupId = groupId,
        Value = variableValue,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.ApigwEnvironmentVariableV2;
import com.pulumi.opentelekomcloud.ApigwEnvironmentVariableV2Args;
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) {
        final var config = ctx.config();
        final var gatewayId = config.get("gatewayId");
        final var environmentId = config.get("environmentId");
        final var groupId = config.get("groupId");
        final var variableName = config.get("variableName");
        final var variableValue = config.get("variableValue");
        var var_ = new ApigwEnvironmentVariableV2("var", ApigwEnvironmentVariableV2Args.builder()
            .gatewayId(gatewayId)
            .environmentId(environmentId)
            .groupId(groupId)
            .value(variableValue)
            .build());

    }
}
Copy
configuration:
  gatewayId:
    type: dynamic
  environmentId:
    type: dynamic
  groupId:
    type: dynamic
  variableName:
    type: dynamic
  variableValue:
    type: dynamic
resources:
  var:
    type: opentelekomcloud:ApigwEnvironmentVariableV2
    properties:
      gatewayId: ${gatewayId}
      environmentId: ${environmentId}
      groupId: ${groupId}
      value: ${variableValue}
Copy

Create ApigwEnvironmentVariableV2 Resource

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

Constructor syntax

new ApigwEnvironmentVariableV2(name: string, args: ApigwEnvironmentVariableV2Args, opts?: CustomResourceOptions);
@overload
def ApigwEnvironmentVariableV2(resource_name: str,
                               args: ApigwEnvironmentVariableV2Args,
                               opts: Optional[ResourceOptions] = None)

@overload
def ApigwEnvironmentVariableV2(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               environment_id: Optional[str] = None,
                               gateway_id: Optional[str] = None,
                               group_id: Optional[str] = None,
                               value: Optional[str] = None,
                               apigw_environment_variable_v2_id: Optional[str] = None,
                               name: Optional[str] = None)
func NewApigwEnvironmentVariableV2(ctx *Context, name string, args ApigwEnvironmentVariableV2Args, opts ...ResourceOption) (*ApigwEnvironmentVariableV2, error)
public ApigwEnvironmentVariableV2(string name, ApigwEnvironmentVariableV2Args args, CustomResourceOptions? opts = null)
public ApigwEnvironmentVariableV2(String name, ApigwEnvironmentVariableV2Args args)
public ApigwEnvironmentVariableV2(String name, ApigwEnvironmentVariableV2Args args, CustomResourceOptions options)
type: opentelekomcloud:ApigwEnvironmentVariableV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ApigwEnvironmentVariableV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ApigwEnvironmentVariableV2Args
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ApigwEnvironmentVariableV2Args
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ApigwEnvironmentVariableV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ApigwEnvironmentVariableV2Args
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 apigwEnvironmentVariableV2Resource = new Opentelekomcloud.ApigwEnvironmentVariableV2("apigwEnvironmentVariableV2Resource", new()
{
    EnvironmentId = "string",
    GatewayId = "string",
    GroupId = "string",
    Value = "string",
    ApigwEnvironmentVariableV2Id = "string",
    Name = "string",
});
Copy
example, err := opentelekomcloud.NewApigwEnvironmentVariableV2(ctx, "apigwEnvironmentVariableV2Resource", &opentelekomcloud.ApigwEnvironmentVariableV2Args{
EnvironmentId: pulumi.String("string"),
GatewayId: pulumi.String("string"),
GroupId: pulumi.String("string"),
Value: pulumi.String("string"),
ApigwEnvironmentVariableV2Id: pulumi.String("string"),
Name: pulumi.String("string"),
})
Copy
var apigwEnvironmentVariableV2Resource = new ApigwEnvironmentVariableV2("apigwEnvironmentVariableV2Resource", ApigwEnvironmentVariableV2Args.builder()
    .environmentId("string")
    .gatewayId("string")
    .groupId("string")
    .value("string")
    .apigwEnvironmentVariableV2Id("string")
    .name("string")
    .build());
Copy
apigw_environment_variable_v2_resource = opentelekomcloud.ApigwEnvironmentVariableV2("apigwEnvironmentVariableV2Resource",
    environment_id="string",
    gateway_id="string",
    group_id="string",
    value="string",
    apigw_environment_variable_v2_id="string",
    name="string")
Copy
const apigwEnvironmentVariableV2Resource = new opentelekomcloud.ApigwEnvironmentVariableV2("apigwEnvironmentVariableV2Resource", {
    environmentId: "string",
    gatewayId: "string",
    groupId: "string",
    value: "string",
    apigwEnvironmentVariableV2Id: "string",
    name: "string",
});
Copy
type: opentelekomcloud:ApigwEnvironmentVariableV2
properties:
    apigwEnvironmentVariableV2Id: string
    environmentId: string
    gatewayId: string
    groupId: string
    name: string
    value: string
Copy

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

EnvironmentId This property is required. string
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
GatewayId This property is required. string
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
GroupId This property is required. string
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
Value This property is required. string
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
ApigwEnvironmentVariableV2Id string
The resource ID.
Name string
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
EnvironmentId This property is required. string
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
GatewayId This property is required. string
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
GroupId This property is required. string
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
Value This property is required. string
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
ApigwEnvironmentVariableV2Id string
The resource ID.
Name string
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
environmentId This property is required. String
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gatewayId This property is required. String
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
groupId This property is required. String
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
value This property is required. String
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigwEnvironmentVariableV2Id String
The resource ID.
name String
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
environmentId This property is required. string
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gatewayId This property is required. string
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
groupId This property is required. string
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
value This property is required. string
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigwEnvironmentVariableV2Id string
The resource ID.
name string
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
environment_id This property is required. str
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gateway_id This property is required. str
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
group_id This property is required. str
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
value This property is required. str
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigw_environment_variable_v2_id str
The resource ID.
name str
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
environmentId This property is required. String
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gatewayId This property is required. String
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
groupId This property is required. String
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
value This property is required. String
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigwEnvironmentVariableV2Id String
The resource ID.
name String
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Region string
The region where the dedicated instance is located.
Id string
The provider-assigned unique ID for this managed resource.
Region string
The region where the dedicated instance is located.
id String
The provider-assigned unique ID for this managed resource.
region String
The region where the dedicated instance is located.
id string
The provider-assigned unique ID for this managed resource.
region string
The region where the dedicated instance is located.
id str
The provider-assigned unique ID for this managed resource.
region str
The region where the dedicated instance is located.
id String
The provider-assigned unique ID for this managed resource.
region String
The region where the dedicated instance is located.

Look up Existing ApigwEnvironmentVariableV2 Resource

Get an existing ApigwEnvironmentVariableV2 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?: ApigwEnvironmentVariableV2State, opts?: CustomResourceOptions): ApigwEnvironmentVariableV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        apigw_environment_variable_v2_id: Optional[str] = None,
        environment_id: Optional[str] = None,
        gateway_id: Optional[str] = None,
        group_id: Optional[str] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        value: Optional[str] = None) -> ApigwEnvironmentVariableV2
func GetApigwEnvironmentVariableV2(ctx *Context, name string, id IDInput, state *ApigwEnvironmentVariableV2State, opts ...ResourceOption) (*ApigwEnvironmentVariableV2, error)
public static ApigwEnvironmentVariableV2 Get(string name, Input<string> id, ApigwEnvironmentVariableV2State? state, CustomResourceOptions? opts = null)
public static ApigwEnvironmentVariableV2 get(String name, Output<String> id, ApigwEnvironmentVariableV2State state, CustomResourceOptions options)
resources:  _:    type: opentelekomcloud:ApigwEnvironmentVariableV2    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ApigwEnvironmentVariableV2Id string
The resource ID.
EnvironmentId string
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
GatewayId string
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
GroupId string
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
Name string
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
Region string
The region where the dedicated instance is located.
Value string
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
ApigwEnvironmentVariableV2Id string
The resource ID.
EnvironmentId string
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
GatewayId string
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
GroupId string
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
Name string
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
Region string
The region where the dedicated instance is located.
Value string
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigwEnvironmentVariableV2Id String
The resource ID.
environmentId String
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gatewayId String
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
groupId String
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
name String
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
region String
The region where the dedicated instance is located.
value String
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigwEnvironmentVariableV2Id string
The resource ID.
environmentId string
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gatewayId string
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
groupId string
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
name string
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
region string
The region where the dedicated instance is located.
value string
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigw_environment_variable_v2_id str
The resource ID.
environment_id str
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gateway_id str
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
group_id str
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
name str
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
region str
The region where the dedicated instance is located.
value str
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.
apigwEnvironmentVariableV2Id String
The resource ID.
environmentId String
Specifies the ID of the environment to which the environment variable belongs. Changing this creates a new resource.
gatewayId String
Specifies the ID of the dedicated gateway instance to which the environment variable belongs. Changing this creates a new resource.
groupId String
Specifies the ID of the group to which the environment variable belongs. Changing this creates a new resource.
name String
Specifies the name of the environment variable. The valid length is limited from 3 to 32 characters. Only letters, digits, hyphens -, and underscores _ are allowed, and must start with a letter. In the definition of an API, the name (case-sensitive) indicates a variable, for example, #Name#. It is replaced by the actual value when the API is published in an environment. The variable name must be unique. Changing this creates a new resource.
region String
The region where the dedicated instance is located.
value String
Specifies the value of the environment variable. The valid length is limited from 1 to 255 characters. Only letters, digits and special characters _-/.: are allowed. Changing this creates a new resource.

Import

The resource can be imported using gateway_id, group_id and name, separated by slashes (/), e.g.

bash

$ pulumi import opentelekomcloud:index/apigwEnvironmentVariableV2:ApigwEnvironmentVariableV2 test <gateway_id>/<group_id>/<name>
Copy

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

Package Details

Repository
opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
License
Notes
This Pulumi package is based on the opentelekomcloud Terraform Provider.