alicloud.mse.Znode
Provides a Microservice Engine (MSE) Znode resource.
For information about Microservice Engine (MSE) Znode and how to use it, see What is Znode.
NOTE: Available in v1.162.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var defaultZones = AliCloud.MongoDB.GetZones.Invoke();
var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
{
NameRegex = "default-NODELETING",
});
var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
{
VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
var defaultCluster = new AliCloud.Mse.Cluster("defaultCluster", new()
{
ClusterSpecification = "MSE_SC_1_2_200_c",
ClusterType = "ZooKeeper",
ClusterVersion = "ZooKeeper_3_5_5",
InstanceCount = 1,
NetType = "privatenet",
VswitchId = defaultSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
PubNetworkFlow = "1",
AclEntryLists = new[]
{
"127.0.0.1/32",
},
ClusterAliasName = "example_value",
});
var defaultZnode = new AliCloud.Mse.Znode("defaultZnode", new()
{
ClusterId = defaultCluster.ClusterId,
Data = "example_value",
Path = "example_value",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mongodb"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mse"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultZones, err := mongodb.GetZones(ctx, nil, nil)
if err != nil {
return err
}
defaultNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
NameRegex: pulumi.StringRef("default-NODELETING"),
}, nil)
if err != nil {
return err
}
defaultSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
VpcId: pulumi.StringRef(defaultNetworks.Ids[0]),
ZoneId: pulumi.StringRef(defaultZones.Zones[0].Id),
}, nil)
if err != nil {
return err
}
defaultCluster, err := mse.NewCluster(ctx, "defaultCluster", &mse.ClusterArgs{
ClusterSpecification: pulumi.String("MSE_SC_1_2_200_c"),
ClusterType: pulumi.String("ZooKeeper"),
ClusterVersion: pulumi.String("ZooKeeper_3_5_5"),
InstanceCount: pulumi.Int(1),
NetType: pulumi.String("privatenet"),
VswitchId: *pulumi.String(defaultSwitches.Ids[0]),
PubNetworkFlow: pulumi.String("1"),
AclEntryLists: pulumi.StringArray{
pulumi.String("127.0.0.1/32"),
},
ClusterAliasName: pulumi.String("example_value"),
})
if err != nil {
return err
}
_, err = mse.NewZnode(ctx, "defaultZnode", &mse.ZnodeArgs{
ClusterId: defaultCluster.ClusterId,
Data: pulumi.String("example_value"),
Path: pulumi.String("example_value"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mongodb.MongodbFunctions;
import com.pulumi.alicloud.mongodb.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
import com.pulumi.alicloud.mse.Cluster;
import com.pulumi.alicloud.mse.ClusterArgs;
import com.pulumi.alicloud.mse.Znode;
import com.pulumi.alicloud.mse.ZnodeArgs;
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 defaultZones = MongodbFunctions.getZones();
final var defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
.nameRegex("default-NODELETING")
.build());
final var defaultSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
.vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.clusterSpecification("MSE_SC_1_2_200_c")
.clusterType("ZooKeeper")
.clusterVersion("ZooKeeper_3_5_5")
.instanceCount(1)
.netType("privatenet")
.vswitchId(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
.pubNetworkFlow("1")
.aclEntryLists("127.0.0.1/32")
.clusterAliasName("example_value")
.build());
var defaultZnode = new Znode("defaultZnode", ZnodeArgs.builder()
.clusterId(defaultCluster.clusterId())
.data("example_value")
.path("example_value")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
default_zones = alicloud.mongodb.get_zones()
default_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
zone_id=default_zones.zones[0].id)
default_cluster = alicloud.mse.Cluster("defaultCluster",
cluster_specification="MSE_SC_1_2_200_c",
cluster_type="ZooKeeper",
cluster_version="ZooKeeper_3_5_5",
instance_count=1,
net_type="privatenet",
vswitch_id=default_switches.ids[0],
pub_network_flow="1",
acl_entry_lists=["127.0.0.1/32"],
cluster_alias_name="example_value")
default_znode = alicloud.mse.Znode("defaultZnode",
cluster_id=default_cluster.cluster_id,
data="example_value",
path="example_value")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const defaultZones = alicloud.mongodb.getZones({});
const defaultNetworks = alicloud.vpc.getNetworks({
nameRegex: "default-NODELETING",
});
const defaultSwitches = Promise.all([defaultNetworks, defaultZones]).then(([defaultNetworks, defaultZones]) => alicloud.vpc.getSwitches({
vpcId: defaultNetworks.ids?.[0],
zoneId: defaultZones.zones?.[0]?.id,
}));
const defaultCluster = new alicloud.mse.Cluster("defaultCluster", {
clusterSpecification: "MSE_SC_1_2_200_c",
clusterType: "ZooKeeper",
clusterVersion: "ZooKeeper_3_5_5",
instanceCount: 1,
netType: "privatenet",
vswitchId: defaultSwitches.then(defaultSwitches => defaultSwitches.ids?.[0]),
pubNetworkFlow: "1",
aclEntryLists: ["127.0.0.1/32"],
clusterAliasName: "example_value",
});
const defaultZnode = new alicloud.mse.Znode("defaultZnode", {
clusterId: defaultCluster.clusterId,
data: "example_value",
path: "example_value",
});
resources:
defaultCluster:
type: alicloud:mse:Cluster
properties:
clusterSpecification: MSE_SC_1_2_200_c
clusterType: ZooKeeper
clusterVersion: ZooKeeper_3_5_5
instanceCount: 1
netType: privatenet
vswitchId: ${defaultSwitches.ids[0]}
pubNetworkFlow: '1'
aclEntryLists:
- 127.0.0.1/32
clusterAliasName: example_value
defaultZnode:
type: alicloud:mse:Znode
properties:
clusterId: ${defaultCluster.clusterId}
data: example_value
path: example_value
variables:
defaultZones:
fn::invoke:
Function: alicloud:mongodb:getZones
Arguments: {}
defaultNetworks:
fn::invoke:
Function: alicloud:vpc:getNetworks
Arguments:
nameRegex: default-NODELETING
defaultSwitches:
fn::invoke:
Function: alicloud:vpc:getSwitches
Arguments:
vpcId: ${defaultNetworks.ids[0]}
zoneId: ${defaultZones.zones[0].id}
Create Znode Resource
new Znode(name: string, args: ZnodeArgs, opts?: CustomResourceOptions);
@overload
def Znode(resource_name: str,
opts: Optional[ResourceOptions] = None,
accept_language: Optional[str] = None,
cluster_id: Optional[str] = None,
data: Optional[str] = None,
path: Optional[str] = None)
@overload
def Znode(resource_name: str,
args: ZnodeArgs,
opts: Optional[ResourceOptions] = None)
func NewZnode(ctx *Context, name string, args ZnodeArgs, opts ...ResourceOption) (*Znode, error)
public Znode(string name, ZnodeArgs args, CustomResourceOptions? opts = null)
type: alicloud:mse:Znode
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZnodeArgs
- 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 ZnodeArgs
- 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 ZnodeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZnodeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ZnodeArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Znode 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 Znode resource accepts the following input properties:
- Cluster
Id string The ID of the Cluster.
- Path string
The Node path. The value must start with a forward slash (/).
- Accept
Language string The language type of the returned information. Valid values:
zh
oren
.- Data string
The Node data.
- Cluster
Id string The ID of the Cluster.
- Path string
The Node path. The value must start with a forward slash (/).
- Accept
Language string The language type of the returned information. Valid values:
zh
oren
.- Data string
The Node data.
- cluster
Id String The ID of the Cluster.
- path String
The Node path. The value must start with a forward slash (/).
- accept
Language String The language type of the returned information. Valid values:
zh
oren
.- data String
The Node data.
- cluster
Id string The ID of the Cluster.
- path string
The Node path. The value must start with a forward slash (/).
- accept
Language string The language type of the returned information. Valid values:
zh
oren
.- data string
The Node data.
- cluster_
id str The ID of the Cluster.
- path str
The Node path. The value must start with a forward slash (/).
- accept_
language str The language type of the returned information. Valid values:
zh
oren
.- data str
The Node data.
- cluster
Id String The ID of the Cluster.
- path String
The Node path. The value must start with a forward slash (/).
- accept
Language String The language type of the returned information. Valid values:
zh
oren
.- data String
The Node data.
Outputs
All input properties are implicitly available as output properties. Additionally, the Znode resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing Znode Resource
Get an existing Znode 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?: ZnodeState, opts?: CustomResourceOptions): Znode
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
accept_language: Optional[str] = None,
cluster_id: Optional[str] = None,
data: Optional[str] = None,
path: Optional[str] = None) -> Znode
func GetZnode(ctx *Context, name string, id IDInput, state *ZnodeState, opts ...ResourceOption) (*Znode, error)
public static Znode Get(string name, Input<string> id, ZnodeState? state, CustomResourceOptions? opts = null)
public static Znode get(String name, Output<String> id, ZnodeState 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.
- Accept
Language string The language type of the returned information. Valid values:
zh
oren
.- Cluster
Id string The ID of the Cluster.
- Data string
The Node data.
- Path string
The Node path. The value must start with a forward slash (/).
- Accept
Language string The language type of the returned information. Valid values:
zh
oren
.- Cluster
Id string The ID of the Cluster.
- Data string
The Node data.
- Path string
The Node path. The value must start with a forward slash (/).
- accept
Language String The language type of the returned information. Valid values:
zh
oren
.- cluster
Id String The ID of the Cluster.
- data String
The Node data.
- path String
The Node path. The value must start with a forward slash (/).
- accept
Language string The language type of the returned information. Valid values:
zh
oren
.- cluster
Id string The ID of the Cluster.
- data string
The Node data.
- path string
The Node path. The value must start with a forward slash (/).
- accept_
language str The language type of the returned information. Valid values:
zh
oren
.- cluster_
id str The ID of the Cluster.
- data str
The Node data.
- path str
The Node path. The value must start with a forward slash (/).
- accept
Language String The language type of the returned information. Valid values:
zh
oren
.- cluster
Id String The ID of the Cluster.
- data String
The Node data.
- path String
The Node path. The value must start with a forward slash (/).
Import
Microservice Engine (MSE) Znode can be imported using the id, e.g.
$ pulumi import alicloud:mse/znode:Znode example <cluster_id>:<path>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.