get Config Maps
This data source provides the Sae Config Maps of the current Alibaba Cloud user.
NOTE: Available in v1.130.0+.
Example Usage
Basic Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.sae.Namespace;
import com.pulumi.alicloud.sae.NamespaceArgs;
import com.pulumi.alicloud.sae.ConfigMap;
import com.pulumi.alicloud.sae.ConfigMapArgs;
import com.pulumi.alicloud.sae.SaeFunctions;
import com.pulumi.alicloud.sae.inputs.GetConfigMapsArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 configMapName = config.get("configMapName").orElse("examplename");
var exampleNamespace = new Namespace("exampleNamespace", NamespaceArgs.builder()
.namespaceId("cn-hangzhou:yourname")
.namespaceName("example_value")
.namespaceDescription("your_description")
.build());
var exampleConfigMap = new ConfigMap("exampleConfigMap", ConfigMapArgs.builder()
.data(serializeJson(
jsonObject(
jsonProperty("env.home", "/root"),
jsonProperty("env.shell", "/bin/sh")
)))
.namespaceId(exampleNamespace.namespaceId())
.build());
final var nameRegex = SaeFunctions.getConfigMaps(GetConfigMapsArgs.builder()
.namespaceId(exampleNamespace.namespaceId())
.nameRegex("^example")
.build());
ctx.export("saeConfigMapId", nameRegex.applyValue(getConfigMapsResult -> getConfigMapsResult).applyValue(nameRegex -> nameRegex.applyValue(getConfigMapsResult -> getConfigMapsResult.maps()[0].id())));
}
}
Content copied to clipboard
Return
A collection of values returned by getConfigMaps.
Parameters
argument
A collection of arguments for invoking getConfigMaps.
suspend fun getConfigMaps(ids: List<String>? = null, nameRegex: String? = null, namespaceId: String, outputFile: String? = null): GetConfigMapsResult
Return
A collection of values returned by getConfigMaps.
See also
Parameters
ids
A list of Config Map IDs.
name Regex
A regex string to filter results by Config Map name.
namespace Id
The NamespaceId of Config Maps.
output File
File name where to save data source results (after running pulumi preview
).
suspend fun getConfigMaps(argument: suspend GetConfigMapsPlainArgsBuilder.() -> Unit): GetConfigMapsResult
Return
A collection of values returned by getConfigMaps.
See also
Parameters
argument
Builder for com.pulumi.alicloud.sae.kotlin.inputs.GetConfigMapsPlainArgs.