Skip to content

Commit 46d0dcc

Browse files
authored
[feat][gov] Update repo to reflect v.2.9.0 of the API (#52)
* update repo to reflect v.2.9.0 of the api * fixes to cursor slop * notes in readme * all tests passing, working on a local server with real examples * docs * lint fixes * add comment on folder deletion recursion * notes on reviewing * better handling for config variables as secret * update docs * lint * lint
1 parent c210052 commit 46d0dcc

File tree

668 files changed

+103546
-20106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

668 files changed

+103546
-20106
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,13 @@ New version should show up on Terraform Repository in 10-15 minutes.
6666
# Update Retool CLI
6767
Retool CLI has a `terraform` command that generates Terraform configuration from existing Retool org: https://github.com/tryretool/retool-cli/blob/master/src/commands/terraform.ts.
6868
If you added a new resource or updated an existing one, you should update Retool CLI as well, so that your changes are reflected in auto-generated configuration.
69+
70+
# Reviewing
71+
72+
Reviewing PRs to this repo can be a challenge, particularly when they impact the OpenAPI generated code for the SDK.
73+
74+
As a general rule, code within `internal/provider/sdk` will be generated, and can largely be ignored during reviews.
75+
76+
Code _outside_ of this should be given close attention. `internal/provider` code is what drives the terraform behavior, and should be reviewed for correctness and backward compatibility. Tests should accompany new features, and reviewers should make a habit of checking out PR branches and running them against realisitic example retool deployments.
77+
78+
Updates should always include documentation updates for new/changed behaviors.

docs/data-sources/folders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ output "all_folders" {
3030

3131
Read-Only:
3232

33-
- `folder_type` (String) The type of the folder: (app|file|resource|workflow).
33+
- `folder_type` (String) The type of the folder: (app|file|resource|workflow|agent).
3434
- `id` (String) The id of the folder.
3535
- `is_system_folder` (Boolean) Whether the folder is a system folder.
3636
- `legacy_id` (String) The legacy id of the folder.

docs/data-sources/groups.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ output "all_groups" {
3030

3131
Read-Only:
3232

33+
- `account_details_access` (Boolean) Whether the group has access to account details.
3334
- `audit_log_access` (Boolean) Whether the group has audit log access.
3435
- `created_at` (String) The date the group was created.
3536
- `id` (String) The id of the group.
3637
- `landing_page_app_id` (String) The id of the landing page app for the group.
3738
- `legacy_id` (String) The legacy id of the group.
3839
- `members` (Attributes List) The members of the group. (see [below for nested schema](#nestedatt--groups--members))
3940
- `name` (String) The name of the group.
41+
- `theme_access` (Boolean) Whether the group has access to edit themes.
4042
- `universal_app_access` (String) The universal app access level of the group.
4143
- `universal_query_library_access` (String) The universal query library access level of the group.
4244
- `universal_resource_access` (String) The universal resource access level of the group.

docs/resources/configuration_variable.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,46 @@ Manages a Retool configuration variable. Configuration variables are used to sto
1212

1313
```terraform
1414
resource "retool_configuration_variable" "test_config_var" {
15-
name = "Test Space"
16-
value = [
15+
name = "Test Config Var"
16+
values = [
1717
{
18-
environment_id = "production"
18+
environment_id = "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" # prod
1919
value = "value1"
2020
},
2121
{
22-
environment_id = "staging"
22+
environment_id = "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e" # staging
2323
value = "value2"
2424
}
2525
]
2626
}
2727
28-
resource "retool_configuration_variable" "test_config_var_with_descritpion" {
29-
name = "Test Space with creation options"
28+
resource "retool_configuration_variable" "test_config_var_with_description" {
29+
name = "Test Config Var with description"
3030
description = "This is a test configuration variable with a description"
31-
value = [
31+
values = [
3232
{
33-
environment_id = "production"
33+
environment_id = "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" # prod
3434
value = "value1"
3535
},
3636
{
37-
environment_id = "staging"
37+
environment_id = "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e" # staging
3838
value = "value2"
3939
}
4040
]
4141
}
4242
4343
resource "retool_configuration_variable" "test_config_var_as_secret" {
44-
name = "Test Space with creation options"
45-
description = "This is a test configuration variable with a description"
44+
name = "Test Secret Config Var"
45+
description = "This is a secret configuration variable"
4646
secret = true
47-
value = [
47+
values = [
4848
{
49-
environment_id = "production"
50-
value = "value1"
49+
environment_id = "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" # prod
50+
value = "secret_value1"
5151
},
5252
{
53-
environment_id = "staging"
54-
value = "value2"
53+
environment_id = "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e" # staging
54+
value = "secret_value2"
5555
}
5656
]
5757
}
@@ -68,18 +68,18 @@ resource "retool_configuration_variable" "test_config_var_as_secret" {
6868
### Optional
6969

7070
- `description` (String) A brief description of the configuration variable's purpose.
71+
- `secret` (Boolean) Whether the configuration variable is a secret. Secrets are encrypted and not exposed in the Retool UI.
7172

7273
### Read-Only
7374

7475
- `id` (String) The unique identifier for the configuration variable.
75-
- `secret` (Boolean) Whether the configuration variable is a secret. Secrets are encrypted and not exposed in the Retool UI. Secert is currently not supported as the values are encrypted and cannot be retrieved via the API.
7676

7777
<a id="nestedatt--values"></a>
7878
### Nested Schema for `values`
7979

8080
Required:
8181

8282
- `environment_id` (String) The ID of the environment this value is associated with.
83-
- `value` (String) The value of the configuration variable for the specified environment.
83+
- `value` (String, Sensitive) The value of the configuration variable for the specified environment.
8484

8585

docs/resources/folder.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,24 @@ resource "retool_folder" "resource_example" {
2626
name = "Terraform Example Folder"
2727
folder_type = "resource"
2828
}
29+
30+
resource "retool_folder" "workflow_example" {
31+
name = "Terraform Workflow Folder"
32+
folder_type = "workflow"
33+
}
34+
35+
resource "retool_folder" "agent_example" {
36+
name = "Terraform Agent Folder"
37+
folder_type = "agent"
38+
}
2939
```
3040

3141
<!-- schema generated by tfplugindocs -->
3242
## Schema
3343

3444
### Required
3545

36-
- `folder_type` (String) The type of the folder: (app|resource|workflow).
46+
- `folder_type` (String) The type of the folder: (app|resource|workflow|agent).
3747
- `name` (String) The name of the folder.
3848

3949
### Optional

docs/resources/group.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ resource "retool_group" "example" {
2222
audit_log_access = true
2323
unpublished_release_access = false
2424
usage_analytics_access = true
25+
theme_access = false
2526
account_details_access = true
2627
landing_page_app_id = "c37676ba-116f-11ea-b17d-d7734e1526f2"
2728
}
@@ -39,6 +40,7 @@ resource "retool_group" "example" {
3940
- `account_details_access` (Boolean) Whether the group has access to account details.
4041
- `audit_log_access` (Boolean) Whether the group has access to the audit log.
4142
- `landing_page_app_id` (String) The app ID of the landing page.
43+
- `theme_access` (Boolean) Whether the group has access to edit themes.
4244
- `universal_app_access` (String) The universal app access level for the group. This denotes the access level that this group has for all apps. Accepted values: none|use|edit|own
4345
- `universal_query_library_access` (String) Level of access that the group has to the Query Library. Accepted values: none|use|edit
4446
- `universal_resource_access` (String) The universal resource access level for the group. This denotes the access level that this group has for all resources. Accepted values: none|use|edit|own

docs/resources/source_control_settings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ resource "retool_source_control_settings" "scm_settings" {
1616
custom_pull_request_template_enabled = true
1717
custom_pull_request_template = "custom-pull-request-template"
1818
version_control_locked = true
19+
auto_cleanup_branches_enabled = false
1920
force_uuid_mapping = false
2021
}
2122
```
@@ -26,6 +27,7 @@ resource "retool_source_control_settings" "scm_settings" {
2627
### Optional
2728

2829
- `auto_branch_naming_enabled` (Boolean) When enabled, Retool automatically suggests a branch name on branch creation. Defaults to true.
30+
- `auto_cleanup_branches_enabled` (Boolean) When enabled, Retool automatically cleans up branches after they are merged. Defaults to false.
2931
- `custom_pull_request_template` (String) Pull requests created from Retool will use the template specified.
3032
- `custom_pull_request_template_enabled` (Boolean) When enabled, Retool will use the template specified to create pull requests. Defaults to false.
3133
- `force_uuid_mapping` (Boolean) When set to true, creates a uuid mapping for protected elements to be used in the source control repo. Defaults to false.
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
resource "retool_configuration_variable" "test_config_var" {
2-
name = "Test Space"
3-
value = [
2+
name = "Test Config Var"
3+
values = [
44
{
5-
environment_id = "production"
5+
environment_id = "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" # prod
66
value = "value1"
77
},
88
{
9-
environment_id = "staging"
9+
environment_id = "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e" # staging
1010
value = "value2"
1111
}
1212
]
1313
}
1414

15-
resource "retool_configuration_variable" "test_config_var_with_descritpion" {
16-
name = "Test Space with creation options"
15+
resource "retool_configuration_variable" "test_config_var_with_description" {
16+
name = "Test Config Var with description"
1717
description = "This is a test configuration variable with a description"
18-
value = [
18+
values = [
1919
{
20-
environment_id = "production"
20+
environment_id = "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" # prod
2121
value = "value1"
2222
},
2323
{
24-
environment_id = "staging"
24+
environment_id = "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e" # staging
2525
value = "value2"
2626
}
2727
]
2828
}
2929

3030
resource "retool_configuration_variable" "test_config_var_as_secret" {
31-
name = "Test Space with creation options"
32-
description = "This is a test configuration variable with a description"
31+
name = "Test Secret Config Var"
32+
description = "This is a secret configuration variable"
3333
secret = true
34-
value = [
34+
values = [
3535
{
36-
environment_id = "production"
37-
value = "value1"
36+
environment_id = "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" # prod
37+
value = "secret_value1"
3838
},
3939
{
40-
environment_id = "staging"
41-
value = "value2"
40+
environment_id = "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e" # staging
41+
value = "secret_value2"
4242
}
4343
]
4444
}

examples/resources/retool_folder/resource.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,13 @@ resource "retool_folder" "resource_example" {
1313
name = "Terraform Example Folder"
1414
folder_type = "resource"
1515
}
16+
17+
resource "retool_folder" "workflow_example" {
18+
name = "Terraform Workflow Folder"
19+
folder_type = "workflow"
20+
}
21+
22+
resource "retool_folder" "agent_example" {
23+
name = "Terraform Agent Folder"
24+
folder_type = "agent"
25+
}

examples/resources/retool_group/resource.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ resource "retool_group" "example" {
77
audit_log_access = true
88
unpublished_release_access = false
99
usage_analytics_access = true
10+
theme_access = false
1011
account_details_access = true
1112
landing_page_app_id = "c37676ba-116f-11ea-b17d-d7734e1526f2"
1213
}

0 commit comments

Comments
 (0)