1. Packages
  2. Sonarqube Provider
  3. API Docs
  4. UserExternalIdentity
sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata

sonarqube.UserExternalIdentity

Explore with Pulumi AI

sonarqube logo
sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata

    Updates the external identity of a non local Sonarqube User. This can be used to set the Identity Provider which should be used to authenticate a specific user.

    The Sonarqube API currently does not provide an endpoint to read the external identity setting of an user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as sonarqube from "@pulumi/sonarqube";
    
    //# Example: change the external identity to SAML
    const remoteUserUser = new sonarqube.User("remoteUserUser", {
        loginName: "terraform-test",
        email: "terraform-test@sonarqube.com",
        isLocal: false,
    });
    const remoteUserUserExternalIdentity = new sonarqube.UserExternalIdentity("remoteUserUserExternalIdentity", {
        loginName: remoteUserUser.loginName,
        externalIdentity: "terraform-test@sonarqube.com",
        externalProvider: "saml",
    });
    
    import pulumi
    import pulumi_sonarqube as sonarqube
    
    ## Example: change the external identity to SAML
    remote_user_user = sonarqube.User("remoteUserUser",
        login_name="terraform-test",
        email="terraform-test@sonarqube.com",
        is_local=False)
    remote_user_user_external_identity = sonarqube.UserExternalIdentity("remoteUserUserExternalIdentity",
        login_name=remote_user_user.login_name,
        external_identity="terraform-test@sonarqube.com",
        external_provider="saml")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/sonarqube/sonarqube"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// # Example: change the external identity to SAML
    		remoteUserUser, err := sonarqube.NewUser(ctx, "remoteUserUser", &sonarqube.UserArgs{
    			LoginName: pulumi.String("terraform-test"),
    			Email:     pulumi.String("terraform-test@sonarqube.com"),
    			IsLocal:   pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = sonarqube.NewUserExternalIdentity(ctx, "remoteUserUserExternalIdentity", &sonarqube.UserExternalIdentityArgs{
    			LoginName:        remoteUserUser.LoginName,
    			ExternalIdentity: pulumi.String("terraform-test@sonarqube.com"),
    			ExternalProvider: pulumi.String("saml"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Sonarqube = Pulumi.Sonarqube;
    
    return await Deployment.RunAsync(() => 
    {
        //# Example: change the external identity to SAML
        var remoteUserUser = new Sonarqube.User("remoteUserUser", new()
        {
            LoginName = "terraform-test",
            Email = "terraform-test@sonarqube.com",
            IsLocal = false,
        });
    
        var remoteUserUserExternalIdentity = new Sonarqube.UserExternalIdentity("remoteUserUserExternalIdentity", new()
        {
            LoginName = remoteUserUser.LoginName,
            ExternalIdentity = "terraform-test@sonarqube.com",
            ExternalProvider = "saml",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sonarqube.User;
    import com.pulumi.sonarqube.UserArgs;
    import com.pulumi.sonarqube.UserExternalIdentity;
    import com.pulumi.sonarqube.UserExternalIdentityArgs;
    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) {
            //# Example: change the external identity to SAML
            var remoteUserUser = new User("remoteUserUser", UserArgs.builder()
                .loginName("terraform-test")
                .email("terraform-test@sonarqube.com")
                .isLocal(false)
                .build());
    
            var remoteUserUserExternalIdentity = new UserExternalIdentity("remoteUserUserExternalIdentity", UserExternalIdentityArgs.builder()
                .loginName(remoteUserUser.loginName())
                .externalIdentity("terraform-test@sonarqube.com")
                .externalProvider("saml")
                .build());
    
        }
    }
    
    resources:
      ## Example: change the external identity to SAML
      remoteUserUser:
        type: sonarqube:User
        properties:
          loginName: terraform-test
          email: terraform-test@sonarqube.com
          isLocal: false
      remoteUserUserExternalIdentity:
        type: sonarqube:UserExternalIdentity
        properties:
          loginName: ${remoteUserUser.loginName}
          externalIdentity: terraform-test@sonarqube.com
          externalProvider: saml
    

    Create UserExternalIdentity Resource

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

    Constructor syntax

    new UserExternalIdentity(name: string, args: UserExternalIdentityArgs, opts?: CustomResourceOptions);
    @overload
    def UserExternalIdentity(resource_name: str,
                             args: UserExternalIdentityArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserExternalIdentity(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             external_identity: Optional[str] = None,
                             external_provider: Optional[str] = None,
                             login_name: Optional[str] = None,
                             user_external_identity_id: Optional[str] = None)
    func NewUserExternalIdentity(ctx *Context, name string, args UserExternalIdentityArgs, opts ...ResourceOption) (*UserExternalIdentity, error)
    public UserExternalIdentity(string name, UserExternalIdentityArgs args, CustomResourceOptions? opts = null)
    public UserExternalIdentity(String name, UserExternalIdentityArgs args)
    public UserExternalIdentity(String name, UserExternalIdentityArgs args, CustomResourceOptions options)
    
    type: sonarqube:UserExternalIdentity
    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 UserExternalIdentityArgs
    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 UserExternalIdentityArgs
    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 UserExternalIdentityArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserExternalIdentityArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserExternalIdentityArgs
    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 userExternalIdentityResource = new Sonarqube.UserExternalIdentity("userExternalIdentityResource", new()
    {
        ExternalIdentity = "string",
        ExternalProvider = "string",
        LoginName = "string",
        UserExternalIdentityId = "string",
    });
    
    example, err := sonarqube.NewUserExternalIdentity(ctx, "userExternalIdentityResource", &sonarqube.UserExternalIdentityArgs{
    	ExternalIdentity:       pulumi.String("string"),
    	ExternalProvider:       pulumi.String("string"),
    	LoginName:              pulumi.String("string"),
    	UserExternalIdentityId: pulumi.String("string"),
    })
    
    var userExternalIdentityResource = new UserExternalIdentity("userExternalIdentityResource", UserExternalIdentityArgs.builder()
        .externalIdentity("string")
        .externalProvider("string")
        .loginName("string")
        .userExternalIdentityId("string")
        .build());
    
    user_external_identity_resource = sonarqube.UserExternalIdentity("userExternalIdentityResource",
        external_identity="string",
        external_provider="string",
        login_name="string",
        user_external_identity_id="string")
    
    const userExternalIdentityResource = new sonarqube.UserExternalIdentity("userExternalIdentityResource", {
        externalIdentity: "string",
        externalProvider: "string",
        loginName: "string",
        userExternalIdentityId: "string",
    });
    
    type: sonarqube:UserExternalIdentity
    properties:
        externalIdentity: string
        externalProvider: string
        loginName: string
        userExternalIdentityId: string
    

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

    ExternalIdentity string
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    ExternalProvider string
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    LoginName string
    The login name of the User to update. Changing this forces a new resource to be created.
    UserExternalIdentityId string
    The ID of this resource.
    ExternalIdentity string
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    ExternalProvider string
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    LoginName string
    The login name of the User to update. Changing this forces a new resource to be created.
    UserExternalIdentityId string
    The ID of this resource.
    externalIdentity String
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    externalProvider String
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    loginName String
    The login name of the User to update. Changing this forces a new resource to be created.
    userExternalIdentityId String
    The ID of this resource.
    externalIdentity string
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    externalProvider string
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    loginName string
    The login name of the User to update. Changing this forces a new resource to be created.
    userExternalIdentityId string
    The ID of this resource.
    external_identity str
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    external_provider str
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    login_name str
    The login name of the User to update. Changing this forces a new resource to be created.
    user_external_identity_id str
    The ID of this resource.
    externalIdentity String
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    externalProvider String
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    loginName String
    The login name of the User to update. Changing this forces a new resource to be created.
    userExternalIdentityId String
    The ID of this resource.

    Outputs

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

    Get an existing UserExternalIdentity 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?: UserExternalIdentityState, opts?: CustomResourceOptions): UserExternalIdentity
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            external_identity: Optional[str] = None,
            external_provider: Optional[str] = None,
            login_name: Optional[str] = None,
            user_external_identity_id: Optional[str] = None) -> UserExternalIdentity
    func GetUserExternalIdentity(ctx *Context, name string, id IDInput, state *UserExternalIdentityState, opts ...ResourceOption) (*UserExternalIdentity, error)
    public static UserExternalIdentity Get(string name, Input<string> id, UserExternalIdentityState? state, CustomResourceOptions? opts = null)
    public static UserExternalIdentity get(String name, Output<String> id, UserExternalIdentityState state, CustomResourceOptions options)
    resources:  _:    type: sonarqube:UserExternalIdentity    get:      id: ${id}
    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:
    ExternalIdentity string
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    ExternalProvider string
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    LoginName string
    The login name of the User to update. Changing this forces a new resource to be created.
    UserExternalIdentityId string
    The ID of this resource.
    ExternalIdentity string
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    ExternalProvider string
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    LoginName string
    The login name of the User to update. Changing this forces a new resource to be created.
    UserExternalIdentityId string
    The ID of this resource.
    externalIdentity String
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    externalProvider String
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    loginName String
    The login name of the User to update. Changing this forces a new resource to be created.
    userExternalIdentityId String
    The ID of this resource.
    externalIdentity string
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    externalProvider string
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    loginName string
    The login name of the User to update. Changing this forces a new resource to be created.
    userExternalIdentityId string
    The ID of this resource.
    external_identity str
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    external_provider str
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    login_name str
    The login name of the User to update. Changing this forces a new resource to be created.
    user_external_identity_id str
    The ID of this resource.
    externalIdentity String
    The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.
    externalProvider String
    The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.
    loginName String
    The login name of the User to update. Changing this forces a new resource to be created.
    userExternalIdentityId String
    The ID of this resource.

    Package Details

    Repository
    sonarqube jdamata/terraform-provider-sonarqube
    License
    Notes
    This Pulumi package is based on the sonarqube Terraform Provider.
    sonarqube logo
    sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata