Google Cloud v8.21.0 published on Wednesday, Mar 5, 2025 by Pulumi
gcp.composer.getUserWorkloadsConfigMap
Explore with Pulumi AI
Provides access to Kubernetes ConfigMap configuration for a given project, region and Composer Environment.
To get more information about Composer User Workloads Config Map, see:
- API documentation
- How-to Guides
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const exampleEnvironment = new gcp.composer.Environment("example", {
    name: "example-environment",
    config: {
        softwareConfig: {
            imageVersion: "composer-3-airflow-2",
        },
    },
});
const exampleUserWorkloadsConfigMap = new gcp.composer.UserWorkloadsConfigMap("example", {
    environment: exampleEnvironment.name,
    name: "example-config-map",
    data: {
        db_host: "dbhost:5432",
        api_host: "apihost:443",
    },
});
const example = exampleEnvironment.name.apply(name => gcp.composer.getUserWorkloadsConfigMapOutput({
    environment: name,
    name: googleComposerUserWorkloadsConfigMap.example.name,
}));
export const debug = example;
import pulumi
import pulumi_gcp as gcp
example_environment = gcp.composer.Environment("example",
    name="example-environment",
    config={
        "software_config": {
            "image_version": "composer-3-airflow-2",
        },
    })
example_user_workloads_config_map = gcp.composer.UserWorkloadsConfigMap("example",
    environment=example_environment.name,
    name="example-config-map",
    data={
        "db_host": "dbhost:5432",
        "api_host": "apihost:443",
    })
example = example_environment.name.apply(lambda name: gcp.composer.get_user_workloads_config_map_output(environment=name,
    name=google_composer_user_workloads_config_map["example"]["name"]))
pulumi.export("debug", example)
package main
import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/composer"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleEnvironment, err := composer.NewEnvironment(ctx, "example", &composer.EnvironmentArgs{
			Name: pulumi.String("example-environment"),
			Config: &composer.EnvironmentConfigArgs{
				SoftwareConfig: &composer.EnvironmentConfigSoftwareConfigArgs{
					ImageVersion: pulumi.String("composer-3-airflow-2"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = composer.NewUserWorkloadsConfigMap(ctx, "example", &composer.UserWorkloadsConfigMapArgs{
			Environment: exampleEnvironment.Name,
			Name:        pulumi.String("example-config-map"),
			Data: pulumi.StringMap{
				"db_host":  pulumi.String("dbhost:5432"),
				"api_host": pulumi.String("apihost:443"),
			},
		})
		if err != nil {
			return err
		}
		example := exampleEnvironment.Name.ApplyT(func(name string) (composer.GetUserWorkloadsConfigMapResult, error) {
			return composer.GetUserWorkloadsConfigMapResult(interface{}(composer.LookupUserWorkloadsConfigMapOutput(ctx, composer.GetUserWorkloadsConfigMapOutputArgs{
				Environment: name,
				Name:        googleComposerUserWorkloadsConfigMap.Example.Name,
			}, nil))), nil
		}).(composer.GetUserWorkloadsConfigMapResultOutput)
		ctx.Export("debug", example)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() => 
{
    var exampleEnvironment = new Gcp.Composer.Environment("example", new()
    {
        Name = "example-environment",
        Config = new Gcp.Composer.Inputs.EnvironmentConfigArgs
        {
            SoftwareConfig = new Gcp.Composer.Inputs.EnvironmentConfigSoftwareConfigArgs
            {
                ImageVersion = "composer-3-airflow-2",
            },
        },
    });
    var exampleUserWorkloadsConfigMap = new Gcp.Composer.UserWorkloadsConfigMap("example", new()
    {
        Environment = exampleEnvironment.Name,
        Name = "example-config-map",
        Data = 
        {
            { "db_host", "dbhost:5432" },
            { "api_host", "apihost:443" },
        },
    });
    var example = Gcp.Composer.GetUserWorkloadsConfigMap.Invoke(new()
    {
        Environment = exampleEnvironment.Name,
        Name = googleComposerUserWorkloadsConfigMap.Example.Name,
    });
    return new Dictionary<string, object?>
    {
        ["debug"] = example,
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.composer.Environment;
import com.pulumi.gcp.composer.EnvironmentArgs;
import com.pulumi.gcp.composer.inputs.EnvironmentConfigArgs;
import com.pulumi.gcp.composer.inputs.EnvironmentConfigSoftwareConfigArgs;
import com.pulumi.gcp.composer.UserWorkloadsConfigMap;
import com.pulumi.gcp.composer.UserWorkloadsConfigMapArgs;
import com.pulumi.gcp.composer.ComposerFunctions;
import com.pulumi.gcp.composer.inputs.GetUserWorkloadsConfigMapArgs;
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) {
        var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
            .name("example-environment")
            .config(EnvironmentConfigArgs.builder()
                .softwareConfig(EnvironmentConfigSoftwareConfigArgs.builder()
                    .imageVersion("composer-3-airflow-2")
                    .build())
                .build())
            .build());
        var exampleUserWorkloadsConfigMap = new UserWorkloadsConfigMap("exampleUserWorkloadsConfigMap", UserWorkloadsConfigMapArgs.builder()
            .environment(exampleEnvironment.name())
            .name("example-config-map")
            .data(Map.ofEntries(
                Map.entry("db_host", "dbhost:5432"),
                Map.entry("api_host", "apihost:443")
            ))
            .build());
        final var example = ComposerFunctions.getUserWorkloadsConfigMap(GetUserWorkloadsConfigMapArgs.builder()
            .environment(exampleEnvironment.name())
            .name(googleComposerUserWorkloadsConfigMap.example().name())
            .build());
        ctx.export("debug", example.applyValue(getUserWorkloadsConfigMapResult -> getUserWorkloadsConfigMapResult));
    }
}
resources:
  exampleEnvironment:
    type: gcp:composer:Environment
    name: example
    properties:
      name: example-environment
      config:
        softwareConfig:
          imageVersion: composer-3-airflow-2
  exampleUserWorkloadsConfigMap:
    type: gcp:composer:UserWorkloadsConfigMap
    name: example
    properties:
      environment: ${exampleEnvironment.name}
      name: example-config-map
      data:
        db_host: dbhost:5432
        api_host: apihost:443
variables:
  example:
    fn::invoke:
      function: gcp:composer:getUserWorkloadsConfigMap
      arguments:
        environment: ${exampleEnvironment.name}
        name: ${googleComposerUserWorkloadsConfigMap.example.name}
outputs:
  debug: ${example}
Using getUserWorkloadsConfigMap
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 getUserWorkloadsConfigMap(args: GetUserWorkloadsConfigMapArgs, opts?: InvokeOptions): Promise<GetUserWorkloadsConfigMapResult>
function getUserWorkloadsConfigMapOutput(args: GetUserWorkloadsConfigMapOutputArgs, opts?: InvokeOptions): Output<GetUserWorkloadsConfigMapResult>def get_user_workloads_config_map(environment: Optional[str] = None,
                                  name: Optional[str] = None,
                                  project: Optional[str] = None,
                                  region: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetUserWorkloadsConfigMapResult
def get_user_workloads_config_map_output(environment: Optional[pulumi.Input[str]] = None,
                                  name: Optional[pulumi.Input[str]] = None,
                                  project: Optional[pulumi.Input[str]] = None,
                                  region: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetUserWorkloadsConfigMapResult]func LookupUserWorkloadsConfigMap(ctx *Context, args *LookupUserWorkloadsConfigMapArgs, opts ...InvokeOption) (*LookupUserWorkloadsConfigMapResult, error)
func LookupUserWorkloadsConfigMapOutput(ctx *Context, args *LookupUserWorkloadsConfigMapOutputArgs, opts ...InvokeOption) LookupUserWorkloadsConfigMapResultOutput> Note: This function is named LookupUserWorkloadsConfigMap in the Go SDK.
public static class GetUserWorkloadsConfigMap 
{
    public static Task<GetUserWorkloadsConfigMapResult> InvokeAsync(GetUserWorkloadsConfigMapArgs args, InvokeOptions? opts = null)
    public static Output<GetUserWorkloadsConfigMapResult> Invoke(GetUserWorkloadsConfigMapInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetUserWorkloadsConfigMapResult> getUserWorkloadsConfigMap(GetUserWorkloadsConfigMapArgs args, InvokeOptions options)
public static Output<GetUserWorkloadsConfigMapResult> getUserWorkloadsConfigMap(GetUserWorkloadsConfigMapArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:composer/getUserWorkloadsConfigMap:getUserWorkloadsConfigMap
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Environment string
- Environment where the ConfigMap is stored.
- Name string
- Name of the ConfigMap.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- The location or Compute Engine region of the environment.
- Environment string
- Environment where the ConfigMap is stored.
- Name string
- Name of the ConfigMap.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
- The location or Compute Engine region of the environment.
- environment String
- Environment where the ConfigMap is stored.
- name String
- Name of the ConfigMap.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- The location or Compute Engine region of the environment.
- environment string
- Environment where the ConfigMap is stored.
- name string
- Name of the ConfigMap.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
- The location or Compute Engine region of the environment.
- environment str
- Environment where the ConfigMap is stored.
- name str
- Name of the ConfigMap.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
- The location or Compute Engine region of the environment.
- environment String
- Environment where the ConfigMap is stored.
- name String
- Name of the ConfigMap.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
- The location or Compute Engine region of the environment.
getUserWorkloadsConfigMap Result
The following output properties are available:
- Data Dictionary<string, string>
- The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
- Environment string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Project string
- Region string
- data {[key: string]: string}
- The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
- environment string
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- project string
- region string
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the google-betaTerraform Provider.