alicloud.mse.getEngineNamespaces
Explore with Pulumi AI
This data source provides the Mse Engine Namespaces of the current Alibaba Cloud user.
NOTE: Available since v1.166.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const exampleNetwork = new alicloud.vpc.Network("example", {
vpcName: "terraform-example",
cidrBlock: "172.17.3.0/24",
});
const exampleSwitch = new alicloud.vpc.Switch("example", {
vswitchName: "terraform-example",
cidrBlock: "172.17.3.0/24",
vpcId: exampleNetwork.id,
zoneId: example.then(example => example.zones?.[0]?.id),
});
const exampleCluster = new alicloud.mse.Cluster("example", {
clusterSpecification: "MSE_SC_1_2_60_c",
clusterType: "Nacos-Ans",
clusterVersion: "NACOS_2_0_0",
instanceCount: 3,
netType: "privatenet",
pubNetworkFlow: "1",
connectionType: "slb",
clusterAliasName: "terraform-example",
mseVersion: "mse_pro",
vswitchId: exampleSwitch.id,
vpcId: exampleNetwork.id,
});
const exampleEngineNamespace = new alicloud.mse.EngineNamespace("example", {
instanceId: exampleCluster.id,
namespaceShowName: "terraform-example",
namespaceId: "terraform-example",
namespaceDesc: "description",
});
// Declare the data source
const exampleGetEngineNamespaces = alicloud.mse.getEngineNamespacesOutput({
instanceId: exampleEngineNamespace.instanceId,
});
export const mseEngineNamespaceIdPublic = exampleGetEngineNamespaces.apply(exampleGetEngineNamespaces => exampleGetEngineNamespaces.namespaces?.[0]?.id);
export const mseEngineNamespaceIdExample = exampleGetEngineNamespaces.apply(exampleGetEngineNamespaces => exampleGetEngineNamespaces.namespaces?.[1]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.get_zones(available_resource_creation="VSwitch")
example_network = alicloud.vpc.Network("example",
vpc_name="terraform-example",
cidr_block="172.17.3.0/24")
example_switch = alicloud.vpc.Switch("example",
vswitch_name="terraform-example",
cidr_block="172.17.3.0/24",
vpc_id=example_network.id,
zone_id=example.zones[0].id)
example_cluster = alicloud.mse.Cluster("example",
cluster_specification="MSE_SC_1_2_60_c",
cluster_type="Nacos-Ans",
cluster_version="NACOS_2_0_0",
instance_count=3,
net_type="privatenet",
pub_network_flow="1",
connection_type="slb",
cluster_alias_name="terraform-example",
mse_version="mse_pro",
vswitch_id=example_switch.id,
vpc_id=example_network.id)
example_engine_namespace = alicloud.mse.EngineNamespace("example",
instance_id=example_cluster.id,
namespace_show_name="terraform-example",
namespace_id="terraform-example",
namespace_desc="description")
# Declare the data source
example_get_engine_namespaces = alicloud.mse.get_engine_namespaces_output(instance_id=example_engine_namespace.instance_id)
pulumi.export("mseEngineNamespaceIdPublic", example_get_engine_namespaces.namespaces[0].id)
pulumi.export("mseEngineNamespaceIdExample", example_get_engine_namespaces.namespaces[1].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"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 {
example, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
exampleNetwork, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.17.3.0/24"),
})
if err != nil {
return err
}
exampleSwitch, err := vpc.NewSwitch(ctx, "example", &vpc.SwitchArgs{
VswitchName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.17.3.0/24"),
VpcId: exampleNetwork.ID(),
ZoneId: pulumi.String(example.Zones[0].Id),
})
if err != nil {
return err
}
exampleCluster, err := mse.NewCluster(ctx, "example", &mse.ClusterArgs{
ClusterSpecification: pulumi.String("MSE_SC_1_2_60_c"),
ClusterType: pulumi.String("Nacos-Ans"),
ClusterVersion: pulumi.String("NACOS_2_0_0"),
InstanceCount: pulumi.Int(3),
NetType: pulumi.String("privatenet"),
PubNetworkFlow: pulumi.String("1"),
ConnectionType: pulumi.String("slb"),
ClusterAliasName: pulumi.String("terraform-example"),
MseVersion: pulumi.String("mse_pro"),
VswitchId: exampleSwitch.ID(),
VpcId: exampleNetwork.ID(),
})
if err != nil {
return err
}
exampleEngineNamespace, err := mse.NewEngineNamespace(ctx, "example", &mse.EngineNamespaceArgs{
InstanceId: exampleCluster.ID(),
NamespaceShowName: pulumi.String("terraform-example"),
NamespaceId: pulumi.String("terraform-example"),
NamespaceDesc: pulumi.String("description"),
})
if err != nil {
return err
}
// Declare the data source
exampleGetEngineNamespaces := mse.GetEngineNamespacesOutput(ctx, mse.GetEngineNamespacesOutputArgs{
InstanceId: exampleEngineNamespace.InstanceId,
}, nil)
ctx.Export("mseEngineNamespaceIdPublic", exampleGetEngineNamespaces.ApplyT(func(exampleGetEngineNamespaces mse.GetEngineNamespacesResult) (*string, error) {
return &exampleGetEngineNamespaces.Namespaces[0].Id, nil
}).(pulumi.StringPtrOutput))
ctx.Export("mseEngineNamespaceIdExample", exampleGetEngineNamespaces.ApplyT(func(exampleGetEngineNamespaces mse.GetEngineNamespacesResult) (*string, error) {
return &exampleGetEngineNamespaces.Namespaces[1].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var exampleNetwork = new AliCloud.Vpc.Network("example", new()
{
VpcName = "terraform-example",
CidrBlock = "172.17.3.0/24",
});
var exampleSwitch = new AliCloud.Vpc.Switch("example", new()
{
VswitchName = "terraform-example",
CidrBlock = "172.17.3.0/24",
VpcId = exampleNetwork.Id,
ZoneId = example.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
var exampleCluster = new AliCloud.Mse.Cluster("example", new()
{
ClusterSpecification = "MSE_SC_1_2_60_c",
ClusterType = "Nacos-Ans",
ClusterVersion = "NACOS_2_0_0",
InstanceCount = 3,
NetType = "privatenet",
PubNetworkFlow = "1",
ConnectionType = "slb",
ClusterAliasName = "terraform-example",
MseVersion = "mse_pro",
VswitchId = exampleSwitch.Id,
VpcId = exampleNetwork.Id,
});
var exampleEngineNamespace = new AliCloud.Mse.EngineNamespace("example", new()
{
InstanceId = exampleCluster.Id,
NamespaceShowName = "terraform-example",
NamespaceId = "terraform-example",
NamespaceDesc = "description",
});
// Declare the data source
var exampleGetEngineNamespaces = AliCloud.Mse.GetEngineNamespaces.Invoke(new()
{
InstanceId = exampleEngineNamespace.InstanceId,
});
return new Dictionary<string, object?>
{
["mseEngineNamespaceIdPublic"] = exampleGetEngineNamespaces.Apply(getEngineNamespacesResult => getEngineNamespacesResult.Namespaces[0]?.Id),
["mseEngineNamespaceIdExample"] = exampleGetEngineNamespaces.Apply(getEngineNamespacesResult => getEngineNamespacesResult.Namespaces[1]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
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.mse.Cluster;
import com.pulumi.alicloud.mse.ClusterArgs;
import com.pulumi.alicloud.mse.EngineNamespace;
import com.pulumi.alicloud.mse.EngineNamespaceArgs;
import com.pulumi.alicloud.mse.MseFunctions;
import com.pulumi.alicloud.mse.inputs.GetEngineNamespacesArgs;
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 example = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.17.3.0/24")
.build());
var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
.vswitchName("terraform-example")
.cidrBlock("172.17.3.0/24")
.vpcId(exampleNetwork.id())
.zoneId(example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
.clusterSpecification("MSE_SC_1_2_60_c")
.clusterType("Nacos-Ans")
.clusterVersion("NACOS_2_0_0")
.instanceCount(3)
.netType("privatenet")
.pubNetworkFlow("1")
.connectionType("slb")
.clusterAliasName("terraform-example")
.mseVersion("mse_pro")
.vswitchId(exampleSwitch.id())
.vpcId(exampleNetwork.id())
.build());
var exampleEngineNamespace = new EngineNamespace("exampleEngineNamespace", EngineNamespaceArgs.builder()
.instanceId(exampleCluster.id())
.namespaceShowName("terraform-example")
.namespaceId("terraform-example")
.namespaceDesc("description")
.build());
// Declare the data source
final var exampleGetEngineNamespaces = MseFunctions.getEngineNamespaces(GetEngineNamespacesArgs.builder()
.instanceId(exampleEngineNamespace.instanceId())
.build());
ctx.export("mseEngineNamespaceIdPublic", exampleGetEngineNamespaces.applyValue(getEngineNamespacesResult -> getEngineNamespacesResult).applyValue(exampleGetEngineNamespaces -> exampleGetEngineNamespaces.applyValue(getEngineNamespacesResult -> getEngineNamespacesResult.namespaces()[0].id())));
ctx.export("mseEngineNamespaceIdExample", exampleGetEngineNamespaces.applyValue(getEngineNamespacesResult -> getEngineNamespacesResult).applyValue(exampleGetEngineNamespaces -> exampleGetEngineNamespaces.applyValue(getEngineNamespacesResult -> getEngineNamespacesResult.namespaces()[1].id())));
}
}
resources:
exampleNetwork:
type: alicloud:vpc:Network
name: example
properties:
vpcName: terraform-example
cidrBlock: 172.17.3.0/24
exampleSwitch:
type: alicloud:vpc:Switch
name: example
properties:
vswitchName: terraform-example
cidrBlock: 172.17.3.0/24
vpcId: ${exampleNetwork.id}
zoneId: ${example.zones[0].id}
exampleCluster:
type: alicloud:mse:Cluster
name: example
properties:
clusterSpecification: MSE_SC_1_2_60_c
clusterType: Nacos-Ans
clusterVersion: NACOS_2_0_0
instanceCount: 3
netType: privatenet
pubNetworkFlow: '1'
connectionType: slb
clusterAliasName: terraform-example
mseVersion: mse_pro
vswitchId: ${exampleSwitch.id}
vpcId: ${exampleNetwork.id}
exampleEngineNamespace:
type: alicloud:mse:EngineNamespace
name: example
properties:
instanceId: ${exampleCluster.id}
namespaceShowName: terraform-example
namespaceId: terraform-example
namespaceDesc: description
variables:
example:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
# Declare the data source
exampleGetEngineNamespaces:
fn::invoke:
Function: alicloud:mse:getEngineNamespaces
Arguments:
instanceId: ${exampleEngineNamespace.instanceId}
outputs:
mseEngineNamespaceIdPublic: ${exampleGetEngineNamespaces.namespaces[0].id}
mseEngineNamespaceIdExample: ${exampleGetEngineNamespaces.namespaces[1].id}
Using getEngineNamespaces
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getEngineNamespaces(args: GetEngineNamespacesArgs, opts?: InvokeOptions): Promise<GetEngineNamespacesResult>
function getEngineNamespacesOutput(args: GetEngineNamespacesOutputArgs, opts?: InvokeOptions): Output<GetEngineNamespacesResult>
def get_engine_namespaces(accept_language: Optional[str] = None,
cluster_id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
instance_id: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetEngineNamespacesResult
def get_engine_namespaces_output(accept_language: Optional[pulumi.Input[str]] = None,
cluster_id: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
instance_id: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetEngineNamespacesResult]
func GetEngineNamespaces(ctx *Context, args *GetEngineNamespacesArgs, opts ...InvokeOption) (*GetEngineNamespacesResult, error)
func GetEngineNamespacesOutput(ctx *Context, args *GetEngineNamespacesOutputArgs, opts ...InvokeOption) GetEngineNamespacesResultOutput
> Note: This function is named GetEngineNamespaces
in the Go SDK.
public static class GetEngineNamespaces
{
public static Task<GetEngineNamespacesResult> InvokeAsync(GetEngineNamespacesArgs args, InvokeOptions? opts = null)
public static Output<GetEngineNamespacesResult> Invoke(GetEngineNamespacesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEngineNamespacesResult> getEngineNamespaces(GetEngineNamespacesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:mse/getEngineNamespaces:getEngineNamespaces
arguments:
# arguments dictionary
The following arguments are supported:
- Accept
Language string - The language type of the returned information. Valid values:
zh
,en
. - Cluster
Id string - The ID of the cluster.
- Ids List<string>
- A list of Engine Namespace IDs. It is formatted to
<instance_id>:<namespace_id>
. - Instance
Id string - The ID of the MSE Cluster Instance.It is formatted to
mse-cn-xxxxxxxxxxx
.Available since v1.232.0 - Output
File string File name where to save data source results (after running
pulumi preview
).NOTE: You must set
cluster_id
orinstance_id
or both.
- Accept
Language string - The language type of the returned information. Valid values:
zh
,en
. - Cluster
Id string - The ID of the cluster.
- Ids []string
- A list of Engine Namespace IDs. It is formatted to
<instance_id>:<namespace_id>
. - Instance
Id string - The ID of the MSE Cluster Instance.It is formatted to
mse-cn-xxxxxxxxxxx
.Available since v1.232.0 - Output
File string File name where to save data source results (after running
pulumi preview
).NOTE: You must set
cluster_id
orinstance_id
or both.
- accept
Language String - The language type of the returned information. Valid values:
zh
,en
. - cluster
Id String - The ID of the cluster.
- ids List<String>
- A list of Engine Namespace IDs. It is formatted to
<instance_id>:<namespace_id>
. - instance
Id String - The ID of the MSE Cluster Instance.It is formatted to
mse-cn-xxxxxxxxxxx
.Available since v1.232.0 - output
File String File name where to save data source results (after running
pulumi preview
).NOTE: You must set
cluster_id
orinstance_id
or both.
- accept
Language string - The language type of the returned information. Valid values:
zh
,en
. - cluster
Id string - The ID of the cluster.
- ids string[]
- A list of Engine Namespace IDs. It is formatted to
<instance_id>:<namespace_id>
. - instance
Id string - The ID of the MSE Cluster Instance.It is formatted to
mse-cn-xxxxxxxxxxx
.Available since v1.232.0 - output
File string File name where to save data source results (after running
pulumi preview
).NOTE: You must set
cluster_id
orinstance_id
or both.
- accept_
language str - The language type of the returned information. Valid values:
zh
,en
. - cluster_
id str - The ID of the cluster.
- ids Sequence[str]
- A list of Engine Namespace IDs. It is formatted to
<instance_id>:<namespace_id>
. - instance_
id str - The ID of the MSE Cluster Instance.It is formatted to
mse-cn-xxxxxxxxxxx
.Available since v1.232.0 - output_
file str File name where to save data source results (after running
pulumi preview
).NOTE: You must set
cluster_id
orinstance_id
or both.
- accept
Language String - The language type of the returned information. Valid values:
zh
,en
. - cluster
Id String - The ID of the cluster.
- ids List<String>
- A list of Engine Namespace IDs. It is formatted to
<instance_id>:<namespace_id>
. - instance
Id String - The ID of the MSE Cluster Instance.It is formatted to
mse-cn-xxxxxxxxxxx
.Available since v1.232.0 - output
File String File name where to save data source results (after running
pulumi preview
).NOTE: You must set
cluster_id
orinstance_id
or both.
getEngineNamespaces Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Namespaces
List<Pulumi.
Ali Cloud. Mse. Outputs. Get Engine Namespaces Namespace> - A list of Mse Engine Namespaces. Each element contains the following attributes:
- Accept
Language string - Cluster
Id string - Instance
Id string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Namespaces
[]Get
Engine Namespaces Namespace - A list of Mse Engine Namespaces. Each element contains the following attributes:
- Accept
Language string - Cluster
Id string - Instance
Id string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- namespaces
List<Get
Engine Namespaces Namespace> - A list of Mse Engine Namespaces. Each element contains the following attributes:
- accept
Language String - cluster
Id String - instance
Id String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- namespaces
Get
Engine Namespaces Namespace[] - A list of Mse Engine Namespaces. Each element contains the following attributes:
- accept
Language string - cluster
Id string - instance
Id string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- namespaces
Sequence[Get
Engine Namespaces Namespace] - A list of Mse Engine Namespaces. Each element contains the following attributes:
- accept_
language str - cluster_
id str - instance_
id str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- namespaces List<Property Map>
- A list of Mse Engine Namespaces. Each element contains the following attributes:
- accept
Language String - cluster
Id String - instance
Id String - output
File String
Supporting Types
GetEngineNamespacesNamespace
- Config
Count int - The Number of Configuration of the Namespace.
- Id string
- The ID of the Engine Namespace. It is formatted to
<instance_id>:<namespace_id>
. - Namespace
Desc string - The description of the Namespace.
- Namespace
Id string - The id of Namespace.
- Namespace
Show stringName - The name of the Namespace.
- Quota int
- The Quota of the Namespace.
- Service
Count string - The number of active services.
- Type int
- The type of the Namespace, the value is as follows:
- '0': Global Configuration.
- '1': default namespace.
- '2': Custom Namespace.
- Config
Count int - The Number of Configuration of the Namespace.
- Id string
- The ID of the Engine Namespace. It is formatted to
<instance_id>:<namespace_id>
. - Namespace
Desc string - The description of the Namespace.
- Namespace
Id string - The id of Namespace.
- Namespace
Show stringName - The name of the Namespace.
- Quota int
- The Quota of the Namespace.
- Service
Count string - The number of active services.
- Type int
- The type of the Namespace, the value is as follows:
- '0': Global Configuration.
- '1': default namespace.
- '2': Custom Namespace.
- config
Count Integer - The Number of Configuration of the Namespace.
- id String
- The ID of the Engine Namespace. It is formatted to
<instance_id>:<namespace_id>
. - namespace
Desc String - The description of the Namespace.
- namespace
Id String - The id of Namespace.
- namespace
Show StringName - The name of the Namespace.
- quota Integer
- The Quota of the Namespace.
- service
Count String - The number of active services.
- type Integer
- The type of the Namespace, the value is as follows:
- '0': Global Configuration.
- '1': default namespace.
- '2': Custom Namespace.
- config
Count number - The Number of Configuration of the Namespace.
- id string
- The ID of the Engine Namespace. It is formatted to
<instance_id>:<namespace_id>
. - namespace
Desc string - The description of the Namespace.
- namespace
Id string - The id of Namespace.
- namespace
Show stringName - The name of the Namespace.
- quota number
- The Quota of the Namespace.
- service
Count string - The number of active services.
- type number
- The type of the Namespace, the value is as follows:
- '0': Global Configuration.
- '1': default namespace.
- '2': Custom Namespace.
- config_
count int - The Number of Configuration of the Namespace.
- id str
- The ID of the Engine Namespace. It is formatted to
<instance_id>:<namespace_id>
. - namespace_
desc str - The description of the Namespace.
- namespace_
id str - The id of Namespace.
- namespace_
show_ strname - The name of the Namespace.
- quota int
- The Quota of the Namespace.
- service_
count str - The number of active services.
- type int
- The type of the Namespace, the value is as follows:
- '0': Global Configuration.
- '1': default namespace.
- '2': Custom Namespace.
- config
Count Number - The Number of Configuration of the Namespace.
- id String
- The ID of the Engine Namespace. It is formatted to
<instance_id>:<namespace_id>
. - namespace
Desc String - The description of the Namespace.
- namespace
Id String - The id of Namespace.
- namespace
Show StringName - The name of the Namespace.
- quota Number
- The Quota of the Namespace.
- service
Count String - The number of active services.
- type Number
- The type of the Namespace, the value is as follows:
- '0': Global Configuration.
- '1': default namespace.
- '2': Custom Namespace.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.