gitlab.GroupServiceAccount
Explore with Pulumi AI
The gitlab.GroupServiceAccount
resource allows creating a GitLab group service account.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = new gitlab.Group("example", {
name: "example",
path: "example",
description: "An example group",
});
const example_sa = new gitlab.GroupServiceAccount("example-sa", {
group: example.id,
name: "example-name",
username: "example-username",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.Group("example",
name="example",
path="example",
description="An example group")
example_sa = gitlab.GroupServiceAccount("example-sa",
group=example.id,
name="example-name",
username="example-username")
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := gitlab.NewGroup(ctx, "example", &gitlab.GroupArgs{
Name: pulumi.String("example"),
Path: pulumi.String("example"),
Description: pulumi.String("An example group"),
})
if err != nil {
return err
}
_, err = gitlab.NewGroupServiceAccount(ctx, "example-sa", &gitlab.GroupServiceAccountArgs{
Group: example.ID(),
Name: pulumi.String("example-name"),
Username: pulumi.String("example-username"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = new GitLab.Group("example", new()
{
Name = "example",
Path = "example",
Description = "An example group",
});
var example_sa = new GitLab.GroupServiceAccount("example-sa", new()
{
Group = example.Id,
Name = "example-name",
Username = "example-username",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Group;
import com.pulumi.gitlab.GroupArgs;
import com.pulumi.gitlab.GroupServiceAccount;
import com.pulumi.gitlab.GroupServiceAccountArgs;
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 example = new Group("example", GroupArgs.builder()
.name("example")
.path("example")
.description("An example group")
.build());
var example_sa = new GroupServiceAccount("example-sa", GroupServiceAccountArgs.builder()
.group(example.id())
.name("example-name")
.username("example-username")
.build());
}
}
resources:
example:
type: gitlab:Group
properties:
name: example
path: example
description: An example group
example-sa:
type: gitlab:GroupServiceAccount
properties:
group: ${example.id}
name: example-name
username: example-username
Create GroupServiceAccount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GroupServiceAccount(name: string, args: GroupServiceAccountArgs, opts?: CustomResourceOptions);
@overload
def GroupServiceAccount(resource_name: str,
args: GroupServiceAccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GroupServiceAccount(resource_name: str,
opts: Optional[ResourceOptions] = None,
group: Optional[str] = None,
name: Optional[str] = None,
username: Optional[str] = None)
func NewGroupServiceAccount(ctx *Context, name string, args GroupServiceAccountArgs, opts ...ResourceOption) (*GroupServiceAccount, error)
public GroupServiceAccount(string name, GroupServiceAccountArgs args, CustomResourceOptions? opts = null)
public GroupServiceAccount(String name, GroupServiceAccountArgs args)
public GroupServiceAccount(String name, GroupServiceAccountArgs args, CustomResourceOptions options)
type: gitlab:GroupServiceAccount
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 GroupServiceAccountArgs
- 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 GroupServiceAccountArgs
- 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 GroupServiceAccountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GroupServiceAccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GroupServiceAccountArgs
- 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 groupServiceAccountResource = new GitLab.GroupServiceAccount("groupServiceAccountResource", new()
{
Group = "string",
Name = "string",
Username = "string",
});
example, err := gitlab.NewGroupServiceAccount(ctx, "groupServiceAccountResource", &gitlab.GroupServiceAccountArgs{
Group: pulumi.String("string"),
Name: pulumi.String("string"),
Username: pulumi.String("string"),
})
var groupServiceAccountResource = new GroupServiceAccount("groupServiceAccountResource", GroupServiceAccountArgs.builder()
.group("string")
.name("string")
.username("string")
.build());
group_service_account_resource = gitlab.GroupServiceAccount("groupServiceAccountResource",
group="string",
name="string",
username="string")
const groupServiceAccountResource = new gitlab.GroupServiceAccount("groupServiceAccountResource", {
group: "string",
name: "string",
username: "string",
});
type: gitlab:GroupServiceAccount
properties:
group: string
name: string
username: string
GroupServiceAccount 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 GroupServiceAccount resource accepts the following input properties:
- Group string
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- Name string
- The name of the user. If not specified, the default Service account user name is used.
- Username string
- The username of the user. If not specified, it’s automatically generated.
- Group string
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- Name string
- The name of the user. If not specified, the default Service account user name is used.
- Username string
- The username of the user. If not specified, it’s automatically generated.
- group String
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- name String
- The name of the user. If not specified, the default Service account user name is used.
- username String
- The username of the user. If not specified, it’s automatically generated.
- group string
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- name string
- The name of the user. If not specified, the default Service account user name is used.
- username string
- The username of the user. If not specified, it’s automatically generated.
- group String
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- name String
- The name of the user. If not specified, the default Service account user name is used.
- 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 GroupServiceAccount resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Service
Account stringId - The service account id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Service
Account stringId - The service account id.
- id String
- The provider-assigned unique ID for this managed resource.
- service
Account StringId - The service account id.
- id string
- The provider-assigned unique ID for this managed resource.
- service
Account stringId - The service account id.
- id str
- The provider-assigned unique ID for this managed resource.
- service_
account_ strid - The service account id.
- id String
- The provider-assigned unique ID for this managed resource.
- service
Account StringId - The service account id.
Look up Existing GroupServiceAccount Resource
Get an existing GroupServiceAccount 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?: GroupServiceAccountState, opts?: CustomResourceOptions): GroupServiceAccount
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
group: Optional[str] = None,
name: Optional[str] = None,
service_account_id: Optional[str] = None,
username: Optional[str] = None) -> GroupServiceAccount
func GetGroupServiceAccount(ctx *Context, name string, id IDInput, state *GroupServiceAccountState, opts ...ResourceOption) (*GroupServiceAccount, error)
public static GroupServiceAccount Get(string name, Input<string> id, GroupServiceAccountState? state, CustomResourceOptions? opts = null)
public static GroupServiceAccount get(String name, Output<String> id, GroupServiceAccountState 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.
- Group string
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- Name string
- The name of the user. If not specified, the default Service account user name is used.
- Service
Account stringId - The service account id.
- Username string
- The username of the user. If not specified, it’s automatically generated.
- Group string
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- Name string
- The name of the user. If not specified, the default Service account user name is used.
- Service
Account stringId - The service account id.
- Username string
- The username of the user. If not specified, it’s automatically generated.
- group String
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- name String
- The name of the user. If not specified, the default Service account user name is used.
- service
Account StringId - The service account id.
- username String
- The username of the user. If not specified, it’s automatically generated.
- group string
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- name string
- The name of the user. If not specified, the default Service account user name is used.
- service
Account stringId - The service account id.
- username string
- The username of the user. If not specified, it’s automatically generated.
- group str
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- name str
- The name of the user. If not specified, the default Service account user name is used.
- service_
account_ strid - The service account id.
- username str
- The username of the user. If not specified, it’s automatically generated.
- group String
- The ID or URL-encoded path of the group that the service account is created in. Must be a top level group.
- name String
- The name of the user. If not specified, the default Service account user name is used.
- service
Account StringId - The service account id.
- username String
- The username of the user. If not specified, it’s automatically generated.
Import
$ pulumi import gitlab:index/groupServiceAccount:GroupServiceAccount You can import a group service account using `<resource> <id>`. The
id
is in the form of <group_id>:<service_account_id>
$ pulumi import gitlab:index/groupServiceAccount:GroupServiceAccount example example
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.