1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. composer
  5. UserWorkloadsConfigMap
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.composer.UserWorkloadsConfigMap

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    Example Usage

    Composer User Workloads Config Map Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const environment = new gcp.composer.Environment("environment", {
        name: "test-environment",
        region: "us-central1",
        config: {
            softwareConfig: {
                imageVersion: "composer-3-airflow-2",
            },
        },
    });
    const configMap = new gcp.composer.UserWorkloadsConfigMap("config_map", {
        name: "test-config-map",
        region: "us-central1",
        environment: environment.name,
        data: {
            api_host: "apihost:443",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    environment = gcp.composer.Environment("environment",
        name="test-environment",
        region="us-central1",
        config={
            "software_config": {
                "image_version": "composer-3-airflow-2",
            },
        })
    config_map = gcp.composer.UserWorkloadsConfigMap("config_map",
        name="test-config-map",
        region="us-central1",
        environment=environment.name,
        data={
            "api_host": "apihost:443",
        })
    
    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 {
    		environment, err := composer.NewEnvironment(ctx, "environment", &composer.EnvironmentArgs{
    			Name:   pulumi.String("test-environment"),
    			Region: pulumi.String("us-central1"),
    			Config: &composer.EnvironmentConfigArgs{
    				SoftwareConfig: &composer.EnvironmentConfigSoftwareConfigArgs{
    					ImageVersion: pulumi.String("composer-3-airflow-2"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = composer.NewUserWorkloadsConfigMap(ctx, "config_map", &composer.UserWorkloadsConfigMapArgs{
    			Name:        pulumi.String("test-config-map"),
    			Region:      pulumi.String("us-central1"),
    			Environment: environment.Name,
    			Data: pulumi.StringMap{
    				"api_host": pulumi.String("apihost:443"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var environment = new Gcp.Composer.Environment("environment", new()
        {
            Name = "test-environment",
            Region = "us-central1",
            Config = new Gcp.Composer.Inputs.EnvironmentConfigArgs
            {
                SoftwareConfig = new Gcp.Composer.Inputs.EnvironmentConfigSoftwareConfigArgs
                {
                    ImageVersion = "composer-3-airflow-2",
                },
            },
        });
    
        var configMap = new Gcp.Composer.UserWorkloadsConfigMap("config_map", new()
        {
            Name = "test-config-map",
            Region = "us-central1",
            Environment = environment.Name,
            Data = 
            {
                { "api_host", "apihost:443" },
            },
        });
    
    });
    
    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 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 environment = new Environment("environment", EnvironmentArgs.builder()
                .name("test-environment")
                .region("us-central1")
                .config(EnvironmentConfigArgs.builder()
                    .softwareConfig(EnvironmentConfigSoftwareConfigArgs.builder()
                        .imageVersion("composer-3-airflow-2")
                        .build())
                    .build())
                .build());
    
            var configMap = new UserWorkloadsConfigMap("configMap", UserWorkloadsConfigMapArgs.builder()
                .name("test-config-map")
                .region("us-central1")
                .environment(environment.name())
                .data(Map.of("api_host", "apihost:443"))
                .build());
    
        }
    }
    
    resources:
      environment:
        type: gcp:composer:Environment
        properties:
          name: test-environment
          region: us-central1
          config:
            softwareConfig:
              imageVersion: composer-3-airflow-2
      configMap:
        type: gcp:composer:UserWorkloadsConfigMap
        name: config_map
        properties:
          name: test-config-map
          region: us-central1
          environment: ${environment.name}
          data:
            api_host: apihost:443
    

    Create UserWorkloadsConfigMap Resource

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

    Constructor syntax

    new UserWorkloadsConfigMap(name: string, args: UserWorkloadsConfigMapArgs, opts?: CustomResourceOptions);
    @overload
    def UserWorkloadsConfigMap(resource_name: str,
                               args: UserWorkloadsConfigMapArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserWorkloadsConfigMap(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               environment: Optional[str] = None,
                               data: Optional[Mapping[str, str]] = None,
                               name: Optional[str] = None,
                               project: Optional[str] = None,
                               region: Optional[str] = None)
    func NewUserWorkloadsConfigMap(ctx *Context, name string, args UserWorkloadsConfigMapArgs, opts ...ResourceOption) (*UserWorkloadsConfigMap, error)
    public UserWorkloadsConfigMap(string name, UserWorkloadsConfigMapArgs args, CustomResourceOptions? opts = null)
    public UserWorkloadsConfigMap(String name, UserWorkloadsConfigMapArgs args)
    public UserWorkloadsConfigMap(String name, UserWorkloadsConfigMapArgs args, CustomResourceOptions options)
    
    type: gcp:composer:UserWorkloadsConfigMap
    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 UserWorkloadsConfigMapArgs
    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 UserWorkloadsConfigMapArgs
    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 UserWorkloadsConfigMapArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserWorkloadsConfigMapArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserWorkloadsConfigMapArgs
    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 userWorkloadsConfigMapResource = new Gcp.Composer.UserWorkloadsConfigMap("userWorkloadsConfigMapResource", new()
    {
        Environment = "string",
        Data = 
        {
            { "string", "string" },
        },
        Name = "string",
        Project = "string",
        Region = "string",
    });
    
    example, err := composer.NewUserWorkloadsConfigMap(ctx, "userWorkloadsConfigMapResource", &composer.UserWorkloadsConfigMapArgs{
    	Environment: pulumi.String("string"),
    	Data: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name:    pulumi.String("string"),
    	Project: pulumi.String("string"),
    	Region:  pulumi.String("string"),
    })
    
    var userWorkloadsConfigMapResource = new UserWorkloadsConfigMap("userWorkloadsConfigMapResource", UserWorkloadsConfigMapArgs.builder()
        .environment("string")
        .data(Map.of("string", "string"))
        .name("string")
        .project("string")
        .region("string")
        .build());
    
    user_workloads_config_map_resource = gcp.composer.UserWorkloadsConfigMap("userWorkloadsConfigMapResource",
        environment="string",
        data={
            "string": "string",
        },
        name="string",
        project="string",
        region="string")
    
    const userWorkloadsConfigMapResource = new gcp.composer.UserWorkloadsConfigMap("userWorkloadsConfigMapResource", {
        environment: "string",
        data: {
            string: "string",
        },
        name: "string",
        project: "string",
        region: "string",
    });
    
    type: gcp:composer:UserWorkloadsConfigMap
    properties:
        data:
            string: string
        environment: string
        name: string
        project: string
        region: string
    

    UserWorkloadsConfigMap Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The UserWorkloadsConfigMap resource accepts the following input properties:

    Environment string
    Environment where the Kubernetes ConfigMap will be stored and used.


    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/
    Name string
    Name of the Kubernetes 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 for the environment.
    Environment string
    Environment where the Kubernetes ConfigMap will be stored and used.


    Data map[string]string
    The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
    Name string
    Name of the Kubernetes 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 for the environment.
    environment String
    Environment where the Kubernetes ConfigMap will be stored and used.


    data Map<String,String>
    The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
    name String
    Name of the Kubernetes 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 for the environment.
    environment string
    Environment where the Kubernetes ConfigMap will be stored and used.


    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/
    name string
    Name of the Kubernetes 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 for the environment.
    environment str
    Environment where the Kubernetes ConfigMap will be stored and used.


    data Mapping[str, str]
    The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
    name str
    Name of the Kubernetes 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 for the environment.
    environment String
    Environment where the Kubernetes ConfigMap will be stored and used.


    data Map<String>
    The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
    name String
    Name of the Kubernetes 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 for the environment.

    Outputs

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

    Get an existing UserWorkloadsConfigMap 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?: UserWorkloadsConfigMapState, opts?: CustomResourceOptions): UserWorkloadsConfigMap
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data: Optional[Mapping[str, str]] = None,
            environment: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            region: Optional[str] = None) -> UserWorkloadsConfigMap
    func GetUserWorkloadsConfigMap(ctx *Context, name string, id IDInput, state *UserWorkloadsConfigMapState, opts ...ResourceOption) (*UserWorkloadsConfigMap, error)
    public static UserWorkloadsConfigMap Get(string name, Input<string> id, UserWorkloadsConfigMapState? state, CustomResourceOptions? opts = null)
    public static UserWorkloadsConfigMap get(String name, Output<String> id, UserWorkloadsConfigMapState 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:
    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
    Environment where the Kubernetes ConfigMap will be stored and used.


    Name string
    Name of the Kubernetes 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 for the environment.
    Data map[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
    Environment where the Kubernetes ConfigMap will be stored and used.


    Name string
    Name of the Kubernetes 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 for the environment.
    data Map<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
    Environment where the Kubernetes ConfigMap will be stored and used.


    name String
    Name of the Kubernetes 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 for the environment.
    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
    Environment where the Kubernetes ConfigMap will be stored and used.


    name string
    Name of the Kubernetes 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 for the environment.
    data Mapping[str, str]
    The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
    environment str
    Environment where the Kubernetes ConfigMap will be stored and used.


    name str
    Name of the Kubernetes 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 for the environment.
    data Map<String>
    The "data" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
    environment String
    Environment where the Kubernetes ConfigMap will be stored and used.


    name String
    Name of the Kubernetes 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 for the environment.

    Import

    UserWorkloadsConfigMap can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsConfigMaps/{{name}}

    • {{project}}/{{region}}/{{environment}}/{{name}}

    • {{region}}/{{environment}}/{{name}}

    • {{environment}}/{{name}}

    When using the pulumi import command, UserWorkloadsConfigMap can be imported using one of the formats above. For example:

    $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsConfigMaps/{{name}}
    
    $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default {{project}}/{{region}}/{{environment}}/{{name}}
    
    $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default {{region}}/{{environment}}/{{name}}
    
    $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default {{environment}}/{{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi