okta.profile.Mapping
Explore with Pulumi AI
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", {
deleteWhenAbsent: true,
mappings: [
{
expression: "appuser.firstName",
id: "firstName",
},
{
expression: "appuser.lastName",
id: "lastName",
},
{
expression: "appuser.email",
id: "email",
},
{
expression: "appuser.email",
id: "login",
},
],
sourceId: "<source id>",
targetId: user.then(user => user.id),
});
import pulumi
import pulumi_okta as okta
user = okta.user.get_user_profile_mapping_source()
example = okta.profile.Mapping("example",
delete_when_absent=True,
mappings=[
okta.profile.MappingMappingArgs(
expression="appuser.firstName",
id="firstName",
),
okta.profile.MappingMappingArgs(
expression="appuser.lastName",
id="lastName",
),
okta.profile.MappingMappingArgs(
expression="appuser.email",
id="email",
),
okta.profile.MappingMappingArgs(
expression="appuser.email",
id="login",
),
],
source_id="<source id>",
target_id=user.id)
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{
DeleteWhenAbsent: pulumi.Bool(true),
Mappings: profile.MappingMappingArray{
&profile.MappingMappingArgs{
Expression: pulumi.String("appuser.firstName"),
Id: pulumi.String("firstName"),
},
&profile.MappingMappingArgs{
Expression: pulumi.String("appuser.lastName"),
Id: pulumi.String("lastName"),
},
&profile.MappingMappingArgs{
Expression: pulumi.String("appuser.email"),
Id: pulumi.String("email"),
},
&profile.MappingMappingArgs{
Expression: pulumi.String("appuser.email"),
Id: pulumi.String("login"),
},
},
SourceId: pulumi.String("<source id>"),
TargetId: pulumi.String(user.Id),
})
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()
{
DeleteWhenAbsent = true,
Mappings = new[]
{
new Okta.Profile.Inputs.MappingMappingArgs
{
Expression = "appuser.firstName",
Id = "firstName",
},
new Okta.Profile.Inputs.MappingMappingArgs
{
Expression = "appuser.lastName",
Id = "lastName",
},
new Okta.Profile.Inputs.MappingMappingArgs
{
Expression = "appuser.email",
Id = "email",
},
new Okta.Profile.Inputs.MappingMappingArgs
{
Expression = "appuser.email",
Id = "login",
},
},
SourceId = "<source id>",
TargetId = user.Apply(getUserProfileMappingSourceResult => getUserProfileMappingSourceResult.Id),
});
});
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()
.deleteWhenAbsent(true)
.mappings(
MappingMappingArgs.builder()
.expression("appuser.firstName")
.id("firstName")
.build(),
MappingMappingArgs.builder()
.expression("appuser.lastName")
.id("lastName")
.build(),
MappingMappingArgs.builder()
.expression("appuser.email")
.id("email")
.build(),
MappingMappingArgs.builder()
.expression("appuser.email")
.id("login")
.build())
.sourceId("<source id>")
.targetId(user.applyValue(getUserProfileMappingSourceResult -> getUserProfileMappingSourceResult.id()))
.build());
}
}
resources:
example:
type: okta:profile:Mapping
properties:
deleteWhenAbsent: true
mappings:
- expression: appuser.firstName
id: firstName
- expression: appuser.lastName
id: lastName
- expression: appuser.email
id: email
- expression: appuser.email
id: login
sourceId: <source id>
targetId: ${user.id}
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.
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:
- Source
Id string - Source id of the profile mapping.
- Target
Id 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:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- Delete
When boolAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- Mappings
List<Mapping
Mapping> - Priority of the policy.
- Source
Id string - Source id of the profile mapping.
- Target
Id 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:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- Delete
When boolAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- Mappings
[]Mapping
Mapping Args - Priority of the policy.
- source
Id String - Source id of the profile mapping.
- target
Id String - ID of the mapping target.
- always
Apply Boolean Whether apply the changes to all users with this profile after updating or creating the these mappings.
WARNING:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete
When BooleanAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings
List<Mapping
Mapping> - Priority of the policy.
- source
Id string - Source id of the profile mapping.
- target
Id string - ID of the mapping target.
- always
Apply boolean Whether apply the changes to all users with this profile after updating or creating the these mappings.
WARNING:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete
When booleanAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings
Mapping
Mapping[] - Priority of the policy.
- source_
id str - Source id of the profile mapping.
- target_
id str - 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:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete_
when_ boolabsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings
Sequence[Mapping
Mapping Args] - Priority of the policy.
- source
Id String - Source id of the profile mapping.
- target
Id String - ID of the mapping target.
- always
Apply Boolean Whether apply the changes to all users with this profile after updating or creating the these mappings.
WARNING:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete
When BooleanAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings List<Property Map>
- Priority of the policy.
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.
- Source
Name string - Name of the mapping source.
- Source
Type string - ID of the mapping source.
- Target
Name string - Name of the mapping target.
- Target
Type string - ID of the mapping target.
- Id string
- The provider-assigned unique ID for this managed resource.
- Source
Name string - Name of the mapping source.
- Source
Type string - ID of the mapping source.
- Target
Name string - Name of the mapping target.
- Target
Type string - ID of the mapping target.
- id String
- The provider-assigned unique ID for this managed resource.
- source
Name String - Name of the mapping source.
- source
Type String - ID of the mapping source.
- target
Name String - Name of the mapping target.
- target
Type String - ID of the mapping target.
- id string
- The provider-assigned unique ID for this managed resource.
- source
Name string - Name of the mapping source.
- source
Type string - ID of the mapping source.
- target
Name string - Name of the mapping target.
- target
Type 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.
- source
Name String - Name of the mapping source.
- source
Type String - ID of the mapping source.
- target
Name String - Name of the mapping target.
- target
Type 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.
- Always
Apply bool Whether apply the changes to all users with this profile after updating or creating the these mappings.
WARNING:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- Delete
When boolAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- Mappings
List<Mapping
Mapping> - Priority of the policy.
- Source
Id string - Source id of the profile mapping.
- Source
Name string - Name of the mapping source.
- Source
Type string - ID of the mapping source.
- Target
Id string - ID of the mapping target.
- Target
Name string - Name of the mapping target.
- Target
Type 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:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- Delete
When boolAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- Mappings
[]Mapping
Mapping Args - Priority of the policy.
- Source
Id string - Source id of the profile mapping.
- Source
Name string - Name of the mapping source.
- Source
Type string - ID of the mapping source.
- Target
Id string - ID of the mapping target.
- Target
Name string - Name of the mapping target.
- Target
Type string - ID of the mapping target.
- always
Apply Boolean Whether apply the changes to all users with this profile after updating or creating the these mappings.
WARNING:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete
When BooleanAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings
List<Mapping
Mapping> - Priority of the policy.
- source
Id String - Source id of the profile mapping.
- source
Name String - Name of the mapping source.
- source
Type String - ID of the mapping source.
- target
Id String - ID of the mapping target.
- target
Name String - Name of the mapping target.
- target
Type String - ID of the mapping target.
- always
Apply boolean Whether apply the changes to all users with this profile after updating or creating the these mappings.
WARNING:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete
When booleanAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings
Mapping
Mapping[] - Priority of the policy.
- source
Id string - Source id of the profile mapping.
- source
Name string - Name of the mapping source.
- source
Type string - ID of the mapping source.
- target
Id string - ID of the mapping target.
- target
Name string - Name of the mapping target.
- target
Type 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:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete_
when_ boolabsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings
Sequence[Mapping
Mapping Args] - Priority of the policy.
- source_
id str - Source id of the profile mapping.
- source_
name str - Name of the mapping source.
- source_
type str - ID of the mapping source.
- target_
id str - ID of the mapping target.
- target_
name str - Name of the mapping target.
- target_
type str - ID of the mapping target.
- always
Apply Boolean Whether apply the changes to all users with this profile after updating or creating the these mappings.
WARNING:
always_apply
is incompatible with OAuth 2.0 authentication and will be ignored when using that type of authentication.WARNING:
always_apply
makes use of an internal/private Okta API endpoint that could change without notice rendering this resource inoperable.- delete
When BooleanAbsent - Tells the provider whether to attempt to delete missing mappings under profile mapping.
- mappings List<Property Map>
- Priority of the policy.
- source
Id String - Source id of the profile mapping.
- source
Name String - Name of the mapping source.
- source
Type String - ID of the mapping source.
- target
Id String - ID of the mapping target.
- target
Name String - Name of the mapping target.
- target
Type String - ID of the mapping target.
Supporting Types
MappingMapping, MappingMappingArgs
- Expression string
- Combination or single source properties that will be mapped to the target property.
- Id string
- Key of mapping.
- Push
Status string - Whether to update target properties on user create & update or just on create.
- Expression string
- Combination or single source properties that will be mapped to the target property.
- Id string
- Key of mapping.
- Push
Status string - Whether to update target properties on user create & update or just on create.
- expression String
- Combination or single source properties that will be mapped to the target property.
- id String
- Key of mapping.
- push
Status String - Whether to update target properties on user create & update or just on create.
- expression string
- Combination or single source properties that will be mapped to the target property.
- id string
- Key of mapping.
- push
Status string - Whether to update target properties on user create & update or just on create.
- expression str
- Combination or single source properties that will be mapped to the target property.
- id str
- Key of mapping.
- push_
status str - Whether to update target properties on user create & update or just on create.
- expression String
- Combination or single source properties that will be mapped to the target property.
- id String
- Key of mapping.
- push
Status String - Whether to update target properties on user create & update or just on create.
Import
There is no reason to import this resource. You can simply create the resource config and point it to a source ID. Mind here, once the source is deleted this resources will no longer exist.
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.