1. Packages
  2. Gitlab Provider
  3. API Docs
  4. InstanceServiceAccount
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.InstanceServiceAccount

Explore with Pulumi AI

The gitlab.InstanceServiceAccount resource allows creating a GitLab instance service account.

In order for a user to create a user account, they must have admin privileges at the instance level. This makes this feature unavailable on gitlab.com

Upstream API: GitLab REST API docs

Create InstanceServiceAccount Resource

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

Constructor syntax

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

@overload
def InstanceServiceAccount(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           name: Optional[str] = None,
                           timeouts: Optional[InstanceServiceAccountTimeoutsArgs] = None,
                           username: Optional[str] = None)
func NewInstanceServiceAccount(ctx *Context, name string, args *InstanceServiceAccountArgs, opts ...ResourceOption) (*InstanceServiceAccount, error)
public InstanceServiceAccount(string name, InstanceServiceAccountArgs? args = null, CustomResourceOptions? opts = null)
public InstanceServiceAccount(String name, InstanceServiceAccountArgs args)
public InstanceServiceAccount(String name, InstanceServiceAccountArgs args, CustomResourceOptions options)
type: gitlab:InstanceServiceAccount
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 InstanceServiceAccountArgs
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 InstanceServiceAccountArgs
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 InstanceServiceAccountArgs
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 InstanceServiceAccountArgs
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. InstanceServiceAccountArgs
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 instanceServiceAccountResource = new GitLab.InstanceServiceAccount("instanceServiceAccountResource", new()
{
    Name = "string",
    Timeouts = new GitLab.Inputs.InstanceServiceAccountTimeoutsArgs
    {
        Delete = "string",
    },
    Username = "string",
});
Copy
example, err := gitlab.NewInstanceServiceAccount(ctx, "instanceServiceAccountResource", &gitlab.InstanceServiceAccountArgs{
	Name: pulumi.String("string"),
	Timeouts: &gitlab.InstanceServiceAccountTimeoutsArgs{
		Delete: pulumi.String("string"),
	},
	Username: pulumi.String("string"),
})
Copy
var instanceServiceAccountResource = new InstanceServiceAccount("instanceServiceAccountResource", InstanceServiceAccountArgs.builder()
    .name("string")
    .timeouts(InstanceServiceAccountTimeoutsArgs.builder()
        .delete("string")
        .build())
    .username("string")
    .build());
Copy
instance_service_account_resource = gitlab.InstanceServiceAccount("instanceServiceAccountResource",
    name="string",
    timeouts={
        "delete": "string",
    },
    username="string")
Copy
const instanceServiceAccountResource = new gitlab.InstanceServiceAccount("instanceServiceAccountResource", {
    name: "string",
    timeouts: {
        "delete": "string",
    },
    username: "string",
});
Copy
type: gitlab:InstanceServiceAccount
properties:
    name: string
    timeouts:
        delete: string
    username: string
Copy

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

Name string
The name of the user. If not specified, the default Service account user name is used.
Timeouts Pulumi.GitLab.Inputs.InstanceServiceAccountTimeouts
Username string
The username of the user. If not specified, it’s automatically generated.
Name string
The name of the user. If not specified, the default Service account user name is used.
Timeouts InstanceServiceAccountTimeoutsArgs
Username string
The username of the user. If not specified, it’s automatically generated.
name String
The name of the user. If not specified, the default Service account user name is used.
timeouts InstanceServiceAccountTimeouts
username String
The username of the user. If not specified, it’s automatically generated.
name string
The name of the user. If not specified, the default Service account user name is used.
timeouts InstanceServiceAccountTimeouts
username string
The username of the user. If not specified, it’s automatically generated.
name str
The name of the user. If not specified, the default Service account user name is used.
timeouts InstanceServiceAccountTimeoutsArgs
username str
The username of the user. If not specified, it’s automatically generated.
name String
The name of the user. If not specified, the default Service account user name is used.
timeouts Property Map
username String
The username of the user. If not specified, it’s automatically generated.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
ServiceAccountId string
The service account id.
Id string
The provider-assigned unique ID for this managed resource.
ServiceAccountId string
The service account id.
id String
The provider-assigned unique ID for this managed resource.
serviceAccountId String
The service account id.
id string
The provider-assigned unique ID for this managed resource.
serviceAccountId string
The service account id.
id str
The provider-assigned unique ID for this managed resource.
service_account_id str
The service account id.
id String
The provider-assigned unique ID for this managed resource.
serviceAccountId String
The service account id.

Look up Existing InstanceServiceAccount Resource

Get an existing InstanceServiceAccount 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?: InstanceServiceAccountState, opts?: CustomResourceOptions): InstanceServiceAccount
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        service_account_id: Optional[str] = None,
        timeouts: Optional[InstanceServiceAccountTimeoutsArgs] = None,
        username: Optional[str] = None) -> InstanceServiceAccount
func GetInstanceServiceAccount(ctx *Context, name string, id IDInput, state *InstanceServiceAccountState, opts ...ResourceOption) (*InstanceServiceAccount, error)
public static InstanceServiceAccount Get(string name, Input<string> id, InstanceServiceAccountState? state, CustomResourceOptions? opts = null)
public static InstanceServiceAccount get(String name, Output<String> id, InstanceServiceAccountState state, CustomResourceOptions options)
resources:  _:    type: gitlab:InstanceServiceAccount    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:
Name string
The name of the user. If not specified, the default Service account user name is used.
ServiceAccountId string
The service account id.
Timeouts Pulumi.GitLab.Inputs.InstanceServiceAccountTimeouts
Username string
The username of the user. If not specified, it’s automatically generated.
Name string
The name of the user. If not specified, the default Service account user name is used.
ServiceAccountId string
The service account id.
Timeouts InstanceServiceAccountTimeoutsArgs
Username string
The username of the user. If not specified, it’s automatically generated.
name String
The name of the user. If not specified, the default Service account user name is used.
serviceAccountId String
The service account id.
timeouts InstanceServiceAccountTimeouts
username String
The username of the user. If not specified, it’s automatically generated.
name string
The name of the user. If not specified, the default Service account user name is used.
serviceAccountId string
The service account id.
timeouts InstanceServiceAccountTimeouts
username string
The username of the user. If not specified, it’s automatically generated.
name str
The name of the user. If not specified, the default Service account user name is used.
service_account_id str
The service account id.
timeouts InstanceServiceAccountTimeoutsArgs
username str
The username of the user. If not specified, it’s automatically generated.
name String
The name of the user. If not specified, the default Service account user name is used.
serviceAccountId String
The service account id.
timeouts Property Map
username String
The username of the user. If not specified, it’s automatically generated.

Supporting Types

InstanceServiceAccountTimeouts
, InstanceServiceAccountTimeoutsArgs

Delete string
A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
Delete string
A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
delete String
A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
delete string
A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
delete str
A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
delete String
A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.

Import

Starting in Terraform v1.5.0 you can use an import block to import gitlab_instance_service_account. For example:

terraform

import {

to = gitlab_instance_service_account.example

id = “see CLI command below for ID”

}

Import using the CLI is supported using the following syntax:

$ pulumi import gitlab:index/instanceServiceAccount:InstanceServiceAccount You can import a group service account using `<resource> <id>`. The
Copy

id is the id of the service account

$ pulumi import gitlab:index/instanceServiceAccount:InstanceServiceAccount example example
Copy

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

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.