1. Packages
  2. Confluent Provider
  3. API Docs
  4. GroupMapping
Confluent v2.23.0 published on Tuesday, Apr 1, 2025 by Pulumi

confluentcloud.GroupMapping

Explore with Pulumi AI

General Availability

confluentcloud.GroupMapping provides a Group Mapping resource that enables creating, editing, and deleting group mappings on Confluent Cloud.

Note: See Group Mapping in Confluent Cloud for more details.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as confluentcloud from "@pulumi/confluentcloud";

const application_developers = new confluentcloud.GroupMapping("application-developers", {
    displayName: "Application Developers",
    description: "Admin access to production environment for Engineering",
    filter: "\"engineering\" in groups",
});
const envadmin = new confluentcloud.RoleBinding("envadmin", {
    principal: pulumi.interpolate`User:${application_developers.id}`,
    roleName: "EnvironmentAdmin",
    crnPattern: prod.resourceName,
});
Copy
import pulumi
import pulumi_confluentcloud as confluentcloud

application_developers = confluentcloud.GroupMapping("application-developers",
    display_name="Application Developers",
    description="Admin access to production environment for Engineering",
    filter="\"engineering\" in groups")
envadmin = confluentcloud.RoleBinding("envadmin",
    principal=application_developers.id.apply(lambda id: f"User:{id}"),
    role_name="EnvironmentAdmin",
    crn_pattern=prod["resourceName"])
Copy
package main

import (
	"fmt"

	"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 {
		application_developers, err := confluentcloud.NewGroupMapping(ctx, "application-developers", &confluentcloud.GroupMappingArgs{
			DisplayName: pulumi.String("Application Developers"),
			Description: pulumi.String("Admin access to production environment for Engineering"),
			Filter:      pulumi.String("\"engineering\" in groups"),
		})
		if err != nil {
			return err
		}
		_, err = confluentcloud.NewRoleBinding(ctx, "envadmin", &confluentcloud.RoleBindingArgs{
			Principal: application_developers.ID().ApplyT(func(id string) (string, error) {
				return fmt.Sprintf("User:%v", id), nil
			}).(pulumi.StringOutput),
			RoleName:   pulumi.String("EnvironmentAdmin"),
			CrnPattern: pulumi.Any(prod.ResourceName),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ConfluentCloud = Pulumi.ConfluentCloud;

return await Deployment.RunAsync(() => 
{
    var application_developers = new ConfluentCloud.GroupMapping("application-developers", new()
    {
        DisplayName = "Application Developers",
        Description = "Admin access to production environment for Engineering",
        Filter = "\"engineering\" in groups",
    });

    var envadmin = new ConfluentCloud.RoleBinding("envadmin", new()
    {
        Principal = application_developers.Id.Apply(id => $"User:{id}"),
        RoleName = "EnvironmentAdmin",
        CrnPattern = prod.ResourceName,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.confluentcloud.GroupMapping;
import com.pulumi.confluentcloud.GroupMappingArgs;
import com.pulumi.confluentcloud.RoleBinding;
import com.pulumi.confluentcloud.RoleBindingArgs;
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 application_developers = new GroupMapping("application-developers", GroupMappingArgs.builder()
            .displayName("Application Developers")
            .description("Admin access to production environment for Engineering")
            .filter("\"engineering\" in groups")
            .build());

        var envadmin = new RoleBinding("envadmin", RoleBindingArgs.builder()
            .principal(application_developers.id().applyValue(id -> String.format("User:%s", id)))
            .roleName("EnvironmentAdmin")
            .crnPattern(prod.resourceName())
            .build());

    }
}
Copy
resources:
  application-developers:
    type: confluentcloud:GroupMapping
    properties:
      displayName: Application Developers
      description: Admin access to production environment for Engineering
      filter: '"engineering" in groups'
  envadmin:
    type: confluentcloud:RoleBinding
    properties:
      principal: User:${["application-developers"].id}
      roleName: EnvironmentAdmin
      crnPattern: ${prod.resourceName}
Copy

Create GroupMapping Resource

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

Constructor syntax

new GroupMapping(name: string, args: GroupMappingArgs, opts?: CustomResourceOptions);
@overload
def GroupMapping(resource_name: str,
                 args: GroupMappingArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def GroupMapping(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 display_name: Optional[str] = None,
                 filter: Optional[str] = None,
                 description: Optional[str] = None)
func NewGroupMapping(ctx *Context, name string, args GroupMappingArgs, opts ...ResourceOption) (*GroupMapping, error)
public GroupMapping(string name, GroupMappingArgs args, CustomResourceOptions? opts = null)
public GroupMapping(String name, GroupMappingArgs args)
public GroupMapping(String name, GroupMappingArgs args, CustomResourceOptions options)
type: confluentcloud:GroupMapping
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GroupMappingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GroupMappingArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GroupMappingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GroupMappingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GroupMappingArgs
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 groupMappingResource = new ConfluentCloud.GroupMapping("groupMappingResource", new()
{
    DisplayName = "string",
    Filter = "string",
    Description = "string",
});
Copy
example, err := confluentcloud.NewGroupMapping(ctx, "groupMappingResource", &confluentcloud.GroupMappingArgs{
	DisplayName: pulumi.String("string"),
	Filter:      pulumi.String("string"),
	Description: pulumi.String("string"),
})
Copy
var groupMappingResource = new GroupMapping("groupMappingResource", GroupMappingArgs.builder()
    .displayName("string")
    .filter("string")
    .description("string")
    .build());
Copy
group_mapping_resource = confluentcloud.GroupMapping("groupMappingResource",
    display_name="string",
    filter="string",
    description="string")
Copy
const groupMappingResource = new confluentcloud.GroupMapping("groupMappingResource", {
    displayName: "string",
    filter: "string",
    description: "string",
});
Copy
type: confluentcloud:GroupMapping
properties:
    description: string
    displayName: string
    filter: string
Copy

GroupMapping 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 GroupMapping resource accepts the following input properties:

DisplayName This property is required. string
The name of the Group Mapping.
Filter This property is required. string
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
Description string
A description explaining the purpose and use of the group mapping.
DisplayName This property is required. string
The name of the Group Mapping.
Filter This property is required. string
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
Description string
A description explaining the purpose and use of the group mapping.
displayName This property is required. String
The name of the Group Mapping.
filter This property is required. String
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description String
A description explaining the purpose and use of the group mapping.
displayName This property is required. string
The name of the Group Mapping.
filter This property is required. string
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description string
A description explaining the purpose and use of the group mapping.
display_name This property is required. str
The name of the Group Mapping.
filter This property is required. str
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description str
A description explaining the purpose and use of the group mapping.
displayName This property is required. String
The name of the Group Mapping.
filter This property is required. String
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description String
A description explaining the purpose and use of the group mapping.

Outputs

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

Get an existing GroupMapping 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?: GroupMappingState, opts?: CustomResourceOptions): GroupMapping
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        filter: Optional[str] = None) -> GroupMapping
func GetGroupMapping(ctx *Context, name string, id IDInput, state *GroupMappingState, opts ...ResourceOption) (*GroupMapping, error)
public static GroupMapping Get(string name, Input<string> id, GroupMappingState? state, CustomResourceOptions? opts = null)
public static GroupMapping get(String name, Output<String> id, GroupMappingState state, CustomResourceOptions options)
resources:  _:    type: confluentcloud:GroupMapping    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
A description explaining the purpose and use of the group mapping.
DisplayName string
The name of the Group Mapping.
Filter string
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
Description string
A description explaining the purpose and use of the group mapping.
DisplayName string
The name of the Group Mapping.
Filter string
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description String
A description explaining the purpose and use of the group mapping.
displayName String
The name of the Group Mapping.
filter String
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description string
A description explaining the purpose and use of the group mapping.
displayName string
The name of the Group Mapping.
filter string
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description str
A description explaining the purpose and use of the group mapping.
display_name str
The name of the Group Mapping.
filter str
A single group identifier or a condition based on supported CEL operators that defines which groups are included.
description String
A description explaining the purpose and use of the group mapping.
displayName String
The name of the Group Mapping.
filter String
A single group identifier or a condition based on supported CEL operators that defines which groups are included.

Import

You can import a Group Mapping by using Group Mapping ID, for example:

$ export CONFLUENT_CLOUD_API_KEY="<cloud_api_key>"

$ export CONFLUENT_CLOUD_API_SECRET="<cloud_api_secret>"

$ pulumi import confluentcloud:index/groupMapping:GroupMapping application-developers group-abc123
Copy

!> Warning: Do not forget to delete terminal command history afterwards for security purposes.

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

Package Details

Repository
Confluent Cloud pulumi/pulumi-confluentcloud
License
Apache-2.0
Notes
This Pulumi package is based on the confluent Terraform Provider.