1. Packages
  2. Castai Provider
  3. API Docs
  4. ServiceAccount
castai 7.45.0 published on Wednesday, Apr 16, 2025 by castai

castai.ServiceAccount

Explore with Pulumi AI

Service account resource allows managing CAST AI service accounts.

Example Usage

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

const serviceAccount = new castai.ServiceAccount("serviceAccount", {
    organizationId: organization.id,
    description: "service account description",
});
Copy
import pulumi
import pulumi_castai as castai

service_account = castai.ServiceAccount("serviceAccount",
    organization_id=organization["id"],
    description="service account description")
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 {
		_, err := castai.NewServiceAccount(ctx, "serviceAccount", &castai.ServiceAccountArgs{
			OrganizationId: pulumi.Any(organization.Id),
			Description:    pulumi.String("service account description"),
		})
		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 serviceAccount = new Castai.ServiceAccount("serviceAccount", new()
    {
        OrganizationId = organization.Id,
        Description = "service account description",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.castai.ServiceAccount;
import com.pulumi.castai.ServiceAccountArgs;
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 serviceAccount = new ServiceAccount("serviceAccount", ServiceAccountArgs.builder()
            .organizationId(organization.id())
            .description("service account description")
            .build());

    }
}
Copy
resources:
  serviceAccount:
    type: castai:ServiceAccount
    properties:
      organizationId: ${organization.id}
      description: service account description
Copy

Create ServiceAccount Resource

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

Constructor syntax

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

@overload
def ServiceAccount(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   organization_id: Optional[str] = None,
                   description: Optional[str] = None,
                   name: Optional[str] = None,
                   service_account_id: Optional[str] = None,
                   timeouts: Optional[ServiceAccountTimeoutsArgs] = None)
func NewServiceAccount(ctx *Context, name string, args ServiceAccountArgs, opts ...ResourceOption) (*ServiceAccount, error)
public ServiceAccount(string name, ServiceAccountArgs args, CustomResourceOptions? opts = null)
public ServiceAccount(String name, ServiceAccountArgs args)
public ServiceAccount(String name, ServiceAccountArgs args, CustomResourceOptions options)
type: castai:ServiceAccount
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. ServiceAccountArgs
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. ServiceAccountArgs
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. ServiceAccountArgs
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. ServiceAccountArgs
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. ServiceAccountArgs
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 serviceAccountResource = new Castai.ServiceAccount("serviceAccountResource", new()
{
    OrganizationId = "string",
    Description = "string",
    Name = "string",
    ServiceAccountId = "string",
    Timeouts = new Castai.Inputs.ServiceAccountTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Read = "string",
        Update = "string",
    },
});
Copy
example, err := castai.NewServiceAccount(ctx, "serviceAccountResource", &castai.ServiceAccountArgs{
OrganizationId: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
ServiceAccountId: pulumi.String("string"),
Timeouts: &.ServiceAccountTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Read: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
Copy
var serviceAccountResource = new ServiceAccount("serviceAccountResource", ServiceAccountArgs.builder()
    .organizationId("string")
    .description("string")
    .name("string")
    .serviceAccountId("string")
    .timeouts(ServiceAccountTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .read("string")
        .update("string")
        .build())
    .build());
Copy
service_account_resource = castai.ServiceAccount("serviceAccountResource",
    organization_id="string",
    description="string",
    name="string",
    service_account_id="string",
    timeouts={
        "create": "string",
        "delete": "string",
        "read": "string",
        "update": "string",
    })
Copy
const serviceAccountResource = new castai.ServiceAccount("serviceAccountResource", {
    organizationId: "string",
    description: "string",
    name: "string",
    serviceAccountId: "string",
    timeouts: {
        create: "string",
        "delete": "string",
        read: "string",
        update: "string",
    },
});
Copy
type: castai:ServiceAccount
properties:
    description: string
    name: string
    organizationId: string
    serviceAccountId: string
    timeouts:
        create: string
        delete: string
        read: string
        update: string
Copy

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

OrganizationId This property is required. string
ID of the organization.
Description string
Description of the service account.
Name string
Name of the service account.
ServiceAccountId string
The ID of this resource.
Timeouts ServiceAccountTimeouts
OrganizationId This property is required. string
ID of the organization.
Description string
Description of the service account.
Name string
Name of the service account.
ServiceAccountId string
The ID of this resource.
Timeouts ServiceAccountTimeoutsArgs
organizationId This property is required. String
ID of the organization.
description String
Description of the service account.
name String
Name of the service account.
serviceAccountId String
The ID of this resource.
timeouts ServiceAccountTimeouts
organizationId This property is required. string
ID of the organization.
description string
Description of the service account.
name string
Name of the service account.
serviceAccountId string
The ID of this resource.
timeouts ServiceAccountTimeouts
organization_id This property is required. str
ID of the organization.
description str
Description of the service account.
name str
Name of the service account.
service_account_id str
The ID of this resource.
timeouts ServiceAccountTimeoutsArgs
organizationId This property is required. String
ID of the organization.
description String
Description of the service account.
name String
Name of the service account.
serviceAccountId String
The ID of this resource.
timeouts Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the ServiceAccount resource produces the following output properties:

Authors List<ServiceAccountAuthor>
Author of the service account.
Email string
Email of the service account.
Id string
The provider-assigned unique ID for this managed resource.
Authors []ServiceAccountAuthor
Author of the service account.
Email string
Email of the service account.
Id string
The provider-assigned unique ID for this managed resource.
authors List<ServiceAccountAuthor>
Author of the service account.
email String
Email of the service account.
id String
The provider-assigned unique ID for this managed resource.
authors ServiceAccountAuthor[]
Author of the service account.
email string
Email of the service account.
id string
The provider-assigned unique ID for this managed resource.
authors Sequence[ServiceAccountAuthor]
Author of the service account.
email str
Email of the service account.
id str
The provider-assigned unique ID for this managed resource.
authors List<Property Map>
Author of the service account.
email String
Email of the service account.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ServiceAccount Resource

Get an existing ServiceAccount 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?: ServiceAccountState, opts?: CustomResourceOptions): ServiceAccount
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        authors: Optional[Sequence[ServiceAccountAuthorArgs]] = None,
        description: Optional[str] = None,
        email: Optional[str] = None,
        name: Optional[str] = None,
        organization_id: Optional[str] = None,
        service_account_id: Optional[str] = None,
        timeouts: Optional[ServiceAccountTimeoutsArgs] = None) -> ServiceAccount
func GetServiceAccount(ctx *Context, name string, id IDInput, state *ServiceAccountState, opts ...ResourceOption) (*ServiceAccount, error)
public static ServiceAccount Get(string name, Input<string> id, ServiceAccountState? state, CustomResourceOptions? opts = null)
public static ServiceAccount get(String name, Output<String> id, ServiceAccountState state, CustomResourceOptions options)
resources:  _:    type: castai:ServiceAccount    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:
Authors List<ServiceAccountAuthor>
Author of the service account.
Description string
Description of the service account.
Email string
Email of the service account.
Name string
Name of the service account.
OrganizationId string
ID of the organization.
ServiceAccountId string
The ID of this resource.
Timeouts ServiceAccountTimeouts
Authors []ServiceAccountAuthorArgs
Author of the service account.
Description string
Description of the service account.
Email string
Email of the service account.
Name string
Name of the service account.
OrganizationId string
ID of the organization.
ServiceAccountId string
The ID of this resource.
Timeouts ServiceAccountTimeoutsArgs
authors List<ServiceAccountAuthor>
Author of the service account.
description String
Description of the service account.
email String
Email of the service account.
name String
Name of the service account.
organizationId String
ID of the organization.
serviceAccountId String
The ID of this resource.
timeouts ServiceAccountTimeouts
authors ServiceAccountAuthor[]
Author of the service account.
description string
Description of the service account.
email string
Email of the service account.
name string
Name of the service account.
organizationId string
ID of the organization.
serviceAccountId string
The ID of this resource.
timeouts ServiceAccountTimeouts
authors Sequence[ServiceAccountAuthorArgs]
Author of the service account.
description str
Description of the service account.
email str
Email of the service account.
name str
Name of the service account.
organization_id str
ID of the organization.
service_account_id str
The ID of this resource.
timeouts ServiceAccountTimeoutsArgs
authors List<Property Map>
Author of the service account.
description String
Description of the service account.
email String
Email of the service account.
name String
Name of the service account.
organizationId String
ID of the organization.
serviceAccountId String
The ID of this resource.
timeouts Property Map

Supporting Types

ServiceAccountAuthor
, ServiceAccountAuthorArgs

Email This property is required. string
Id This property is required. string
Kind This property is required. string
Email This property is required. string
Id This property is required. string
Kind This property is required. string
email This property is required. String
id This property is required. String
kind This property is required. String
email This property is required. string
id This property is required. string
kind This property is required. string
email This property is required. str
id This property is required. str
kind This property is required. str
email This property is required. String
id This property is required. String
kind This property is required. String

ServiceAccountTimeouts
, ServiceAccountTimeoutsArgs

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

Package Details

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