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

zitadel.OrgMember

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 organization, 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.OrgMember("default", new()
        {
            OrgId = data.Zitadel_org.Default.Id,
            UserId = data.Zitadel_human_user.Default.Id,
            Roles = new[]
            {
                "ORG_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.NewOrgMember(ctx, "default", &zitadel.OrgMemberArgs{
    			OrgId:  pulumi.Any(data.Zitadel_org.Default.Id),
    			UserId: pulumi.Any(data.Zitadel_human_user.Default.Id),
    			Roles: pulumi.StringArray{
    				pulumi.String("ORG_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.OrgMember;
    import com.pulumi.zitadel.OrgMemberArgs;
    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 OrgMember("default", OrgMemberArgs.builder()        
                .orgId(data.zitadel_org().default().id())
                .userId(data.zitadel_human_user().default().id())
                .roles("ORG_OWNER")
                .build());
    
        }
    }
    
    import pulumi
    import pulumiverse_zitadel as zitadel
    
    default = zitadel.OrgMember("default",
        org_id=data["zitadel_org"]["default"]["id"],
        user_id=data["zitadel_human_user"]["default"]["id"],
        roles=["ORG_OWNER"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as zitadel from "@pulumiverse/zitadel";
    
    const _default = new zitadel.OrgMember("default", {
        orgId: data.zitadel_org["default"].id,
        userId: data.zitadel_human_user["default"].id,
        roles: ["ORG_OWNER"],
    });
    
    resources:
      default:
        type: zitadel:OrgMember
        properties:
          orgId: ${data.zitadel_org.default.id}
          userId: ${data.zitadel_human_user.default.id}
          roles:
            - ORG_OWNER
    

    Create OrgMember Resource

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

    Constructor syntax

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

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

    Roles List<string>
    List of roles granted
    UserId string
    ID of the user
    OrgId string
    ID of the organization
    Roles []string
    List of roles granted
    UserId string
    ID of the user
    OrgId string
    ID of the organization
    roles List<String>
    List of roles granted
    userId String
    ID of the user
    orgId String
    ID of the organization
    roles string[]
    List of roles granted
    userId string
    ID of the user
    orgId string
    ID of the organization
    roles Sequence[str]
    List of roles granted
    user_id str
    ID of the user
    org_id str
    ID of the organization
    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 OrgMember 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 OrgMember Resource

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

    Import

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

     $ pulumi import zitadel:index/orgMember:OrgMember imported '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