okta.profile.Mapping
Explore with Pulumi AI
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=[
{
"id": "firstName",
"expression": "appuser.firstName",
},
{
"id": "lastName",
"expression": "appuser.lastName",
},
{
"id": "email",
"expression": "appuser.email",
},
{
"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, map[string]interface{}{}, 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=[{
"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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Mapping resource accepts the following input properties:
- Source
Id string - The source id of the mapping to manage.
- Target
Id string - 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 boolAbsent - 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<Mapping
Mapping>
- Source
Id string - The source id of the mapping to manage.
- Target
Id string - 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 boolAbsent - 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
[]Mapping
Mapping Args
- source
Id String - The source id of the mapping to manage.
- target
Id String - The target id of the mapping to manage.
- always
Apply 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.
- delete
When BooleanAbsent - 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<Mapping
Mapping>
- source
Id string - The source id of the mapping to manage.
- target
Id string - The target id of the mapping to manage.
- always
Apply 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.
- delete
When booleanAbsent - 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
Mapping
Mapping[]
- 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_ boolabsent - 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[Mapping
Mapping Args]
- source
Id String - The source id of the mapping to manage.
- target
Id String - The target id of the mapping to manage.
- always
Apply 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.
- delete
When BooleanAbsent - 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.
- 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:: '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 boolAbsent - 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<Mapping
Mapping> - Source
Id string - The source id of the mapping to manage.
- Source
Name string - Name of the mapping source.
- Source
Type string - ID of the mapping source.
- Target
Id string - The target id of the mapping to manage.
- 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:: '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 boolAbsent - 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
[]Mapping
Mapping Args - Source
Id string - The source id of the mapping to manage.
- Source
Name string - Name of the mapping source.
- Source
Type string - ID of the mapping source.
- Target
Id string - The target id of the mapping to manage.
- 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:: '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 BooleanAbsent - 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<Mapping
Mapping> - source
Id String - The source id of the mapping to manage.
- source
Name String - Name of the mapping source.
- source
Type String - ID of the mapping source.
- target
Id String - The target id of the mapping to manage.
- 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:: '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 booleanAbsent - 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
Mapping
Mapping[] - source
Id string - The source id of the mapping to manage.
- source
Name string - Name of the mapping source.
- source
Type string - ID of the mapping source.
- target
Id string - The target id of the mapping to manage.
- 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:: '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_ boolabsent - 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[Mapping
Mapping Args] - 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.
- always
Apply 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.
- delete
When BooleanAbsent - 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>
- source
Id String - The source id of the mapping to manage.
- source
Name String - Name of the mapping source.
- source
Type String - ID of the mapping source.
- target
Id String - The target id of the mapping to manage.
- target
Name String - Name of the mapping target.
- target
Type String - ID of the mapping target.
Supporting Types
MappingMapping, MappingMappingArgs
- Expression string
- Id string
- The mapping property key.
- Push
Status string
- Expression string
- Id string
- The mapping property key.
- Push
Status string
- expression String
- id String
- The mapping property key.
- push
Status String
- expression string
- id string
- The mapping property key.
- push
Status string
- expression str
- id str
- The mapping property key.
- push_
status str
- expression String
- id String
- The mapping property key.
- push
Status String
Package Details
- Repository
- Okta pulumi/pulumi-okta
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
okta
Terraform Provider.