Skip to main content

Import Resources

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Import applies a configuration file to your organization. The file is a YAML bundle of one or more resource documents, such as the file an export downloads. You import it in the Console, which validates the file and tests the import before it changes anything.

note

Declarative resource attributes use camelCase, for example ouId, authFlowId and clientId.

note

An application resource requires a type attribute (browser, fullstack, mobile, m2m, or custom). The type is set on creation and does not change on a later import. See Application Types.

Use import when you want to:

  • Set up resources from a YAML bundle.
  • Move resource definitions from one environment to another.
  • Test resource definitions before applying them.

Import a Configuration File​

  1. Sign in to the Console, switch to the organization view, and go to Configurations.
  2. Open the Import / Export tab and select Import.
  3. On Import configuration, add the YAML file. Drop it on the Upload file tab, or open From URL and enter the Configuration URL.
  4. If the file uses template variables, upload the environment file under Environment variables. You can also add the values in the next step.
  5. Click Continue. The Console reads the file and validates its YAML and resources. If a section cannot be parsed, it lists the parse errors. Click Upload different file to fix the file and start again.
  6. On Configuration summary, review the resources the file contains. Under Pre-import validation, the Console reports any environment value the file refers to but does not have. Add the missing values in the Environment variables editor, or click Re-upload .env file.
  7. Click Test to run the import as a dry run. Import test status shows how many resources passed, and lists each one that failed with its reason.
  8. When the test passes, click Import configuration. The Console reports how many resources were imported and how many failed, then takes you to the home page.

Import configuration stays disabled until every environment value is present and the test has passed.

Deploy your changes

Saving a change does not make it live. You author in the control plane, and your users sign in on a separate data plane, so a change takes effect in an environment only after you deploy it. Go to Deploy, deploy the latest version to your first environment, then promote it to the next environment when you are ready.

Auto-sync deploys saved changes to your first environment within seconds. Turning it on is your choice, per project. See Deploy a Version, or learn why you deploy and how auto-sync works.

An import creates the resources the file defines and updates the ones that already exist. It does not remove a resource that the file leaves out. Delete that resource in the Console.

Template Variables​

A value written as {{.NAME}} is a template variable. The import replaces it with the value of NAME from the environment file, so the same file works in every environment that supplies its own values:

resource_type: application
name: Console
type: browser
authFlowId: {{.AUTH_FLOW_ID}}
AUTH_FLOW_ID=edc013d0-e893-4dc0-990c-3e1d203e005b

An export names its variables after the resource type, the resource name and the field. See Template Variable Names.

Cross-Resource References by Handle​

Instead of embedding environment-specific resource identifiers in YAML files, you can reference organization units and flows by their human-readable handles. The importer resolves each handle to its resource identifier at import time, making the same YAML portable across environments.

The following handle fields are supported:

Resource typeHandle fieldResolves to
ApplicationouHandleouId
ApplicationauthFlowHandleauthFlowId
ApplicationregistrationFlowHandleregistrationFlowId
ApplicationrecoveryFlowHandlerecoveryFlowId
AgentauthFlowHandleauthFlowId
AgentregistrationFlowHandleregistrationFlowId
User typeouHandleouId
FlowouHandleouId
ConnectionouHandleouId
Notification templateouHandleouId

If you provide both a handle field and the corresponding ID field, the ID takes precedence and the handle is ignored.

A flow document must carry ouId or ouHandle, because every flow belongs to exactly one organization unit. A document with neither fails to import, and a dry run reports the same failure. The same rule applies to flow files loaded at startup: the server fails to load a file with no owner. For the details, see Organization Unit Ownership.

Updating an existing application or agent with a document that sets only a handle field re-resolves it and keeps the resolved ID.

If a handle cannot be resolved (because the target resource does not exist or the required adapter is not configured), the import item fails with a descriptive error message. When continueOnError is true, the importer continues processing the remaining documents.

Example: Application with Handle References​

resource_type: application
name: My App
type: fullstack
ouHandle: default
authFlowHandle: default-basic-flow
registrationFlowHandle: default-registration-flow
isRegistrationFlowEnabled: true

Connections and Organization Units​

A connection document for an identity provider, an SMS or email provider, an AuthZEN PDP connection, or an HTTP endpoint connection must carry ouId or ouHandle, because every connection belongs to exactly one organization unit. A document with neither fails to import, and a dry run reports the same failure. The same rule applies to connection files loaded at startup: the server fails to load a file with no owner. The error code of a missing owner depends on the kind of connection:

Connection kindError code
Identity providerIDP-1016
SMS or email providerMNS-1020
AuthZEN PDPCON-1025
HTTP endpointCON-1030

When a connection document has both ouId and ouHandle, ouId wins. Choreo Identity & Access Management logs a warning and does not check that the two name the same organization unit. An export writes ouId for each connection, not ouHandle.

resource_type: connection
id: 0193b0a1-1003-7000-8000-000000000001
name: Corp OIDC
ouHandle: default
type: oidc
clientId: "{{.CORP_OIDC_CLIENT_ID}}"
clientSecret: "{{.CORP_OIDC_CLIENT_SECRET}}"
redirectUri: "{{.CORP_OIDC_REDIRECT_URI}}"
authorizationEndpoint: https://idp.example.com/oauth2/authorize
tokenEndpoint: https://idp.example.com/oauth2/token

Sharing Policies on Connections​

A connection document of any kind can carry a sharingPolicies list that shares the connection with other organization units. Each entry has the same fields as a sharing policy on any other resource. A shared connection stays in its owner's organization unit, and the organization units it reaches can use it but cannot override any of its settings.

resource_type: connection
id: 0193b0a1-1003-7000-8000-000000000002
name: Corp SMTP
ouHandle: default
type: email-smtp
host: smtp.example.com
port: 587
fromAddress: [email protected]
sharingPolicies:
- childUnits:
mode: all

The importer handles the policies of a document as follows:

  • It writes the connection first and then records the policies against the organization unit that owns the connection, whether the document names that unit with ouId or ouHandle. A policy the connection already has from that organization unit is updated, and a policy that the document does not name is kept.
  • If Choreo Identity & Access Management refuses a policy, the item fails. When the import created the connection, it removes the connection so that a retry is not blocked by a connection that is left behind. An update that fails on a policy keeps the changes it made to the connection.
  • A dry run validates the connection and records no policy.
  • An export writes the sharing policies of each connection into its document, so importing the export recreates the same sharing.
  • Connection files loaded at startup declare their policies the same way.

Sharing Policies on Flows​

A flow document can carry a sharingPolicies list that shares the flow with other organization units. Each entry has the same fields as a sharing policy on any other resource. A flow document must name its owner with ouId or ouHandle. A shared flow stays in its owner's organization unit. The organization units it reaches cannot change its definition, but they can set the values of the variables the owner opens to them.

The overlay rules of a flow policy govern variables. The key of a rule is variables. followed by the identifier of a variable that the flow declares on a VARIABLES node. Each rule takes the fields editable, value, allowedValues, and excludedValues, as described in Overlay Rules. A variable holds one value, so value lists at most one entry.

resource_type: flow
id: 0193b0a1-1001-7000-8000-000000000042
handle: acme-login
name: Acme Login Flow
flowType: AUTHENTICATION
ouHandle: default
nodes:
- id: start
type: START
onSuccess: resolve_ou
- id: resolve_ou
type: TASK_EXECUTION
executor:
name: OUResolverExecutor
properties:
resolveFrom: prompt
parentOuId: 0193b0a1-2001-7000-8000-000000000001
onSuccess: resolve_variables
- id: resolve_variables
type: VARIABLES
inputs:
- identifier: supportEmail
type: EMAIL_INPUT
label: Support email
defaultValue: [email protected]
- identifier: mfaMode
type: SELECT
label: Second factor
options:
- NONE
- SMS_OTP
- EMAIL_OTP
defaultValue: NONE
onSuccess: end
- id: end
type: END
sharingPolicies:
- childUnits:
mode: all
overlayRules:
variables.supportEmail:
editable: true
variables.mfaMode:
editable: true
allowedValues:
- NONE
- SMS_OTP
variableValues:
- ouId: 0193b0a1-2001-7000-8000-000000000007
values:
supportEmail: help@acme-emea.example
mfaMode: SMS_OTP

A document can also carry variableValues, the values that the organization units the flow is shared with saved for its variables. Each entry names a unit with ouId and gives the values by variable identifier. An export writes them, so a flow keeps its overrides when you import it into another deployment, such as a data plane that a control plane applies versions to.

The importer handles the policies and values of a document as follows:

  • When the import creates the flow, it writes the flow first and then records the policies against the organization unit that owns the flow, whether the document names that unit with ouId or ouHandle. If Choreo Identity & Access Management refuses a policy, the item fails and the import removes the flow, so that a retry is not blocked by a flow that is left behind.
  • When the import updates a flow, it writes the new definition and the policies in one transaction. If Choreo Identity & Access Management refuses the document, the flow keeps its previous definition and policies. A policy the flow already has from that organization unit is updated, and a policy that the document does not name is kept.
  • It checks the terms of each policy against the variables the new definition declares. A rule must name a declared variable, and every value in it must be valid for the type and constraints of that variable. A value that names a connection must name an existing connection of a kind the variable takes.
  • On an update that carries sharingPolicies, it does not check the new definition against the policies and saved values the flow held before. It checks the policies that remain after the replace, so a document whose definition and policies agree is accepted. For example, you can remove a variable, or an option of a variable, and the matching terms of its policy in the same document.
  • After the policies, it sets the values of each unit in variableValues, checked as they would be if the unit set them itself. A unit may set only what its rules let it, and a connection must be one the unit can see. A unit the document does not name keeps its own values. If Choreo Identity & Access Management refuses a value, the item fails. When the import created the flow, it removes the flow. When the import updated the flow, the new definition and policies stay.
  • A dry run validates the flow and records no policy or value.
  • An export writes the sharing policies and the saved values of each flow into its document, so importing the export recreates the same sharing and the same overrides.
  • Flow files loaded at startup declare their policies the same way. Choreo Identity & Access Management loads them when it loads flows from files, which is when the flow store is in the declarative or composite mode. A file loaded at startup does not apply variableValues, so import the document to set the values.

Mandated Roles on User Shares​

A user document can carry a sharingPolicies list whose entries mandate roles with a roles overlay rule. See Mandate Roles on a Shared User. An import replays those shares after the roles, so one document can carry a user, the role, and the share that mandates it. A role export leaves mandated assignments out, because the share recreates them on import.

When and how the shares are replayed depends on whether the user already exists:

  • For a new user, the import replays every share with the user, leaving the roles rules out, and replays the shares that carry roles in full after the roles. The user therefore reaches its organization units before a role later in the document is assigned to it there.
  • For an existing user, once any of its shares carries roles, the import replays all of its shares after the roles. A role document in the same import that assigns the user directly in an organization unit the import newly shares the user into then fails, because the user does not reach that unit yet. Import the user first, then the roles.

Because roles are imported before the shares, one import cannot both drop a role from a share's mandate and stop sharing that role with the organization unit. The role document is refused with ROL-1037 while the mandate still stands. Import the user's share first, then the role.

Dry-Run Behavior​

The Test step runs the import as a dry run. The importer validates the documents and reports what it would create or update, but writes no changes. Handle resolution is mostly skipped in a dry run: the importer accepts handle fields, such as the flow handles of an application, without looking up their target resources. The exception is ouHandle, which is resolved for every resource type that has one, so a handle that does not match an organization unit fails the test as it would a real import.

Notification Templates​

A notification_template document defines a channel-specific message template. Templates are keyed by (channel, handle): the handle is unique within a channel and is immutable after creation. With upsert enabled, an existing template with the same handle is updated; otherwise a duplicate handle fails with a conflict.

FieldRequiredDescription
channelYesThe delivery channel. One of email or sms.
handleYesStable identifier, unique within the channel. Lowercase alphanumeric with dashes or underscores (kebab or snake case). Immutable after creation.
displayNameYesHuman-readable name.
descriptionNoOptional description.
content.subjectEmail onlySubject line. Required for email, not allowed for sms.
content.bodyYesMessage body.
design.colorSchemeEmail onlyOptional color scheme, light or dark. Not allowed for sms.

Channel rules are enforced on both apply and dry-run:

  • email requires content.subject, and may set design.
  • sms must not set content.subject or design.

Example: Email Template​

resource_type: notification_template
channel: email
handle: user-invite
ouHandle: default
displayName: User Invitation Email
description: Sent when a user is invited.
content:
subject: You are invited
body: "<p>{{ctx(inviteLink)}}</p>"
design:
colorScheme: light

Example: SMS Template​

resource_type: notification_template
channel: sms
handle: otp-verification
ouHandle: default
displayName: OTP Verification SMS
content:
body: "Your verification code is {{ctx(otpCode)}}"

Default Templates​

Choreo Identity & Access Management ships a default bundle of notification templates. Importing your own document with the same (channel, handle) and upsert enabled replaces the default.

HandleChannelsPurpose
user-inviteemail, smsInvite a new user to complete their registration.
self-registrationemail, smsComplete a self-service registration.
magic-linkemailSign in through a secure link.
password-recoveryemailReset an account password.
ciba-notificationemail, smsApprove a backchannel (CIBA) authentication request.
otpemail, smsVerify an email address or phone number with a one-time passcode.

Resource Servers​

A resource_server document declares a resource server with its resources and actions. List the actions of the resource server itself under the top-level actions field, and the actions of a resource under that resource's actions field. A resource's permission joins the handles from the top-level resource down to that resource with the resource server's delimiter. A resource action's permission appends the action handle to the resource's permission. A resource server action's permission is the action handle alone, such as audit.

Delimiter and Handles​

  • delimiter is optional and defaults to resource.default_delimiter. It must be one of ., _, :, -, or /.
  • A handle can contain letters, digits, ., _, :, -, and /, up to 100 characters, but not the resource server's delimiter.

Parent References​

A handle must be unique under its parent. Set parent to the full path of the parent resource, such as parent: app:team:member.

Example​

resource_type: resource_server
id: 01900000-0000-7000-8000-0000000009ff
name: Team Workspace
identifier: "urn:example:workspace"
ouHandle: default
delimiter: ":"
actions:
- { name: Audit, handle: audit }
resources:
- { name: App, handle: app }
- { name: Project, handle: project, parent: app }
- name: Project Member
handle: member
parent: "app:project"
actions:
- { name: Read, handle: read }
- { name: Team, handle: team, parent: app }
- name: Team Member
handle: member
parent: "app:team"
actions:
- { name: Read, handle: read }
- { name: Lead, handle: lead, parent: "app:team:member" }

Error Handling​

Typical failures include:

  • An incomplete or malformed request (IMP-1001).
  • YAML content that cannot be parsed (IMP-1002).
  • Template variables that cannot be resolved (IMP-1003).
  • No resource adapter configured for a resource type (IMP-1004).

Was this page helpful?