1. Packages
  2. Zitadel
  3. API Docs
  4. ProjectMember
zitadel v0.1.8 published on Thursday, May 30, 2024 by pulumiverse

zitadel.ProjectMember

Explore with Pulumi AI

zitadel logo
zitadel v0.1.8 published on Thursday, May 30, 2024 by pulumiverse

    Resource representing the membership of a user on an project, defined with the given role.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zitadel = Pulumiverse.Zitadel;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Zitadel.ProjectMember("default", new()
        {
            OrgId = data.Zitadel_org.Default.Id,
            ProjectId = data.Zitadel_project.Default.Id,
            UserId = data.Zitadel_human_user.Default.Id,
            Roles = new[]
            {
                "PROJECT_OWNER",
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := zitadel.NewProjectMember(ctx, "default", &zitadel.ProjectMemberArgs{
    			OrgId:     pulumi.Any(data.Zitadel_org.Default.Id),
    			ProjectId: pulumi.Any(data.Zitadel_project.Default.Id),
    			UserId:    pulumi.Any(data.Zitadel_human_user.Default.Id),
    			Roles: pulumi.StringArray{
    				pulumi.String("PROJECT_OWNER"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zitadel.ProjectMember;
    import com.pulumi.zitadel.ProjectMemberArgs;
    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 default_ = new ProjectMember("default", ProjectMemberArgs.builder()        
                .orgId(data.zitadel_org().default().id())
                .projectId(data.zitadel_project().default().id())
                .userId(data.zitadel_human_user().default().id())
                .roles("PROJECT_OWNER")
                .build());
    
        }
    }
    
    import pulumi
    import pulumiverse_zitadel as zitadel
    
    default = zitadel.ProjectMember("default",
        org_id=data["zitadel_org"]["default"]["id"],
        project_id=data["zitadel_project"]["default"]["id"],
        user_id=data["zitadel_human_user"]["default"]["id"],
        roles=["PROJECT_OWNER"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as zitadel from "@pulumiverse/zitadel";
    
    const _default = new zitadel.ProjectMember("default", {
        orgId: data.zitadel_org["default"].id,
        projectId: data.zitadel_project["default"].id,
        userId: data.zitadel_human_user["default"].id,
        roles: ["PROJECT_OWNER"],
    });
    
    resources:
      default:
        type: zitadel:ProjectMember
        properties:
          orgId: ${data.zitadel_org.default.id}
          projectId: ${data.zitadel_project.default.id}
          userId: ${data.zitadel_human_user.default.id}
          roles:
            - PROJECT_OWNER
    

    Create ProjectMember Resource

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

    Constructor syntax

    new ProjectMember(name: string, args: ProjectMemberArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectMember(resource_name: str,
                      args: ProjectMemberArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectMember(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      project_id: Optional[str] = None,
                      roles: Optional[Sequence[str]] = None,
                      user_id: Optional[str] = None,
                      org_id: Optional[str] = None)
    func NewProjectMember(ctx *Context, name string, args ProjectMemberArgs, opts ...ResourceOption) (*ProjectMember, error)
    public ProjectMember(string name, ProjectMemberArgs args, CustomResourceOptions? opts = null)
    public ProjectMember(String name, ProjectMemberArgs args)
    public ProjectMember(String name, ProjectMemberArgs args, CustomResourceOptions options)
    
    type: zitadel:ProjectMember
    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 ProjectMemberArgs
    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 ProjectMemberArgs
    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 ProjectMemberArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectMemberArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectMemberArgs
    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 projectMemberResource = new Zitadel.ProjectMember("projectMemberResource", new()
    {
        ProjectId = "string",
        Roles = new[]
        {
            "string",
        },
        UserId = "string",
        OrgId = "string",
    });
    
    example, err := zitadel.NewProjectMember(ctx, "projectMemberResource", &zitadel.ProjectMemberArgs{
    	ProjectId: pulumi.String("string"),
    	Roles: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UserId: pulumi.String("string"),
    	OrgId:  pulumi.String("string"),
    })
    
    var projectMemberResource = new ProjectMember("projectMemberResource", ProjectMemberArgs.builder()
        .projectId("string")
        .roles("string")
        .userId("string")
        .orgId("string")
        .build());
    
    project_member_resource = zitadel.ProjectMember("projectMemberResource",
        project_id="string",
        roles=["string"],
        user_id="string",
        org_id="string")
    
    const projectMemberResource = new zitadel.ProjectMember("projectMemberResource", {
        projectId: "string",
        roles: ["string"],
        userId: "string",
        orgId: "string",
    });
    
    type: zitadel:ProjectMember
    properties:
        orgId: string
        projectId: string
        roles:
            - string
        userId: string
    

    ProjectMember Resource Properties

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

    Inputs

    The ProjectMember resource accepts the following input properties:

    ProjectId string
    ID of the project
    Roles List<string>
    List of roles granted
    UserId string
    ID of the user
    OrgId string
    ID of the organization
    ProjectId string
    ID of the project
    Roles []string
    List of roles granted
    UserId string
    ID of the user
    OrgId string
    ID of the organization
    projectId String
    ID of the project
    roles List<String>
    List of roles granted
    userId String
    ID of the user
    orgId String
    ID of the organization
    projectId string
    ID of the project
    roles string[]
    List of roles granted
    userId string
    ID of the user
    orgId string
    ID of the organization
    project_id str
    ID of the project
    roles Sequence[str]
    List of roles granted
    user_id str
    ID of the user
    org_id str
    ID of the organization
    projectId String
    ID of the project
    roles List<String>
    List of roles granted
    userId String
    ID of the user
    orgId String
    ID of the organization

    Outputs

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

    Get an existing ProjectMember 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?: ProjectMemberState, opts?: CustomResourceOptions): ProjectMember
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            user_id: Optional[str] = None) -> ProjectMember
    func GetProjectMember(ctx *Context, name string, id IDInput, state *ProjectMemberState, opts ...ResourceOption) (*ProjectMember, error)
    public static ProjectMember Get(string name, Input<string> id, ProjectMemberState? state, CustomResourceOptions? opts = null)
    public static ProjectMember get(String name, Output<String> id, ProjectMemberState 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:
    OrgId string
    ID of the organization
    ProjectId string
    ID of the project
    Roles List<string>
    List of roles granted
    UserId string
    ID of the user
    OrgId string
    ID of the organization
    ProjectId string
    ID of the project
    Roles []string
    List of roles granted
    UserId string
    ID of the user
    orgId String
    ID of the organization
    projectId String
    ID of the project
    roles List<String>
    List of roles granted
    userId String
    ID of the user
    orgId string
    ID of the organization
    projectId string
    ID of the project
    roles string[]
    List of roles granted
    userId string
    ID of the user
    org_id str
    ID of the organization
    project_id str
    ID of the project
    roles Sequence[str]
    List of roles granted
    user_id str
    ID of the user
    orgId String
    ID of the organization
    projectId String
    ID of the project
    roles List<String>
    List of roles granted
    userId String
    ID of the user

    Import

    terraform The resource can be imported using the ID format <project_id:user_id[:org_id]>, e.g.

     $ pulumi import zitadel:index/projectMember:ProjectMember imported '123456789012345678:123456789012345678:123456789012345678'
    

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

    Package Details

    Repository
    zitadel pulumiverse/pulumi-zitadel
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the zitadel Terraform Provider.
    zitadel logo
    zitadel v0.1.8 published on Thursday, May 30, 2024 by pulumiverse