1. Packages
  2. GitLab
  3. API Docs
  4. Application
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

gitlab.Application

Explore with Pulumi AI

gitlab logo
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

    The gitlab.Application resource allows to manage the lifecycle of applications in gitlab.

    In order to use a user for a user to create an application, they must have admin privileges at the instance level. To create an OIDC application, a scope of “openid”.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const oidc = new gitlab.Application("oidc", {
        confidential: true,
        scopes: ["openid"],
        name: "company_oidc",
        redirectUrl: "https://mycompany.com",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    oidc = gitlab.Application("oidc",
        confidential=True,
        scopes=["openid"],
        name="company_oidc",
        redirect_url="https://mycompany.com")
    
    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 {
    		_, err := gitlab.NewApplication(ctx, "oidc", &gitlab.ApplicationArgs{
    			Confidential: pulumi.Bool(true),
    			Scopes: pulumi.StringArray{
    				pulumi.String("openid"),
    			},
    			Name:        pulumi.String("company_oidc"),
    			RedirectUrl: pulumi.String("https://mycompany.com"),
    		})
    		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 oidc = new GitLab.Application("oidc", new()
        {
            Confidential = true,
            Scopes = new[]
            {
                "openid",
            },
            Name = "company_oidc",
            RedirectUrl = "https://mycompany.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.Application;
    import com.pulumi.gitlab.ApplicationArgs;
    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 oidc = new Application("oidc", ApplicationArgs.builder()
                .confidential(true)
                .scopes("openid")
                .name("company_oidc")
                .redirectUrl("https://mycompany.com")
                .build());
    
        }
    }
    
    resources:
      oidc:
        type: gitlab:Application
        properties:
          confidential: true
          scopes:
            - openid
          name: company_oidc
          redirectUrl: https://mycompany.com
    

    Create Application Resource

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

    Constructor syntax

    new Application(name: string, args: ApplicationArgs, opts?: CustomResourceOptions);
    @overload
    def Application(resource_name: str,
                    args: ApplicationArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Application(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    redirect_url: Optional[str] = None,
                    scopes: Optional[Sequence[str]] = None,
                    confidential: Optional[bool] = None,
                    name: Optional[str] = None)
    func NewApplication(ctx *Context, name string, args ApplicationArgs, opts ...ResourceOption) (*Application, error)
    public Application(string name, ApplicationArgs args, CustomResourceOptions? opts = null)
    public Application(String name, ApplicationArgs args)
    public Application(String name, ApplicationArgs args, CustomResourceOptions options)
    
    type: gitlab:Application
    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 ApplicationArgs
    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 ApplicationArgs
    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 ApplicationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApplicationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApplicationArgs
    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 applicationResource = new GitLab.Application("applicationResource", new()
    {
        RedirectUrl = "string",
        Scopes = new[]
        {
            "string",
        },
        Confidential = false,
        Name = "string",
    });
    
    example, err := gitlab.NewApplication(ctx, "applicationResource", &gitlab.ApplicationArgs{
    	RedirectUrl: pulumi.String("string"),
    	Scopes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Confidential: pulumi.Bool(false),
    	Name:         pulumi.String("string"),
    })
    
    var applicationResource = new Application("applicationResource", ApplicationArgs.builder()
        .redirectUrl("string")
        .scopes("string")
        .confidential(false)
        .name("string")
        .build());
    
    application_resource = gitlab.Application("applicationResource",
        redirect_url="string",
        scopes=["string"],
        confidential=False,
        name="string")
    
    const applicationResource = new gitlab.Application("applicationResource", {
        redirectUrl: "string",
        scopes: ["string"],
        confidential: false,
        name: "string",
    });
    
    type: gitlab:Application
    properties:
        confidential: false
        name: string
        redirectUrl: string
        scopes:
            - string
    

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

    RedirectUrl string
    The URL gitlab should send the user to after authentication.
    Scopes List<string>
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    Confidential bool
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    Name string
    Name of the application.
    RedirectUrl string
    The URL gitlab should send the user to after authentication.
    Scopes []string
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    Confidential bool
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    Name string
    Name of the application.
    redirectUrl String
    The URL gitlab should send the user to after authentication.
    scopes List<String>
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    confidential Boolean
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name String
    Name of the application.
    redirectUrl string
    The URL gitlab should send the user to after authentication.
    scopes string[]
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    confidential boolean
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name string
    Name of the application.
    redirect_url str
    The URL gitlab should send the user to after authentication.
    scopes Sequence[str]
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    confidential bool
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name str
    Name of the application.
    redirectUrl String
    The URL gitlab should send the user to after authentication.
    scopes List<String>
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    confidential Boolean
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name String
    Name of the application.

    Outputs

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

    ApplicationId string
    Internal name of the application.
    Id string
    The provider-assigned unique ID for this managed resource.
    Secret string
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    ApplicationId string
    Internal name of the application.
    Id string
    The provider-assigned unique ID for this managed resource.
    Secret string
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    applicationId String
    Internal name of the application.
    id String
    The provider-assigned unique ID for this managed resource.
    secret String
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    applicationId string
    Internal name of the application.
    id string
    The provider-assigned unique ID for this managed resource.
    secret string
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    application_id str
    Internal name of the application.
    id str
    The provider-assigned unique ID for this managed resource.
    secret str
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    applicationId String
    Internal name of the application.
    id String
    The provider-assigned unique ID for this managed resource.
    secret String
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.

    Look up Existing Application Resource

    Get an existing Application 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?: ApplicationState, opts?: CustomResourceOptions): Application
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_id: Optional[str] = None,
            confidential: Optional[bool] = None,
            name: Optional[str] = None,
            redirect_url: Optional[str] = None,
            scopes: Optional[Sequence[str]] = None,
            secret: Optional[str] = None) -> Application
    func GetApplication(ctx *Context, name string, id IDInput, state *ApplicationState, opts ...ResourceOption) (*Application, error)
    public static Application Get(string name, Input<string> id, ApplicationState? state, CustomResourceOptions? opts = null)
    public static Application get(String name, Output<String> id, ApplicationState 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:
    ApplicationId string
    Internal name of the application.
    Confidential bool
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    Name string
    Name of the application.
    RedirectUrl string
    The URL gitlab should send the user to after authentication.
    Scopes List<string>
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    Secret string
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    ApplicationId string
    Internal name of the application.
    Confidential bool
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    Name string
    Name of the application.
    RedirectUrl string
    The URL gitlab should send the user to after authentication.
    Scopes []string
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    Secret string
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    applicationId String
    Internal name of the application.
    confidential Boolean
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name String
    Name of the application.
    redirectUrl String
    The URL gitlab should send the user to after authentication.
    scopes List<String>
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    secret String
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    applicationId string
    Internal name of the application.
    confidential boolean
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name string
    Name of the application.
    redirectUrl string
    The URL gitlab should send the user to after authentication.
    scopes string[]
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    secret string
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    application_id str
    Internal name of the application.
    confidential bool
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name str
    Name of the application.
    redirect_url str
    The URL gitlab should send the user to after authentication.
    scopes Sequence[str]
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    secret str
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.
    applicationId String
    Internal name of the application.
    confidential Boolean
    The application is used where the client secret can be kept confidential. Native mobile apps and Single Page Apps are considered non-confidential. Defaults to true if not supplied
    name String
    Name of the application.
    redirectUrl String
    The URL gitlab should send the user to after authentication.
    scopes List<String>
    Scopes of the application. Use "openid" if you plan to use this as an oidc authentication application. Valid options are: api, read_api, read_user, read_repository, write_repository, read_registry, write_registry, sudo, admin_mode, openid, profile, email. This is only populated when creating a new application. This attribute is not available for imported resources
    secret String
    Application secret. Sensitive and must be kept secret. This is only populated when creating a new application. This attribute is not available for imported resources.

    Import

    Gitlab applications can be imported with their id, e.g.

    $ pulumi import gitlab:index/application:Application example "1"
    

    NOTE: the secret and scopes cannot be imported

    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.
    gitlab logo
    GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi