1. Packages
  2. Alicloud Provider
  3. API Docs
  4. mse
  5. EngineNamespace
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.mse.EngineNamespace

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides a Microservice Engine (MSE) Engine Namespace resource.

    For information about Microservice Engine (MSE) Engine Namespace and how to use it, see What is Engine Namespace.

    NOTE: Available in v1.166.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") || "tf-example";
    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 _default = new alicloud.mse.Cluster("default", {
        connectionType: "slb",
        netType: "privatenet",
        vswitchId: exampleSwitch.id,
        clusterSpecification: "MSE_SC_1_2_60_c",
        clusterVersion: "NACOS_2_0_0",
        instanceCount: 1,
        pubNetworkFlow: "1",
        clusterAliasName: name,
        mseVersion: "mse_dev",
        clusterType: "Nacos-Ans",
    });
    const exampleEngineNamespace = new alicloud.mse.EngineNamespace("example", {
        clusterId: _default.id,
        namespaceShowName: name,
        namespaceId: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    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)
    default = alicloud.mse.Cluster("default",
        connection_type="slb",
        net_type="privatenet",
        vswitch_id=example_switch.id,
        cluster_specification="MSE_SC_1_2_60_c",
        cluster_version="NACOS_2_0_0",
        instance_count=1,
        pub_network_flow="1",
        cluster_alias_name=name,
        mse_version="mse_dev",
        cluster_type="Nacos-Ans")
    example_engine_namespace = alicloud.mse.EngineNamespace("example",
        cluster_id=default.id,
        namespace_show_name=name,
        namespace_id=name)
    
    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"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		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
    		}
    		_, err = mse.NewCluster(ctx, "default", &mse.ClusterArgs{
    			ConnectionType:       pulumi.String("slb"),
    			NetType:              pulumi.String("privatenet"),
    			VswitchId:            exampleSwitch.ID(),
    			ClusterSpecification: pulumi.String("MSE_SC_1_2_60_c"),
    			ClusterVersion:       pulumi.String("NACOS_2_0_0"),
    			InstanceCount:        pulumi.Int(1),
    			PubNetworkFlow:       pulumi.String("1"),
    			ClusterAliasName:     pulumi.String(name),
    			MseVersion:           pulumi.String("mse_dev"),
    			ClusterType:          pulumi.String("Nacos-Ans"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mse.NewEngineNamespace(ctx, "example", &mse.EngineNamespaceArgs{
    			ClusterId:         _default.ID(),
    			NamespaceShowName: pulumi.String(name),
    			NamespaceId:       pulumi.String(name),
    		})
    		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") ?? "tf-example";
        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 @default = new AliCloud.Mse.Cluster("default", new()
        {
            ConnectionType = "slb",
            NetType = "privatenet",
            VswitchId = exampleSwitch.Id,
            ClusterSpecification = "MSE_SC_1_2_60_c",
            ClusterVersion = "NACOS_2_0_0",
            InstanceCount = 1,
            PubNetworkFlow = "1",
            ClusterAliasName = name,
            MseVersion = "mse_dev",
            ClusterType = "Nacos-Ans",
        });
    
        var exampleEngineNamespace = new AliCloud.Mse.EngineNamespace("example", new()
        {
            ClusterId = @default.Id,
            NamespaceShowName = name,
            NamespaceId = name,
        });
    
    });
    
    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 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 name = config.get("name").orElse("tf-example");
            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 default_ = new Cluster("default", ClusterArgs.builder()
                .connectionType("slb")
                .netType("privatenet")
                .vswitchId(exampleSwitch.id())
                .clusterSpecification("MSE_SC_1_2_60_c")
                .clusterVersion("NACOS_2_0_0")
                .instanceCount("1")
                .pubNetworkFlow("1")
                .clusterAliasName(name)
                .mseVersion("mse_dev")
                .clusterType("Nacos-Ans")
                .build());
    
            var exampleEngineNamespace = new EngineNamespace("exampleEngineNamespace", EngineNamespaceArgs.builder()
                .clusterId(default_.id())
                .namespaceShowName(name)
                .namespaceId(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    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}
      default:
        type: alicloud:mse:Cluster
        properties:
          connectionType: slb
          netType: privatenet
          vswitchId: ${exampleSwitch.id}
          clusterSpecification: MSE_SC_1_2_60_c
          clusterVersion: NACOS_2_0_0
          instanceCount: '1'
          pubNetworkFlow: '1'
          clusterAliasName: ${name}
          mseVersion: mse_dev
          clusterType: Nacos-Ans
      exampleEngineNamespace:
        type: alicloud:mse:EngineNamespace
        name: example
        properties:
          clusterId: ${default.id}
          namespaceShowName: ${name}
          namespaceId: ${name}
    variables:
      example:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
    

    Create EngineNamespace Resource

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

    Constructor syntax

    new EngineNamespace(name: string, args: EngineNamespaceArgs, opts?: CustomResourceOptions);
    @overload
    def EngineNamespace(resource_name: str,
                        args: EngineNamespaceArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def EngineNamespace(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        cluster_id: Optional[str] = None,
                        namespace_id: Optional[str] = None,
                        namespace_show_name: Optional[str] = None,
                        accept_language: Optional[str] = None)
    func NewEngineNamespace(ctx *Context, name string, args EngineNamespaceArgs, opts ...ResourceOption) (*EngineNamespace, error)
    public EngineNamespace(string name, EngineNamespaceArgs args, CustomResourceOptions? opts = null)
    public EngineNamespace(String name, EngineNamespaceArgs args)
    public EngineNamespace(String name, EngineNamespaceArgs args, CustomResourceOptions options)
    
    type: alicloud:mse:EngineNamespace
    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 EngineNamespaceArgs
    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 EngineNamespaceArgs
    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 EngineNamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EngineNamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EngineNamespaceArgs
    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 engineNamespaceResource = new AliCloud.Mse.EngineNamespace("engineNamespaceResource", new()
    {
        ClusterId = "string",
        NamespaceId = "string",
        NamespaceShowName = "string",
        AcceptLanguage = "string",
    });
    
    example, err := mse.NewEngineNamespace(ctx, "engineNamespaceResource", &mse.EngineNamespaceArgs{
    	ClusterId:         pulumi.String("string"),
    	NamespaceId:       pulumi.String("string"),
    	NamespaceShowName: pulumi.String("string"),
    	AcceptLanguage:    pulumi.String("string"),
    })
    
    var engineNamespaceResource = new EngineNamespace("engineNamespaceResource", EngineNamespaceArgs.builder()
        .clusterId("string")
        .namespaceId("string")
        .namespaceShowName("string")
        .acceptLanguage("string")
        .build());
    
    engine_namespace_resource = alicloud.mse.EngineNamespace("engineNamespaceResource",
        cluster_id="string",
        namespace_id="string",
        namespace_show_name="string",
        accept_language="string")
    
    const engineNamespaceResource = new alicloud.mse.EngineNamespace("engineNamespaceResource", {
        clusterId: "string",
        namespaceId: "string",
        namespaceShowName: "string",
        acceptLanguage: "string",
    });
    
    type: alicloud:mse:EngineNamespace
    properties:
        acceptLanguage: string
        clusterId: string
        namespaceId: string
        namespaceShowName: string
    

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

    ClusterId string
    The id of the cluster.
    NamespaceId string
    The id of Namespace.
    NamespaceShowName string
    The name of the Engine Namespace.
    AcceptLanguage string
    The language type of the returned information. Valid values: zh, en.
    ClusterId string
    The id of the cluster.
    NamespaceId string
    The id of Namespace.
    NamespaceShowName string
    The name of the Engine Namespace.
    AcceptLanguage string
    The language type of the returned information. Valid values: zh, en.
    clusterId String
    The id of the cluster.
    namespaceId String
    The id of Namespace.
    namespaceShowName String
    The name of the Engine Namespace.
    acceptLanguage String
    The language type of the returned information. Valid values: zh, en.
    clusterId string
    The id of the cluster.
    namespaceId string
    The id of Namespace.
    namespaceShowName string
    The name of the Engine Namespace.
    acceptLanguage string
    The language type of the returned information. Valid values: zh, en.
    cluster_id str
    The id of the cluster.
    namespace_id str
    The id of Namespace.
    namespace_show_name str
    The name of the Engine Namespace.
    accept_language str
    The language type of the returned information. Valid values: zh, en.
    clusterId String
    The id of the cluster.
    namespaceId String
    The id of Namespace.
    namespaceShowName String
    The name of the Engine Namespace.
    acceptLanguage String
    The language type of the returned information. Valid values: zh, en.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EngineNamespace 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 EngineNamespace Resource

    Get an existing EngineNamespace 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?: EngineNamespaceState, opts?: CustomResourceOptions): EngineNamespace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accept_language: Optional[str] = None,
            cluster_id: Optional[str] = None,
            namespace_id: Optional[str] = None,
            namespace_show_name: Optional[str] = None) -> EngineNamespace
    func GetEngineNamespace(ctx *Context, name string, id IDInput, state *EngineNamespaceState, opts ...ResourceOption) (*EngineNamespace, error)
    public static EngineNamespace Get(string name, Input<string> id, EngineNamespaceState? state, CustomResourceOptions? opts = null)
    public static EngineNamespace get(String name, Output<String> id, EngineNamespaceState 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:
    AcceptLanguage string
    The language type of the returned information. Valid values: zh, en.
    ClusterId string
    The id of the cluster.
    NamespaceId string
    The id of Namespace.
    NamespaceShowName string
    The name of the Engine Namespace.
    AcceptLanguage string
    The language type of the returned information. Valid values: zh, en.
    ClusterId string
    The id of the cluster.
    NamespaceId string
    The id of Namespace.
    NamespaceShowName string
    The name of the Engine Namespace.
    acceptLanguage String
    The language type of the returned information. Valid values: zh, en.
    clusterId String
    The id of the cluster.
    namespaceId String
    The id of Namespace.
    namespaceShowName String
    The name of the Engine Namespace.
    acceptLanguage string
    The language type of the returned information. Valid values: zh, en.
    clusterId string
    The id of the cluster.
    namespaceId string
    The id of Namespace.
    namespaceShowName string
    The name of the Engine Namespace.
    accept_language str
    The language type of the returned information. Valid values: zh, en.
    cluster_id str
    The id of the cluster.
    namespace_id str
    The id of Namespace.
    namespace_show_name str
    The name of the Engine Namespace.
    acceptLanguage String
    The language type of the returned information. Valid values: zh, en.
    clusterId String
    The id of the cluster.
    namespaceId String
    The id of Namespace.
    namespaceShowName String
    The name of the Engine Namespace.

    Import

    Microservice Engine (MSE) Engine Namespace can be imported using the id, e.g.

    $ pulumi import alicloud:mse/engineNamespace:EngineNamespace example <cluster_id>:<namespace_id>
    

    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 alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi