Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit 1c751d2

Browse files
committed
update example
1 parent 2ed2607 commit 1c751d2

27 files changed

Lines changed: 79182 additions & 1107 deletions

example/README.md

Lines changed: 65 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,72 @@ The flow example has been exported **with subflows** and **with variable values*
88

99
The first step in this example is to use the `dvtf-pingctl generate ...` command to parse the export, generate the required HCL and split the flows into their component files.
1010

11+
The example flow used is sourced from the [CIAM Passwordless Flow Pack](https://library.pingidentity.com/page/ciam-passwordless-flow-pack) on the [Ping Library](https://library.pingidentity.com)
12+
1113
```shell
12-
cat ./../assets/flows/multiple-flows.json | dvtf-pingctl generate --output-path `pwd`/output
14+
cat ./../assets/flows/ciam-passwordless-flow-pack.json | dvtf-pingctl generate --output-path `pwd`/output
1315
```
1416

15-
The result of the generate routine can be found in the [output](./output) directory, the components are:
17+
The command generates a Terraform module. The generated module can be found in the [output](./output) directory that was set in the `dvtf-pingctl generate ...` command. The components are:
1618

1719
```
1820
├── assets
1921
│ ├── flows
20-
│ │ ├── abcd123_subflow_1.json
21-
│ │ ├── abcd123_subflow_1.json
22-
│ │ ├── full_basic.json
22+
│ │ ├── ciam_passwordless_protect_account_recovery_subflow.json
23+
│ │ ├── ciam_passwordless_protect_account_registration_subflow.json
24+
│ │ ├── ciam_passwordless_protect_agreement_tos_subflow.json
25+
│ │ ├── ciam_passwordless_protect_change_password_subflow.json
26+
│ │ ├── ciam_passwordless_protect_device_authentication_subflow.json
27+
│ │ ├── ciam_passwordless_protect_device_registration_subflow.json
28+
│ │ ├── ciam_passwordless_protect_magic_link_authentication_subflow.json
29+
│ │ ├── ciam_passwordless_protect_registration_authentication_account_recovery_main_flow.json
30+
│ │ ├── ciam_passwordless_protect_threat_detection_subflow.json
31+
│ │ ├── ciam_passwordless_protect_verify_email_subflow.json
32+
│ │ ├── ootb_basic_profile_management.json
33+
│ │ ├── ootb_change_password_subflow_1.json
34+
│ │ ├── ootb_device_management_main_flow.json
35+
│ │ ├── ootb_device_registration_subflow_1.json
36+
│ │ ├── ootb_password_reset_main_flow.json
37+
├── davinci_connection_property_vars.tf
2338
├── davinci_connectors.tf
39+
├── davinci_flow_vars.tf
2440
├── davinci_flows.tf
41+
└── davinci_variable_vars.tf
2542
└── davinci_variables.tf
43+
└── vars.tf
44+
└── versions.tf
2645
```
2746

2847
The `assets/flows/` directory contains the flows that have been found in the export file. Each one of these flows can be validated using the `dvtf-pingctl validate ...` command.
2948

30-
The generated files `davinci_connectors.tf`, `davinci_variables.tf` contain variables and connectors that are shared between all the nodes in the export. Variables that are `flow` variables (and must be attached to a specific flow) have been defined with a reference to their `davinci_flow` resource.
49+
The generated Terraform files `davinci_connectors.tf`, `davinci_variables.tf` contain variables and connectors that are shared between all the nodes in the export. Variables that are `flow` variables (and must be attached to a specific flow) have been defined with a reference to their `davinci_flow` resource.
3150

3251
The generated file `davinci_flows.tf` contains the flow definitions for each of the flows embedded in the JSON. The output includes variable `depends_on` definitions, and contains the relevant `connection_link` and `subflow_link` blocks required for safe import.
3352

53+
Connector property values and variable values have been exposed as Terraform variables, and can be overriden as needed.
54+
55+
To use the generated code, construct a module call in your HCL as follows:
56+
57+
```hcl
58+
module "davinci_flows" {
59+
source = "./output"
60+
61+
// Required variable
62+
pingone_environment_id = pingone_environment.my_environment.id
63+
64+
// Overridden variable values
65+
davinci_variable_agreementid_value = ... // Define overriding variable values in the module call
66+
davinci_variable_ciam_magiclinkenabled_value = ... // Define overriding variable values in the module call
67+
# ... other variable values
68+
69+
// Overridden connector values
70+
davinci_connection_pingonessoconnector__94141bf2f1b9b59a5f5365ff135e02bb_clientId = ... // Define overriding connector property values in the module call
71+
davinci_connection_pingonessoconnector__94141bf2f1b9b59a5f5365ff135e02bb_clientSecret = ... // Define overriding connector property values in the module call
72+
davinci_connection_pingonessoconnector__94141bf2f1b9b59a5f5365ff135e02bb_envId = ... // Define overriding connector property values in the module call
73+
davinci_connection_pingonessoconnector__94141bf2f1b9b59a5f5365ff135e02bb_region = ... // Define overriding connector property values in the module call
74+
# ... other connector property values
75+
}
76+
3477
## Validate
3578
3679
Once files have been generated, the flows themselves can be validated using the `dvtf-pingctl validate ...` command.
@@ -39,56 +82,24 @@ Once files have been generated, the flows themselves can be validated using the
3982
cat ./output/assets/flows/full_basic.json | dvtf-pingctl validate
4083
cat ./output/assets/flows/abcd123_subflow_1.json | dvtf-pingctl validate
4184
cat ./output/assets/flows/abcd123_subflow_2.json | dvtf-pingctl validate
85+
86+
cat ./output/assets/flows/ciam_passwordless_protect_account_recovery_subflow.json | dvtf-pingctl validate
87+
cat ./output/assets/flows/ciam_passwordless_protect_account_registration_subflow.json | dvtf-pingctl validate
88+
cat ./output/assets/flows/ciam_passwordless_protect_agreement_tos_subflow.json | dvtf-pingctl validate
89+
cat ./output/assets/flows/ciam_passwordless_protect_change_password_subflow.json | dvtf-pingctl validate
90+
cat ./output/assets/flows/ciam_passwordless_protect_device_authentication_subflow.json | dvtf-pingctl validate
91+
cat ./output/assets/flows/ciam_passwordless_protect_device_registration_subflow.json | dvtf-pingctl validate
92+
cat ./output/assets/flows/ciam_passwordless_protect_magic_link_authentication_subflow.json | dvtf-pingctl validate
93+
cat ./output/assets/flows/ciam_passwordless_protect_registration_authentication_account_recovery_main_flow.json | dvtf-pingctl validate
94+
cat ./output/assets/flows/ciam_passwordless_protect_threat_detection_subflow.json | dvtf-pingctl validate
95+
cat ./output/assets/flows/ciam_passwordless_protect_verify_email_subflow.json | dvtf-pingctl validate
96+
cat ./output/assets/flows/ootb_basic_profile_management.json | dvtf-pingctl validate
97+
cat ./output/assets/flows/ootb_change_password_subflow_1.json | dvtf-pingctl validate
98+
cat ./output/assets/flows/ootb_device_management_main_flow.json | dvtf-pingctl validate
99+
cat ./output/assets/flows/ootb_device_registration_subflow_1.json | dvtf-pingctl validate
100+
cat ./output/assets/flows/ootb_password_reset_main_flow.json | dvtf-pingctl validate
42101
```
43102

44103
The output can be used to determine whether the flows will successfully import using the DaVinci Terraform provider, or whether they need re-exporting.
45104

46105
The output can be provided to the DaVinci Terraform provider maintainers to improve the provider.
47-
48-
## Add Boilerplate HCL
49-
50-
The generated HCL makes minimal assumptions about the use of the generated files. All generated resources require a reference to the PingOne Environment ID as shown:
51-
52-
```hcl
53-
resource "davinci_variable" "test123__full_basic" {
54-
environment_id = local.pingone_environment_id
55-
56-
# ... other configuration parameters
57-
}
58-
```
59-
60-
This dependency can be fulfilled by setting a `local` variable:
61-
62-
Example which uses a `pingone_environment` resource:
63-
64-
```hcl
65-
resource "pingone_environment" "my_environment" {
66-
name = "DVTF-PINGCTL Environment"
67-
type = "SANDBOX"
68-
license_id = var.license_id
69-
70-
services = [
71-
{
72-
type = "SSO"
73-
},
74-
{
75-
type = "DaVinci",
76-
tags = ["DAVINCI_MINIMAL"]
77-
}
78-
]
79-
}
80-
81-
locals {
82-
pingone_environment_id = pingone_environment.my_environment.id
83-
}
84-
```
85-
86-
Example which uses a variable:
87-
88-
```hcl
89-
locals {
90-
pingone_environment_id = var.pingone_environment_id
91-
}
92-
```
93-
94-
To be able to run the generated HCL, provider version information also needs to be specified. Examples can be found on the [Terraform Registry Documentation](https://registry.terraform.io/providers/pingidentity/davinci/latest/docs#example-usage)

example/output/assets/flows/abcd123_subflow_1.json

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)