published on Tuesday, Oct 27, 2026 by Pulumi
published on Tuesday, Oct 27, 2026 by Pulumi
Provides a Realtime Compute Variable resource.
Variable of Realtime Compute for Apache Flink, used to reference reusable values in deployments.
For information about Realtime Compute Variable and how to use it, see What is Variable.
NOTE: Available since v1.294.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = alicloud.oss.getBuckets({});
const defaultNetwork = new alicloud.vpc.Network("default", {
isDefault: false,
cidrBlock: "172.16.0.0/16",
vpcName: name,
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
isDefault: false,
vpcId: defaultNetwork.id,
zoneId: "cn-hangzhou-i",
cidrBlock: "172.16.0.0/24",
vswitchName: name,
});
const defaultVvpInstance = new alicloud.realtimecompute.VvpInstance("default", {
vvpInstanceName: name,
storage: {
oss: {
bucket: _default.then(_default => _default.buckets?.[0]?.name),
},
},
vpcId: defaultNetwork.id,
vswitchIds: [defaultSwitch.id],
resourceSpec: {
cpu: 8,
memoryGb: 32,
},
paymentType: "PayAsYouGo",
zoneId: defaultSwitch.zoneId,
});
const defaultVariable = new alicloud.realtimecompute.Variable("default", {
name: name,
namespace: pulumi.interpolate`${defaultVvpInstance.vvpInstanceName}-default`,
workspace: defaultVvpInstance.resourceId,
kind: "Clear",
value: "YourPassword123!",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.oss.get_buckets()
default_network = alicloud.vpc.Network("default",
is_default=False,
cidr_block="172.16.0.0/16",
vpc_name=name)
default_switch = alicloud.vpc.Switch("default",
is_default=False,
vpc_id=default_network.id,
zone_id="cn-hangzhou-i",
cidr_block="172.16.0.0/24",
vswitch_name=name)
default_vvp_instance = alicloud.realtimecompute.VvpInstance("default",
vvp_instance_name=name,
storage={
"oss": {
"bucket": default.buckets[0].name,
},
},
vpc_id=default_network.id,
vswitch_ids=[default_switch.id],
resource_spec={
"cpu": 8,
"memory_gb": 32,
},
payment_type="PayAsYouGo",
zone_id=default_switch.zone_id)
default_variable = alicloud.realtimecompute.Variable("default",
name=name,
namespace=default_vvp_instance.vvp_instance_name.apply(lambda vvp_instance_name: f"{vvp_instance_name}-default"),
workspace=default_vvp_instance.resource_id,
kind="Clear",
value="YourPassword123!")
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v4/go/alicloud/oss"
"github.com/pulumi/pulumi-alicloud/sdk/v4/go/alicloud/realtimecompute"
"github.com/pulumi/pulumi-alicloud/sdk/v4/go/alicloud/vpc"
"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, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := oss.GetBuckets(ctx, &oss.GetBucketsArgs{}, nil)
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
IsDefault: pulumi.Bool(false),
CidrBlock: pulumi.String("172.16.0.0/16"),
VpcName: pulumi.String(name),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
IsDefault: pulumi.Bool(false),
VpcId: defaultNetwork.ID(),
ZoneId: pulumi.String("cn-hangzhou-i"),
CidrBlock: pulumi.String("172.16.0.0/24"),
VswitchName: pulumi.String(name),
})
if err != nil {
return err
}
defaultVvpInstance, err := realtimecompute.NewVvpInstance(ctx, "default", &realtimecompute.VvpInstanceArgs{
VvpInstanceName: pulumi.String(name),
Storage: &realtimecompute.VvpInstanceStorageArgs{
Oss: &realtimecompute.VvpInstanceStorageOssArgs{
Bucket: pulumi.String(_default.Buckets[0].Name),
},
},
VpcId: defaultNetwork.ID(),
VswitchIds: pulumi.StringArray{
defaultSwitch.ID(),
},
ResourceSpec: &realtimecompute.VvpInstanceResourceSpecArgs{
Cpu: pulumi.Int(8),
MemoryGb: pulumi.Int(32),
},
PaymentType: pulumi.String("PayAsYouGo"),
ZoneId: defaultSwitch.ZoneId,
})
if err != nil {
return err
}
_, err = realtimecompute.NewVariable(ctx, "default", &realtimecompute.VariableArgs{
Name: pulumi.String(name),
Namespace: defaultVvpInstance.VvpInstanceName.ApplyT(func(vvpInstanceName string) (string, error) {
return fmt.Sprintf("%v-default", vvpInstanceName), nil
}).(pulumi.StringOutput),
Workspace: defaultVvpInstance.ResourceId,
Kind: pulumi.String("Clear"),
Value: pulumi.String("YourPassword123!"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = AliCloud.Oss.GetBuckets.Invoke();
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
IsDefault = false,
CidrBlock = "172.16.0.0/16",
VpcName = name,
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
IsDefault = false,
VpcId = defaultNetwork.Id,
ZoneId = "cn-hangzhou-i",
CidrBlock = "172.16.0.0/24",
VswitchName = name,
});
var defaultVvpInstance = new AliCloud.RealtimeCompute.VvpInstance("default", new()
{
VvpInstanceName = name,
Storage = new AliCloud.RealtimeCompute.Inputs.VvpInstanceStorageArgs
{
Oss = new AliCloud.RealtimeCompute.Inputs.VvpInstanceStorageOssArgs
{
Bucket = @default.Apply(@default => @default.Apply(getBucketsResult => getBucketsResult.Buckets[0]?.Name)),
},
},
VpcId = defaultNetwork.Id,
VswitchIds = new[]
{
defaultSwitch.Id,
},
ResourceSpec = new AliCloud.RealtimeCompute.Inputs.VvpInstanceResourceSpecArgs
{
Cpu = 8,
MemoryGb = 32,
},
PaymentType = "PayAsYouGo",
ZoneId = defaultSwitch.ZoneId,
});
var defaultVariable = new AliCloud.RealtimeCompute.Variable("default", new()
{
Name = name,
Namespace = defaultVvpInstance.VvpInstanceName.Apply(vvpInstanceName => $"{vvpInstanceName}-default"),
Workspace = defaultVvpInstance.ResourceId,
Kind = "Clear",
Value = "YourPassword123!",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.oss.OssFunctions;
import com.pulumi.alicloud.oss.inputs.GetBucketsArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.realtimecompute.VvpInstance;
import com.pulumi.alicloud.realtimecompute.VvpInstanceArgs;
import com.pulumi.alicloud.realtimecompute.inputs.VvpInstanceStorageArgs;
import com.pulumi.alicloud.realtimecompute.inputs.VvpInstanceStorageOssArgs;
import com.pulumi.alicloud.realtimecompute.inputs.VvpInstanceResourceSpecArgs;
import com.pulumi.alicloud.realtimecompute.Variable;
import com.pulumi.alicloud.realtimecompute.VariableArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
final var default = OssFunctions.getBuckets(GetBucketsArgs.builder()
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.isDefault(false)
.cidrBlock("172.16.0.0/16")
.vpcName(name)
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.isDefault(false)
.vpcId(defaultNetwork.id())
.zoneId("cn-hangzhou-i")
.cidrBlock("172.16.0.0/24")
.vswitchName(name)
.build());
var defaultVvpInstance = new VvpInstance("defaultVvpInstance", VvpInstanceArgs.builder()
.vvpInstanceName(name)
.storage(VvpInstanceStorageArgs.builder()
.oss(VvpInstanceStorageOssArgs.builder()
.bucket(default_.buckets()[0].name())
.build())
.build())
.vpcId(defaultNetwork.id())
.vswitchIds(defaultSwitch.id())
.resourceSpec(VvpInstanceResourceSpecArgs.builder()
.cpu(8)
.memoryGb(32)
.build())
.paymentType("PayAsYouGo")
.zoneId(defaultSwitch.zoneId())
.build());
var defaultVariable = new Variable("defaultVariable", VariableArgs.builder()
.name(name)
.namespace(defaultVvpInstance.vvpInstanceName().applyValue(_vvpInstanceName -> String.format("%s-default", _vvpInstanceName)))
.workspace(defaultVvpInstance.resourceId())
.kind("Clear")
.value("YourPassword123!")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultNetwork:
type: alicloud:vpc:Network
name: default
properties:
isDefault: false
cidrBlock: 172.16.0.0/16
vpcName: ${name}
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
isDefault: false
vpcId: ${defaultNetwork.id}
zoneId: cn-hangzhou-i
cidrBlock: 172.16.0.0/24
vswitchName: ${name}
defaultVvpInstance:
type: alicloud:realtimecompute:VvpInstance
name: default
properties:
vvpInstanceName: ${name}
storage:
oss:
bucket: ${default.buckets[0].name}
vpcId: ${defaultNetwork.id}
vswitchIds:
- ${defaultSwitch.id}
resourceSpec:
cpu: '8'
memoryGb: '32'
paymentType: PayAsYouGo
zoneId: ${defaultSwitch.zoneId}
defaultVariable:
type: alicloud:realtimecompute:Variable
name: default
properties:
name: ${name}
namespace: ${defaultVvpInstance.vvpInstanceName}-default
workspace: ${defaultVvpInstance.resourceId}
kind: Clear
value: YourPassword123!
variables:
default:
fn::invoke:
function: alicloud:oss:getBuckets
arguments: {}
terraform {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_oss_buckets" "default" {
}
resource "alicloud_vpc_network" "default" {
lifecycle {
create_before_destroy = true
}
is_default = false
cidr_block = "172.16.0.0/16"
vpc_name = var.name
}
resource "alicloud_vpc_switch" "default" {
lifecycle {
create_before_destroy = true
}
is_default = false
vpc_id = alicloud_vpc_network.default.id
zone_id = "cn-hangzhou-i"
cidr_block = "172.16.0.0/24"
vswitch_name = var.name
}
resource "alicloud_realtimecompute_vvp_instance" "default" {
lifecycle {
create_before_destroy = true
}
vvp_instance_name = var.name
storage = {
oss = {
bucket = data.alicloud_oss_buckets.default.buckets[0].name
}
}
vpc_id = alicloud_vpc_network.default.id
vswitch_ids = [alicloud_vpc_switch.default.id]
resource_spec = {
cpu = "8"
memory_gb = "32"
}
payment_type = "PayAsYouGo"
zone_id = alicloud_vpc_switch.default.zone_id
}
resource "alicloud_realtimecompute_variable" "default" {
lifecycle {
create_before_destroy = true
}
name = var.name
namespace ="${alicloud_realtimecompute_vvp_instance.default.vvp_instance_name}-default"
workspace = alicloud_realtimecompute_vvp_instance.default.resource_id
kind = "Clear"
value = "YourPassword123!"
}
variable "name" {
type = string
default = "terraform-example"
}
📚 Need more examples? VIEW MORE EXAMPLES
Create Variable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Variable(name: string, args: VariableArgs, opts?: CustomResourceOptions);@overload
def Variable(resource_name: str,
args: VariableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Variable(resource_name: str,
opts: Optional[ResourceOptions] = None,
kind: Optional[str] = None,
namespace: Optional[str] = None,
value: Optional[str] = None,
workspace: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None)func NewVariable(ctx *Context, name string, args VariableArgs, opts ...ResourceOption) (*Variable, error)public Variable(string name, VariableArgs args, CustomResourceOptions? opts = null)
public Variable(String name, VariableArgs args)
public Variable(String name, VariableArgs args, CustomResourceOptions options)
type: alicloud:realtimecompute:Variable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "alicloud_realtimecompute_variable" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args VariableArgs
- 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 VariableArgs
- 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 VariableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VariableArgs
- 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 variableResource = new AliCloud.RealtimeCompute.Variable("variableResource", new()
{
Kind = "string",
Namespace = "string",
Value = "string",
Workspace = "string",
Description = "string",
Name = "string",
});
example, err := realtimecompute.NewVariable(ctx, "variableResource", &realtimecompute.VariableArgs{
Kind: pulumi.String("string"),
Namespace: pulumi.String("string"),
Value: pulumi.String("string"),
Workspace: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
resource "alicloud_realtimecompute_variable" "variableResource" {
lifecycle {
create_before_destroy = true
}
kind = "string"
namespace = "string"
value = "string"
workspace = "string"
description = "string"
name = "string"
}
var variableResource = new Variable("variableResource", VariableArgs.builder()
.kind("string")
.namespace("string")
.value("string")
.workspace("string")
.description("string")
.name("string")
.build());
variable_resource = alicloud.realtimecompute.Variable("variableResource",
kind="string",
namespace="string",
value="string",
workspace="string",
description="string",
name="string")
const variableResource = new alicloud.realtimecompute.Variable("variableResource", {
kind: "string",
namespace: "string",
value: "string",
workspace: "string",
description: "string",
name: "string",
});
type: alicloud:realtimecompute:Variable
properties:
description: string
kind: string
name: string
namespace: string
value: string
workspace: string
Variable 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 Variable resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the Variable 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 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 Variable Resource
Get an existing Variable 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?: VariableState, opts?: CustomResourceOptions): Variable@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
kind: Optional[str] = None,
name: Optional[str] = None,
namespace: Optional[str] = None,
value: Optional[str] = None,
workspace: Optional[str] = None) -> Variablefunc GetVariable(ctx *Context, name string, id IDInput, state *VariableState, opts ...ResourceOption) (*Variable, error)public static Variable Get(string name, Input<string> id, VariableState? state, CustomResourceOptions? opts = null)public static Variable get(String name, Output<String> id, VariableState state, CustomResourceOptions options)resources: _: type: alicloud:realtimecompute:Variable get: id: ${id}import {
to = alicloud_realtimecompute_variable.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.
Import
Realtime Compute Variable can be imported using the id, e.g.
$ pulumi import alicloud:realtimecompute/variable:Variable example <workspace>:<namespace>:<name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Tuesday, Oct 27, 2026 by Pulumi