1. Packages
  2. Okta
  3. API Docs
  4. profile
  5. Mapping
Okta v4.9.2 published on Tuesday, Jun 25, 2024 by Pulumi

okta.profile.Mapping

Explore with Pulumi AI

okta logo
Okta v4.9.2 published on Tuesday, Jun 25, 2024 by Pulumi

    Manages a profile mapping. This resource allows you to manage a profile mapping by source and target IDs. > NOTE: If using this resource with OAuth2 scopes, this resource requires okta.profileMappings.manage scope.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const user = okta.user.getUserProfileMappingSource({});
    const example = new okta.profile.Mapping("example", {
        sourceId: "<source id>",
        targetId: user.then(user => user.id),
        deleteWhenAbsent: true,
        mappings: [
            {
                id: "firstName",
                expression: "appuser.firstName",
            },
            {
                id: "lastName",
                expression: "appuser.lastName",
            },
            {
                id: "email",
                expression: "appuser.email",
            },
            {
                id: "login",
                expression: "appuser.email",
            },
        ],
    });
    
    import pulumi
    import pulumi_okta as okta
    
    user = okta.user.get_user_profile_mapping_source()
    example = okta.profile.Mapping("example",
        source_id="<source id>",
        target_id=user.id,
        delete_when_absent=True,
        mappings=[
            okta.profile.MappingMappingArgs(
                id="firstName",
                expression="appuser.firstName",
            ),
            okta.profile.MappingMappingArgs(
                id="lastName",
                expression="appuser.lastName",
            ),
            okta.profile.MappingMappingArgs(
                id="email",
                expression="appuser.email",
            ),
            okta.profile.MappingMappingArgs(
                id="login",
                expression="appuser.email",
            ),
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/profile"
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/user"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		user, err := user.GetUserProfileMappingSource(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = profile.NewMapping(ctx, "example", &profile.MappingArgs{
    			SourceId:         pulumi.String("<source id>"),
    			TargetId:         pulumi.String(user.Id),
    			DeleteWhenAbsent: pulumi.Bool(true),
    			Mappings: profile.MappingMappingArray{
    				&profile.MappingMappingArgs{
    					Id:         pulumi.String("firstName"),
    					Expression: pulumi.String("appuser.firstName"),
    				},
    				&profile.MappingMappingArgs{
    					Id:         pulumi.String("lastName"),
    					Expression: pulumi.String("appuser.lastName"),
    				},
    				&profile.MappingMappingArgs{
    					Id:         pulumi.String("email"),
    					Expression: pulumi.String("appuser.email"),
    				},
    				&profile.MappingMappingArgs{
    					Id:         pulumi.String("login"),
    					Expression: pulumi.String("appuser.email"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var user = Okta.User.GetUserProfileMappingSource.Invoke();
    
        var example = new Okta.Profile.Mapping("example", new()
        {
            SourceId = "<source id>",
            TargetId = user.Apply(getUserProfileMappingSourceResult => getUserProfileMappingSourceResult.Id),
            DeleteWhenAbsent = true,
            Mappings = new[]
            {
                new Okta.Profile.Inputs.MappingMappingArgs
                {
                    Id = "firstName",
                    Expression = "appuser.firstName",
                },
                new Okta.Profile.Inputs.MappingMappingArgs
                {
                    Id = "lastName",
                    Expression = "appuser.lastName",
                },
                new Okta.Profile.Inputs.MappingMappingArgs
                {
                    Id = "email",
                    Expression = "appuser.email",
                },
                new Okta.Profile.Inputs.MappingMappingArgs
                {
                    Id = "login",
                    Expression = "appuser.email",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.user.UserFunctions;
    import com.pulumi.okta.profile.Mapping;
    import com.pulumi.okta.profile.MappingArgs;
    import com.pulumi.okta.profile.inputs.MappingMappingArgs;
    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) {
            final var user = UserFunctions.getUserProfileMappingSource();
    
            var example = new Mapping("example", MappingArgs.builder()
                .sourceId("<source id>")
                .targetId(user.applyValue(getUserProfileMappingSourceResult -> getUserProfileMappingSourceResult.id()))
                .deleteWhenAbsent(true)
                .mappings(            
                    MappingMappingArgs.builder()
                        .id("firstName")
                        .expression("appuser.firstName")
                        .build(),
                    MappingMappingArgs.builder()
                        .id("lastName")
                        .expression("appuser.lastName")
                        .build(),
                    MappingMappingArgs.builder()
                        .id("email")
                        .expression("appuser.email")
                        .build(),
                    MappingMappingArgs.builder()
                        .id("login")
                        .expression("appuser.email")
                        .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: okta:profile:Mapping
        properties:
          sourceId: <source id>
          targetId: ${user.id}
          deleteWhenAbsent: true
          mappings:
            - id: firstName
              expression: appuser.firstName
            - id: lastName
              expression: appuser.lastName
            - id: email
              expression: appuser.email
            - id: login
              expression: appuser.email
    variables:
      user:
        fn::invoke:
          Function: okta:user:getUserProfileMappingSource
          Arguments: {}
    

    Create Mapping Resource

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

    Constructor syntax

    new Mapping(name: string, args: MappingArgs, opts?: CustomResourceOptions);
    @overload
    def Mapping(resource_name: str,
                args: MappingArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Mapping(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                source_id: Optional[str] = None,
                target_id: Optional[str] = None,
                always_apply: Optional[bool] = None,
                delete_when_absent: Optional[bool] = None,
                mappings: Optional[Sequence[MappingMappingArgs]] = None)
    func NewMapping(ctx *Context, name string, args MappingArgs, opts ...ResourceOption) (*Mapping, error)
    public Mapping(string name, MappingArgs args, CustomResourceOptions? opts = null)
    public Mapping(String name, MappingArgs args)
    public Mapping(String name, MappingArgs args, CustomResourceOptions options)
    
    type: okta:profile:Mapping
    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 MappingArgs
    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 MappingArgs
    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 MappingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MappingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MappingArgs
    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 mappingResource = new Okta.Profile.Mapping("mappingResource", new()
    {
        SourceId = "string",
        TargetId = "string",
        AlwaysApply = false,
        DeleteWhenAbsent = false,
        Mappings = new[]
        {
            new Okta.Profile.Inputs.MappingMappingArgs
            {
                Expression = "string",
                Id = "string",
                PushStatus = "string",
            },
        },
    });
    
    example, err := profile.NewMapping(ctx, "mappingResource", &profile.MappingArgs{
    	SourceId:         pulumi.String("string"),
    	TargetId:         pulumi.String("string"),
    	AlwaysApply:      pulumi.Bool(false),
    	DeleteWhenAbsent: pulumi.Bool(false),
    	Mappings: profile.MappingMappingArray{
    		&profile.MappingMappingArgs{
    			Expression: pulumi.String("string"),
    			Id:         pulumi.String("string"),
    			PushStatus: pulumi.String("string"),
    		},
    	},
    })
    
    var mappingResource = new Mapping("mappingResource", MappingArgs.builder()
        .sourceId("string")
        .targetId("string")
        .alwaysApply(false)
        .deleteWhenAbsent(false)
        .mappings(MappingMappingArgs.builder()
            .expression("string")
            .id("string")
            .pushStatus("string")
            .build())
        .build());
    
    mapping_resource = okta.profile.Mapping("mappingResource",
        source_id="string",
        target_id="string",
        always_apply=False,
        delete_when_absent=False,
        mappings=[okta.profile.MappingMappingArgs(
            expression="string",
            id="string",
            push_status="string",
        )])
    
    const mappingResource = new okta.profile.Mapping("mappingResource", {
        sourceId: "string",
        targetId: "string",
        alwaysApply: false,
        deleteWhenAbsent: false,
        mappings: [{
            expression: "string",
            id: "string",
            pushStatus: "string",
        }],
    });
    
    type: okta:profile:Mapping
    properties:
        alwaysApply: false
        deleteWhenAbsent: false
        mappings:
            - expression: string
              id: string
              pushStatus: string
        sourceId: string
        targetId: string
    

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

    SourceId string
    The source id of the mapping to manage.
    TargetId string
    The target id of the mapping to manage.
    AlwaysApply bool

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    DeleteWhenAbsent bool
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    Mappings List<MappingMapping>
    SourceId string
    The source id of the mapping to manage.
    TargetId string
    The target id of the mapping to manage.
    AlwaysApply bool

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    DeleteWhenAbsent bool
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    Mappings []MappingMappingArgs
    sourceId String
    The source id of the mapping to manage.
    targetId String
    The target id of the mapping to manage.
    alwaysApply Boolean

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    deleteWhenAbsent Boolean
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings List<MappingMapping>
    sourceId string
    The source id of the mapping to manage.
    targetId string
    The target id of the mapping to manage.
    alwaysApply boolean

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    deleteWhenAbsent boolean
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings MappingMapping[]
    source_id str
    The source id of the mapping to manage.
    target_id str
    The target id of the mapping to manage.
    always_apply bool

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    delete_when_absent bool
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings Sequence[MappingMappingArgs]
    sourceId String
    The source id of the mapping to manage.
    targetId String
    The target id of the mapping to manage.
    alwaysApply Boolean

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    deleteWhenAbsent Boolean
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings List<Property Map>

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    SourceName string
    Name of the mapping source.
    SourceType string
    ID of the mapping source.
    TargetName string
    Name of the mapping target.
    TargetType string
    ID of the mapping target.
    Id string
    The provider-assigned unique ID for this managed resource.
    SourceName string
    Name of the mapping source.
    SourceType string
    ID of the mapping source.
    TargetName string
    Name of the mapping target.
    TargetType string
    ID of the mapping target.
    id String
    The provider-assigned unique ID for this managed resource.
    sourceName String
    Name of the mapping source.
    sourceType String
    ID of the mapping source.
    targetName String
    Name of the mapping target.
    targetType String
    ID of the mapping target.
    id string
    The provider-assigned unique ID for this managed resource.
    sourceName string
    Name of the mapping source.
    sourceType string
    ID of the mapping source.
    targetName string
    Name of the mapping target.
    targetType string
    ID of the mapping target.
    id str
    The provider-assigned unique ID for this managed resource.
    source_name str
    Name of the mapping source.
    source_type str
    ID of the mapping source.
    target_name str
    Name of the mapping target.
    target_type str
    ID of the mapping target.
    id String
    The provider-assigned unique ID for this managed resource.
    sourceName String
    Name of the mapping source.
    sourceType String
    ID of the mapping source.
    targetName String
    Name of the mapping target.
    targetType String
    ID of the mapping target.

    Look up Existing Mapping Resource

    Get an existing Mapping 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?: MappingState, opts?: CustomResourceOptions): Mapping
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            always_apply: Optional[bool] = None,
            delete_when_absent: Optional[bool] = None,
            mappings: Optional[Sequence[MappingMappingArgs]] = None,
            source_id: Optional[str] = None,
            source_name: Optional[str] = None,
            source_type: Optional[str] = None,
            target_id: Optional[str] = None,
            target_name: Optional[str] = None,
            target_type: Optional[str] = None) -> Mapping
    func GetMapping(ctx *Context, name string, id IDInput, state *MappingState, opts ...ResourceOption) (*Mapping, error)
    public static Mapping Get(string name, Input<string> id, MappingState? state, CustomResourceOptions? opts = null)
    public static Mapping get(String name, Output<String> id, MappingState 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:
    AlwaysApply bool

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    DeleteWhenAbsent bool
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    Mappings List<MappingMapping>
    SourceId string
    The source id of the mapping to manage.
    SourceName string
    Name of the mapping source.
    SourceType string
    ID of the mapping source.
    TargetId string
    The target id of the mapping to manage.
    TargetName string
    Name of the mapping target.
    TargetType string
    ID of the mapping target.
    AlwaysApply bool

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    DeleteWhenAbsent bool
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    Mappings []MappingMappingArgs
    SourceId string
    The source id of the mapping to manage.
    SourceName string
    Name of the mapping source.
    SourceType string
    ID of the mapping source.
    TargetId string
    The target id of the mapping to manage.
    TargetName string
    Name of the mapping target.
    TargetType string
    ID of the mapping target.
    alwaysApply Boolean

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    deleteWhenAbsent Boolean
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings List<MappingMapping>
    sourceId String
    The source id of the mapping to manage.
    sourceName String
    Name of the mapping source.
    sourceType String
    ID of the mapping source.
    targetId String
    The target id of the mapping to manage.
    targetName String
    Name of the mapping target.
    targetType String
    ID of the mapping target.
    alwaysApply boolean

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    deleteWhenAbsent boolean
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings MappingMapping[]
    sourceId string
    The source id of the mapping to manage.
    sourceName string
    Name of the mapping source.
    sourceType string
    ID of the mapping source.
    targetId string
    The target id of the mapping to manage.
    targetName string
    Name of the mapping target.
    targetType string
    ID of the mapping target.
    always_apply bool

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    delete_when_absent bool
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings Sequence[MappingMappingArgs]
    source_id str
    The source id of the mapping to manage.
    source_name str
    Name of the mapping source.
    source_type str
    ID of the mapping source.
    target_id str
    The target id of the mapping to manage.
    target_name str
    Name of the mapping target.
    target_type str
    ID of the mapping target.
    alwaysApply Boolean

    Whether apply the changes to all users with this profile after updating or creating the these mappings.

    WARNING:: 'alwaysapply' is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication. WARNING: 'alwaysapply' makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.

    deleteWhenAbsent Boolean
    When turned on this flag will trigger the provider to delete mapping properties that are not defined in config. By default, we do not delete missing properties.
    mappings List<Property Map>
    sourceId String
    The source id of the mapping to manage.
    sourceName String
    Name of the mapping source.
    sourceType String
    ID of the mapping source.
    targetId String
    The target id of the mapping to manage.
    targetName String
    Name of the mapping target.
    targetType String
    ID of the mapping target.

    Supporting Types

    MappingMapping, MappingMappingArgs

    Expression string
    Id string
    The mapping property key.
    PushStatus string
    Expression string
    Id string
    The mapping property key.
    PushStatus string
    expression String
    id String
    The mapping property key.
    pushStatus String
    expression string
    id string
    The mapping property key.
    pushStatus string
    expression str
    id str
    The mapping property key.
    push_status str
    expression String
    id String
    The mapping property key.
    pushStatus String

    Import

    $ pulumi import okta:profile/mapping:Mapping example &#60;id&#62;
    

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

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Okta v4.9.2 published on Tuesday, Jun 25, 2024 by Pulumi