1. Packages
  2. Castai Provider
  3. API Docs
  4. OrganizationMembers
castai 7.44.1 published on Monday, Mar 31, 2025 by castai

castai.OrganizationMembers

Explore with Pulumi AI

CAST AI organization members resource to manage organization members

Example Usage

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

const devOrganization = castai.getOrganization({
    name: _var.castai_dev_organization_name,
});
const devOrganizationMembers = new castai.OrganizationMembers("devOrganizationMembers", {
    organizationId: devOrganization.then(devOrganization => devOrganization.id),
    owners: ["owner@test.ai"],
    members: ["member@test.ai"],
    viewers: [],
});
Copy
import pulumi
import pulumi_castai as castai

dev_organization = castai.get_organization(name=var["castai_dev_organization_name"])
dev_organization_members = castai.OrganizationMembers("devOrganizationMembers",
    organization_id=dev_organization.id,
    owners=["owner@test.ai"],
    members=["member@test.ai"],
    viewers=[])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/castai/v7/castai"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		devOrganization, err := castai.GetOrganization(ctx, &castai.GetOrganizationArgs{
			Name: _var.Castai_dev_organization_name,
		}, nil)
		if err != nil {
			return err
		}
		_, err = castai.NewOrganizationMembers(ctx, "devOrganizationMembers", &castai.OrganizationMembersArgs{
			OrganizationId: pulumi.String(devOrganization.Id),
			Owners: pulumi.StringArray{
				pulumi.String("owner@test.ai"),
			},
			Members: pulumi.StringArray{
				pulumi.String("member@test.ai"),
			},
			Viewers: pulumi.StringArray{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Castai = Pulumi.Castai;

return await Deployment.RunAsync(() => 
{
    var devOrganization = Castai.GetOrganization.Invoke(new()
    {
        Name = @var.Castai_dev_organization_name,
    });

    var devOrganizationMembers = new Castai.OrganizationMembers("devOrganizationMembers", new()
    {
        OrganizationId = devOrganization.Apply(getOrganizationResult => getOrganizationResult.Id),
        Owners = new[]
        {
            "owner@test.ai",
        },
        Members = new[]
        {
            "member@test.ai",
        },
        Viewers = new[] {},
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.castai.CastaiFunctions;
import com.pulumi.castai.inputs.GetOrganizationArgs;
import com.pulumi.castai.OrganizationMembers;
import com.pulumi.castai.OrganizationMembersArgs;
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 devOrganization = CastaiFunctions.getOrganization(GetOrganizationArgs.builder()
            .name(var_.castai_dev_organization_name())
            .build());

        var devOrganizationMembers = new OrganizationMembers("devOrganizationMembers", OrganizationMembersArgs.builder()
            .organizationId(devOrganization.applyValue(getOrganizationResult -> getOrganizationResult.id()))
            .owners("owner@test.ai")
            .members("member@test.ai")
            .viewers()
            .build());

    }
}
Copy
resources:
  devOrganizationMembers:
    type: castai:OrganizationMembers
    properties:
      organizationId: ${devOrganization.id}
      owners:
        - owner@test.ai
      members:
        - member@test.ai
      viewers: []
variables:
  devOrganization:
    fn::invoke:
      function: castai:getOrganization
      arguments:
        name: ${var.castai_dev_organization_name}
Copy

Create OrganizationMembers Resource

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

Constructor syntax

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

@overload
def OrganizationMembers(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        organization_id: Optional[str] = None,
                        members: Optional[Sequence[str]] = None,
                        organization_members_id: Optional[str] = None,
                        owners: Optional[Sequence[str]] = None,
                        timeouts: Optional[OrganizationMembersTimeoutsArgs] = None,
                        viewers: Optional[Sequence[str]] = None)
func NewOrganizationMembers(ctx *Context, name string, args OrganizationMembersArgs, opts ...ResourceOption) (*OrganizationMembers, error)
public OrganizationMembers(string name, OrganizationMembersArgs args, CustomResourceOptions? opts = null)
public OrganizationMembers(String name, OrganizationMembersArgs args)
public OrganizationMembers(String name, OrganizationMembersArgs args, CustomResourceOptions options)
type: castai:OrganizationMembers
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. OrganizationMembersArgs
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. OrganizationMembersArgs
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. OrganizationMembersArgs
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. OrganizationMembersArgs
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. OrganizationMembersArgs
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 organizationMembersResource = new Castai.OrganizationMembers("organizationMembersResource", new()
{
    OrganizationId = "string",
    Members = new[]
    {
        "string",
    },
    OrganizationMembersId = "string",
    Owners = new[]
    {
        "string",
    },
    Timeouts = new Castai.Inputs.OrganizationMembersTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
    Viewers = new[]
    {
        "string",
    },
});
Copy
example, err := castai.NewOrganizationMembers(ctx, "organizationMembersResource", &castai.OrganizationMembersArgs{
OrganizationId: pulumi.String("string"),
Members: pulumi.StringArray{
pulumi.String("string"),
},
OrganizationMembersId: pulumi.String("string"),
Owners: pulumi.StringArray{
pulumi.String("string"),
},
Timeouts: &.OrganizationMembersTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
Viewers: pulumi.StringArray{
pulumi.String("string"),
},
})
Copy
var organizationMembersResource = new OrganizationMembers("organizationMembersResource", OrganizationMembersArgs.builder()
    .organizationId("string")
    .members("string")
    .organizationMembersId("string")
    .owners("string")
    .timeouts(OrganizationMembersTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .viewers("string")
    .build());
Copy
organization_members_resource = castai.OrganizationMembers("organizationMembersResource",
    organization_id="string",
    members=["string"],
    organization_members_id="string",
    owners=["string"],
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    },
    viewers=["string"])
Copy
const organizationMembersResource = new castai.OrganizationMembers("organizationMembersResource", {
    organizationId: "string",
    members: ["string"],
    organizationMembersId: "string",
    owners: ["string"],
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
    viewers: ["string"],
});
Copy
type: castai:OrganizationMembers
properties:
    members:
        - string
    organizationId: string
    organizationMembersId: string
    owners:
        - string
    timeouts:
        create: string
        delete: string
        update: string
    viewers:
        - string
Copy

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

OrganizationId This property is required. string
CAST AI organization ID.
Members List<string>
A list of email addresses corresponding to users who should be given member access to the organization.
OrganizationMembersId string
The ID of this resource.
Owners List<string>
A list of email addresses corresponding to users who should be given owner access to the organization.
Timeouts OrganizationMembersTimeouts
Viewers List<string>
A list of email addresses corresponding to users who should be given viewer access to the organization.
OrganizationId This property is required. string
CAST AI organization ID.
Members []string
A list of email addresses corresponding to users who should be given member access to the organization.
OrganizationMembersId string
The ID of this resource.
Owners []string
A list of email addresses corresponding to users who should be given owner access to the organization.
Timeouts OrganizationMembersTimeoutsArgs
Viewers []string
A list of email addresses corresponding to users who should be given viewer access to the organization.
organizationId This property is required. String
CAST AI organization ID.
members List<String>
A list of email addresses corresponding to users who should be given member access to the organization.
organizationMembersId String
The ID of this resource.
owners List<String>
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts OrganizationMembersTimeouts
viewers List<String>
A list of email addresses corresponding to users who should be given viewer access to the organization.
organizationId This property is required. string
CAST AI organization ID.
members string[]
A list of email addresses corresponding to users who should be given member access to the organization.
organizationMembersId string
The ID of this resource.
owners string[]
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts OrganizationMembersTimeouts
viewers string[]
A list of email addresses corresponding to users who should be given viewer access to the organization.
organization_id This property is required. str
CAST AI organization ID.
members Sequence[str]
A list of email addresses corresponding to users who should be given member access to the organization.
organization_members_id str
The ID of this resource.
owners Sequence[str]
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts OrganizationMembersTimeoutsArgs
viewers Sequence[str]
A list of email addresses corresponding to users who should be given viewer access to the organization.
organizationId This property is required. String
CAST AI organization ID.
members List<String>
A list of email addresses corresponding to users who should be given member access to the organization.
organizationMembersId String
The ID of this resource.
owners List<String>
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts Property Map
viewers List<String>
A list of email addresses corresponding to users who should be given viewer access to the organization.

Outputs

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

Get an existing OrganizationMembers 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?: OrganizationMembersState, opts?: CustomResourceOptions): OrganizationMembers
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        members: Optional[Sequence[str]] = None,
        organization_id: Optional[str] = None,
        organization_members_id: Optional[str] = None,
        owners: Optional[Sequence[str]] = None,
        timeouts: Optional[OrganizationMembersTimeoutsArgs] = None,
        viewers: Optional[Sequence[str]] = None) -> OrganizationMembers
func GetOrganizationMembers(ctx *Context, name string, id IDInput, state *OrganizationMembersState, opts ...ResourceOption) (*OrganizationMembers, error)
public static OrganizationMembers Get(string name, Input<string> id, OrganizationMembersState? state, CustomResourceOptions? opts = null)
public static OrganizationMembers get(String name, Output<String> id, OrganizationMembersState state, CustomResourceOptions options)
resources:  _:    type: castai:OrganizationMembers    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:
Members List<string>
A list of email addresses corresponding to users who should be given member access to the organization.
OrganizationId string
CAST AI organization ID.
OrganizationMembersId string
The ID of this resource.
Owners List<string>
A list of email addresses corresponding to users who should be given owner access to the organization.
Timeouts OrganizationMembersTimeouts
Viewers List<string>
A list of email addresses corresponding to users who should be given viewer access to the organization.
Members []string
A list of email addresses corresponding to users who should be given member access to the organization.
OrganizationId string
CAST AI organization ID.
OrganizationMembersId string
The ID of this resource.
Owners []string
A list of email addresses corresponding to users who should be given owner access to the organization.
Timeouts OrganizationMembersTimeoutsArgs
Viewers []string
A list of email addresses corresponding to users who should be given viewer access to the organization.
members List<String>
A list of email addresses corresponding to users who should be given member access to the organization.
organizationId String
CAST AI organization ID.
organizationMembersId String
The ID of this resource.
owners List<String>
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts OrganizationMembersTimeouts
viewers List<String>
A list of email addresses corresponding to users who should be given viewer access to the organization.
members string[]
A list of email addresses corresponding to users who should be given member access to the organization.
organizationId string
CAST AI organization ID.
organizationMembersId string
The ID of this resource.
owners string[]
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts OrganizationMembersTimeouts
viewers string[]
A list of email addresses corresponding to users who should be given viewer access to the organization.
members Sequence[str]
A list of email addresses corresponding to users who should be given member access to the organization.
organization_id str
CAST AI organization ID.
organization_members_id str
The ID of this resource.
owners Sequence[str]
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts OrganizationMembersTimeoutsArgs
viewers Sequence[str]
A list of email addresses corresponding to users who should be given viewer access to the organization.
members List<String>
A list of email addresses corresponding to users who should be given member access to the organization.
organizationId String
CAST AI organization ID.
organizationMembersId String
The ID of this resource.
owners List<String>
A list of email addresses corresponding to users who should be given owner access to the organization.
timeouts Property Map
viewers List<String>
A list of email addresses corresponding to users who should be given viewer access to the organization.

Supporting Types

OrganizationMembersTimeouts
, OrganizationMembersTimeoutsArgs

Create string
Delete string
Update string
Create string
Delete string
Update string
create String
delete String
update String
create string
delete string
update string
create str
delete str
update str
create String
delete String
update String

Package Details

Repository
castai castai/terraform-provider-castai
License
Notes
This Pulumi package is based on the castai Terraform Provider.