1. Packages
  2. Confluent Provider
  3. API Docs
  4. getEnvironments
Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi

confluentcloud.getEnvironments

Explore with Pulumi AI

confluentcloud logo
Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi

    General Availability

    confluentcloud.getEnvironments describes a data source for Environments.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as confluentcloud from "@pulumi/confluentcloud";
    
    const main = confluentcloud.getEnvironments({});
    export const environments = main.then(main => main.ids);
    
    import pulumi
    import pulumi_confluentcloud as confluentcloud
    
    main = confluentcloud.get_environments()
    pulumi.export("environments", main.ids)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-confluentcloud/sdk/v2/go/confluentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		main, err := confluentcloud.GetEnvironments(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("environments", main.Ids)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using ConfluentCloud = Pulumi.ConfluentCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var main = ConfluentCloud.GetEnvironments.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["environments"] = main.Apply(getEnvironmentsResult => getEnvironmentsResult.Ids),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.confluentcloud.ConfluentcloudFunctions;
    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 main = ConfluentcloudFunctions.getEnvironments();
    
            ctx.export("environments", main.applyValue(getEnvironmentsResult -> getEnvironmentsResult.ids()));
        }
    }
    
    variables:
      main:
        fn::invoke:
          Function: confluentcloud:getEnvironments
          Arguments: {}
    outputs:
      environments: ${main.ids}
    

    Using getEnvironments

    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 getEnvironments(opts?: InvokeOptions): Promise<GetEnvironmentsResult>
    function getEnvironmentsOutput(opts?: InvokeOptions): Output<GetEnvironmentsResult>
    def get_environments(opts: Optional[InvokeOptions] = None) -> GetEnvironmentsResult
    def get_environments_output(opts: Optional[InvokeOptions] = None) -> Output[GetEnvironmentsResult]
    func GetEnvironments(ctx *Context, opts ...InvokeOption) (*GetEnvironmentsResult, error)
    func GetEnvironmentsOutput(ctx *Context, opts ...InvokeOption) GetEnvironmentsResultOutput

    > Note: This function is named GetEnvironments in the Go SDK.

    public static class GetEnvironments 
    {
        public static Task<GetEnvironmentsResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetEnvironmentsResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEnvironmentsResult> getEnvironments(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: confluentcloud:index/getEnvironments:getEnvironments
      arguments:
        # arguments dictionary

    getEnvironments Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    (Required List of Strings) The list of Environment IDs, for example: ["env-abc123", "env-abc124"].
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    (Required List of Strings) The list of Environment IDs, for example: ["env-abc123", "env-abc124"].
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    (Required List of Strings) The list of Environment IDs, for example: ["env-abc123", "env-abc124"].
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    (Required List of Strings) The list of Environment IDs, for example: ["env-abc123", "env-abc124"].
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    (Required List of Strings) The list of Environment IDs, for example: ["env-abc123", "env-abc124"].
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    (Required List of Strings) The list of Environment IDs, for example: ["env-abc123", "env-abc124"].

    Package Details

    Repository
    Confluent Cloud pulumi/pulumi-confluentcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the confluent Terraform Provider.
    confluentcloud logo
    Confluent v2.10.0 published on Wednesday, Nov 20, 2024 by Pulumi