Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Alibaba Cloud

v3.8.0 published on Monday, Oct 4, 2021 by Pulumi

getNamespaces

This data source provides the Sae Namespaces of the current Alibaba Cloud user.

NOTE: Available in v1.129.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var nameRegex = Output.Create(AliCloud.Sae.GetNamespaces.InvokeAsync(new AliCloud.Sae.GetNamespacesArgs
        {
            NameRegex = "^my-Namespace",
        }));
        this.SaeNamespaceId = nameRegex.Apply(nameRegex => nameRegex.Namespaces[0].Id);
    }

    [Output("saeNamespaceId")]
    public Output<string> SaeNamespaceId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sae"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "^my-Namespace"
		nameRegex, err := sae.GetNamespaces(ctx, &sae.GetNamespacesArgs{
			NameRegex: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("saeNamespaceId", nameRegex.Namespaces[0].Id)
		return nil
	})
}
import pulumi
import pulumi_alicloud as alicloud

name_regex = alicloud.sae.get_namespaces(name_regex="^my-Namespace")
pulumi.export("saeNamespaceId", name_regex.namespaces[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const nameRegex = alicloud.sae.getNamespaces({
    nameRegex: "^my-Namespace",
});
export const saeNamespaceId = nameRegex.then(nameRegex => nameRegex.namespaces[0].id);

Using getNamespaces

function getNamespaces(args: GetNamespacesArgs, opts?: InvokeOptions): Promise<GetNamespacesResult>
def get_namespaces(ids: Optional[Sequence[str]] = None,
                   name_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetNamespacesResult
func GetNamespaces(ctx *Context, args *GetNamespacesArgs, opts ...InvokeOption) (*GetNamespacesResult, error)

Note: This function is named GetNamespaces in the Go SDK.

public static class GetNamespaces {
    public static Task<GetNamespacesResult> InvokeAsync(GetNamespacesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Ids List<string>
A list of Namespace IDs.
NameRegex string
A regex string to filter results by Namespace name.
OutputFile string
Ids []string
A list of Namespace IDs.
NameRegex string
A regex string to filter results by Namespace name.
OutputFile string
ids string[]
A list of Namespace IDs.
nameRegex string
A regex string to filter results by Namespace name.
outputFile string
ids Sequence[str]
A list of Namespace IDs.
name_regex str
A regex string to filter results by Namespace name.
output_file str

getNamespaces Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
Namespaces List<Pulumi.AliCloud.Sae.Outputs.GetNamespacesNamespace>
NameRegex string
OutputFile string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
Namespaces []GetNamespacesNamespace
NameRegex string
OutputFile string
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
namespaces GetNamespacesNamespace[]
nameRegex string
outputFile string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
namespaces Sequence[GetNamespacesNamespace]
name_regex str
output_file str

Supporting Types

GetNamespacesNamespace

Id string
The ID of the Namespace.
NamespaceDescription string
The Description of Namespace.
NamespaceId string
The Id of Namespace.It can contain 2 to 32 characters.The value is in format {RegionId}:{namespace}.
NamespaceName string
The Name of Namespace.
Id string
The ID of the Namespace.
NamespaceDescription string
The Description of Namespace.
NamespaceId string
The Id of Namespace.It can contain 2 to 32 characters.The value is in format {RegionId}:{namespace}.
NamespaceName string
The Name of Namespace.
id string
The ID of the Namespace.
namespaceDescription string
The Description of Namespace.
namespaceId string
The Id of Namespace.It can contain 2 to 32 characters.The value is in format {RegionId}:{namespace}.
namespaceName string
The Name of Namespace.
id str
The ID of the Namespace.
namespace_description str
The Description of Namespace.
namespace_id str
The Id of Namespace.It can contain 2 to 32 characters.The value is in format {RegionId}:{namespace}.
namespace_name str
The Name of Namespace.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.