1. Packages
  2. Doppler
  3. API Docs
  4. GroupMembers
Doppler v0.9.0 published on Tuesday, Aug 27, 2024 by Pulumiverse

doppler.GroupMembers

Explore with Pulumi AI

doppler logo
Doppler v0.9.0 published on Tuesday, Aug 27, 2024 by Pulumiverse

    Manage a Doppler group’s memberships.

    Note: The doppler.GroupMembers resource will clear/replace all existing memberships. Multiple doppler.GroupMembers resources or combinations of doppler.GroupMembers and doppler.GroupMember will produce inconsistent behavior. To non-exclusively manage group memberships, use doppler.GroupMember only.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as doppler from "@pulumi/doppler";
    import * as doppler from "@pulumiverse/doppler";
    
    const engineering = new doppler.Group("engineering", {name: "engineering"});
    const nic = doppler.getUser({
        email: "nic@doppler.com",
    });
    const andre = doppler.getUser({
        email: "andre@doppler.com",
    });
    const engineeringGroupMembers = new doppler.GroupMembers("engineering", {
        groupSlug: engineering.slug,
        userSlugs: [
            nic.then(nic => nic.slug),
            andre.then(andre => andre.slug),
        ],
    });
    
    import pulumi
    import pulumi_doppler as doppler
    import pulumiverse_doppler as doppler
    
    engineering = doppler.Group("engineering", name="engineering")
    nic = doppler.get_user(email="nic@doppler.com")
    andre = doppler.get_user(email="andre@doppler.com")
    engineering_group_members = doppler.GroupMembers("engineering",
        group_slug=engineering.slug,
        user_slugs=[
            nic.slug,
            andre.slug,
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-doppler/sdk/go/doppler"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		engineering, err := doppler.NewGroup(ctx, "engineering", &doppler.GroupArgs{
    			Name: pulumi.String("engineering"),
    		})
    		if err != nil {
    			return err
    		}
    		nic, err := doppler.GetUser(ctx, &doppler.GetUserArgs{
    			Email: "nic@doppler.com",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		andre, err := doppler.GetUser(ctx, &doppler.GetUserArgs{
    			Email: "andre@doppler.com",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = doppler.NewGroupMembers(ctx, "engineering", &doppler.GroupMembersArgs{
    			GroupSlug: engineering.Slug,
    			UserSlugs: pulumi.StringArray{
    				pulumi.String(nic.Slug),
    				pulumi.String(andre.Slug),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Doppler = Pulumi.Doppler;
    using Doppler = Pulumiverse.Doppler;
    
    return await Deployment.RunAsync(() => 
    {
        var engineering = new Doppler.Group("engineering", new()
        {
            Name = "engineering",
        });
    
        var nic = Doppler.GetUser.Invoke(new()
        {
            Email = "nic@doppler.com",
        });
    
        var andre = Doppler.GetUser.Invoke(new()
        {
            Email = "andre@doppler.com",
        });
    
        var engineeringGroupMembers = new Doppler.GroupMembers("engineering", new()
        {
            GroupSlug = engineering.Slug,
            UserSlugs = new[]
            {
                nic.Apply(getUserResult => getUserResult.Slug),
                andre.Apply(getUserResult => getUserResult.Slug),
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.doppler.Group;
    import com.pulumi.doppler.GroupArgs;
    import com.pulumi.doppler.DopplerFunctions;
    import com.pulumi.doppler.inputs.GetUserArgs;
    import com.pulumi.doppler.GroupMembers;
    import com.pulumi.doppler.GroupMembersArgs;
    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 engineering = new Group("engineering", GroupArgs.builder()
                .name("engineering")
                .build());
    
            final var nic = DopplerFunctions.getUser(GetUserArgs.builder()
                .email("nic@doppler.com")
                .build());
    
            final var andre = DopplerFunctions.getUser(GetUserArgs.builder()
                .email("andre@doppler.com")
                .build());
    
            var engineeringGroupMembers = new GroupMembers("engineeringGroupMembers", GroupMembersArgs.builder()
                .groupSlug(engineering.slug())
                .userSlugs(            
                    nic.applyValue(getUserResult -> getUserResult.slug()),
                    andre.applyValue(getUserResult -> getUserResult.slug()))
                .build());
    
        }
    }
    
    resources:
      engineering:
        type: doppler:Group
        properties:
          name: engineering
      engineeringGroupMembers:
        type: doppler:GroupMembers
        name: engineering
        properties:
          groupSlug: ${engineering.slug}
          userSlugs:
            - ${nic.slug}
            - ${andre.slug}
    variables:
      nic:
        fn::invoke:
          Function: doppler:getUser
          Arguments:
            email: nic@doppler.com
      andre:
        fn::invoke:
          Function: doppler:getUser
          Arguments:
            email: andre@doppler.com
    

    Create GroupMembers Resource

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

    Constructor syntax

    new GroupMembers(name: string, args: GroupMembersArgs, opts?: CustomResourceOptions);
    @overload
    def GroupMembers(resource_name: str,
                     args: GroupMembersArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupMembers(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     group_slug: Optional[str] = None,
                     user_slugs: Optional[Sequence[str]] = None)
    func NewGroupMembers(ctx *Context, name string, args GroupMembersArgs, opts ...ResourceOption) (*GroupMembers, error)
    public GroupMembers(string name, GroupMembersArgs args, CustomResourceOptions? opts = null)
    public GroupMembers(String name, GroupMembersArgs args)
    public GroupMembers(String name, GroupMembersArgs args, CustomResourceOptions options)
    
    type: doppler:GroupMembers
    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 GroupMembersArgs
    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 GroupMembersArgs
    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 GroupMembersArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupMembersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupMembersArgs
    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 groupMembersResource = new Doppler.GroupMembers("groupMembersResource", new()
    {
        GroupSlug = "string",
        UserSlugs = new[]
        {
            "string",
        },
    });
    
    example, err := doppler.NewGroupMembers(ctx, "groupMembersResource", &doppler.GroupMembersArgs{
    	GroupSlug: pulumi.String("string"),
    	UserSlugs: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var groupMembersResource = new GroupMembers("groupMembersResource", GroupMembersArgs.builder()
        .groupSlug("string")
        .userSlugs("string")
        .build());
    
    group_members_resource = doppler.GroupMembers("groupMembersResource",
        group_slug="string",
        user_slugs=["string"])
    
    const groupMembersResource = new doppler.GroupMembers("groupMembersResource", {
        groupSlug: "string",
        userSlugs: ["string"],
    });
    
    type: doppler:GroupMembers
    properties:
        groupSlug: string
        userSlugs:
            - string
    

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

    GroupSlug string
    The slug of the group
    UserSlugs List<string>
    A list of user slugs in the group
    GroupSlug string
    The slug of the group
    UserSlugs []string
    A list of user slugs in the group
    groupSlug String
    The slug of the group
    userSlugs List<String>
    A list of user slugs in the group
    groupSlug string
    The slug of the group
    userSlugs string[]
    A list of user slugs in the group
    group_slug str
    The slug of the group
    user_slugs Sequence[str]
    A list of user slugs in the group
    groupSlug String
    The slug of the group
    userSlugs List<String>
    A list of user slugs in the group

    Outputs

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

    Get an existing GroupMembers 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?: GroupMembersState, opts?: CustomResourceOptions): GroupMembers
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_slug: Optional[str] = None,
            user_slugs: Optional[Sequence[str]] = None) -> GroupMembers
    func GetGroupMembers(ctx *Context, name string, id IDInput, state *GroupMembersState, opts ...ResourceOption) (*GroupMembers, error)
    public static GroupMembers Get(string name, Input<string> id, GroupMembersState? state, CustomResourceOptions? opts = null)
    public static GroupMembers get(String name, Output<String> id, GroupMembersState 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:
    GroupSlug string
    The slug of the group
    UserSlugs List<string>
    A list of user slugs in the group
    GroupSlug string
    The slug of the group
    UserSlugs []string
    A list of user slugs in the group
    groupSlug String
    The slug of the group
    userSlugs List<String>
    A list of user slugs in the group
    groupSlug string
    The slug of the group
    userSlugs string[]
    A list of user slugs in the group
    group_slug str
    The slug of the group
    user_slugs Sequence[str]
    A list of user slugs in the group
    groupSlug String
    The slug of the group
    userSlugs List<String>
    A list of user slugs in the group

    Import

    import using the group slug from the URL:

    https://dashboard.doppler.com/workplace/[workplace-slug]/team/groups/[group-slug]

    and the user slugs from the URL:

    https://dashboard.doppler.com/workplace/[workplace-slug]/team/users/[user-slug]

    $ pulumi import doppler:index/groupMembers:GroupMembers default <group-slug>
    

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

    Package Details

    Repository
    doppler pulumiverse/pulumi-doppler
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the doppler Terraform Provider.
    doppler logo
    Doppler v0.9.0 published on Tuesday, Aug 27, 2024 by Pulumiverse