Skip to content

Commit 09a1c42

Browse files
committed
feat: add role and user subscription resources
1 parent b3b5261 commit 09a1c42

26 files changed

Lines changed: 2251 additions & 222 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 6.15.0 (Unreleased)
4+
5+
### BREAKING CHANGES
6+
7+
* **`okta_role_subscription`**: Migrated from SDKv2 to Terraform Plugin Framework + Okta SDK v6. The `role_type` attribute has been renamed to `role_ref`. The `status` attribute has been removed; use `notification_type` and manage subscription state directly.
8+
* **`okta_role_subscription` (data source)**: `role_type` renamed to `role_ref`. `notification_type` moved from required input to computed output; pass the notification type as `id` instead. New computed attribute `channels` added.
9+
10+
### FEATURES
11+
12+
* Added new resource `okta_user_subscription` for managing notification subscriptions for individual users [#2891](https://github.com/okta/terraform-provider-okta/pull/2891) by [@pranav-okta](https://github.com/pranav-okta)
13+
* Added new data source `okta_user_subscription` to read a user's notification subscription [#2891](https://github.com/okta/terraform-provider-okta/pull/2891) by [@pranav-okta](https://github.com/pranav-okta)
14+
* Added new data source `okta_role_subscription` to read a role's notification subscription [#2891](https://github.com/okta/terraform-provider-okta/pull/2891) by [@pranav-okta](https://github.com/pranav-okta)
15+
16+
### ENHANCEMENTS
17+
18+
* Migrated `okta_role_subscription` to Terraform Plugin Framework + Okta SDK v6 [#2891](https://github.com/okta/terraform-provider-okta/pull/2891) by [@pranav-okta](https://github.com/pranav-okta)
19+
320
## 6.14.0 (Jul 30, 2026)
421

522
### FEATURES
Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
page_title: "Data Source: okta_role_subscription"
33
description: |-
4-
Get subscriptions of a Role with a specific type
4+
Retrieves a subscription by notification type for a specified role.
55
---
66

77
# Data Source: okta_role_subscription
88

9-
Get subscriptions of a Role with a specific type
9+
Retrieves a subscription by notification type for a specified role.
1010

1111
## Example Usage
1212

1313
```terraform
1414
data "okta_role_subscription" "example" {
15-
notification_type = "APP_IMPORT"
16-
role_type = "SUPER_ADMIN"
15+
role_ref = "SUPER_ADMIN"
16+
id = "APP_IMPORT"
1717
}
1818
```
1919

@@ -22,12 +22,35 @@ data "okta_role_subscription" "example" {
2222

2323
### Required
2424

25-
- `notification_type` (String) Type of the notification
26-
- `role_type` (String) Type of the role
25+
- `id` (String) The notification type to look up. Valid values:
26+
- `CONNECTOR_AGENT` - Disconnects and reconnects: On-prem provisioning, on-prem MFA agents, and RADIUS server agent.
27+
- `USER_LOCKED_OUT` - User lockouts.
28+
- `APP_IMPORT` - App user import status.
29+
- `LDAP_AGENT` - Disconnects and reconnects: LDAP agent.
30+
- `AD_AGENT` - Disconnects and reconnects: AD agent.
31+
- `OKTA_ANNOUNCEMENT` - Okta release notes and announcements.
32+
- `OKTA_UPDATE` - Scheduled system updates.
33+
- `IWA_AGENT` - Disconnects and reconnects: IWA agent.
34+
- `USER_DEPROVISION` - User deprovisions.
35+
- `REPORT_SUSPICIOUS_ACTIVITY` - User reporting of suspicious activity.
36+
- `RATELIMIT_NOTIFICATION` - Rate limit warning and violation.
37+
- `AGENT_AUTO_UPDATE_NOTIFICATION` - Agent auto-update notifications: AD Agent.
38+
- `role_ref` (String) A reference to an existing role. Valid values:
39+
`API_ADMIN`,
40+
`APP_ADMIN`,
41+
`CUSTOM`,
42+
`GROUP_MEMBERSHIP_ADMIN`,
43+
`HELP_DESK_ADMIN`,
44+
`MOBILE_ADMIN`,
45+
`ORG_ADMIN`,
46+
`READ_ONLY_ADMIN`,
47+
`REPORT_ADMIN`,
48+
`SUPER_ADMIN`,
49+
`USER_ADMIN`.
50+
See [API docs](https://developer.okta.com/docs/reference/api/admin-notifications/#role-types).
2751

2852
### Read-Only
2953

30-
- `id` (String) The ID of this resource.
31-
- `status` (String) Status of subscription
32-
33-
54+
- `channels` (List of String) An array of sources used to send notifications to users.
55+
- `notification_type` (String) The type of notification.
56+
- `status` (String) The status of the subscription.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
page_title: "Data Source: okta_user_subscription"
3+
description: |-
4+
Retrieves a subscription by notification type for a specified user.
5+
---
6+
7+
# Data Source: okta_user_subscription
8+
9+
Retrieves a subscription by notification type for a specified user.
10+
11+
## Example Usage
12+
13+
```terraform
14+
data "okta_user_subscription" "example" {
15+
user_id = "usr00000000000001"
16+
id = "APP_IMPORT"
17+
}
18+
```
19+
20+
<!-- schema generated by tfplugindocs -->
21+
## Schema
22+
23+
### Required
24+
25+
- `id` (String) The notification type to look up. Valid values:
26+
- `CONNECTOR_AGENT` - Disconnects and reconnects: On-prem provisioning, on-prem MFA agents, and RADIUS server agent.
27+
- `USER_LOCKED_OUT` - User lockouts.
28+
- `APP_IMPORT` - App user import status.
29+
- `LDAP_AGENT` - Disconnects and reconnects: LDAP agent.
30+
- `AD_AGENT` - Disconnects and reconnects: AD agent.
31+
- `OKTA_ANNOUNCEMENT` - Okta release notes and announcements.
32+
- `OKTA_UPDATE` - Scheduled system updates.
33+
- `IWA_AGENT` - Disconnects and reconnects: IWA agent.
34+
- `USER_DEPROVISION` - User deprovisions.
35+
- `REPORT_SUSPICIOUS_ACTIVITY` - User reporting of suspicious activity.
36+
- `RATELIMIT_NOTIFICATION` - Rate limit warning and violation.
37+
- `AGENT_AUTO_UPDATE_NOTIFICATION` - Agent auto-update notifications: AD Agent.
38+
- `user_id` (String) ID of an existing Okta user.
39+
40+
### Read-Only
41+
42+
- `channels` (List of String) An array of sources used to send notifications to the user.
43+
- `notification_type` (String) The type of notification.
44+
- `status` (String) The status of the subscription.
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
---
22
page_title: "Resource: okta_role_subscription"
33
description: |-
4-
Manages group subscription.
5-
This resource allows you to configure subscriptions of a Role with a specific type.
4+
Manages role subscription.
5+
This resource allows you to configure subscriptions of a Role with a specific notification type.
66
Check configure email notifications https://help.okta.com/oie/en-us/Content/Topics/Security/custom-admin-role/administrator-email-settings.htm
77
page regarding what notifications are available for specific admin roles.
88
---
99

1010
# Resource: okta_role_subscription
1111

12-
Manages group subscription.
13-
14-
This resource allows you to configure subscriptions of a Role with a specific type.
15-
Check [configure email notifications](https://help.okta.com/oie/en-us/Content/Topics/Security/custom-admin-role/administrator-email-settings.htm)
12+
Manages role subscription.
13+
14+
This resource allows you to configure subscriptions of a Role with a specific notification type.
15+
Check [configure email notifications](https://help.okta.com/oie/en-us/Content/Topics/Security/custom-admin-role/administrator-email-settings.htm)
1616
page regarding what notifications are available for specific admin roles.
1717

1818
## Example Usage
1919

2020
```terraform
2121
resource "okta_role_subscription" "test" {
22-
role_type = "SUPER_ADMIN"
22+
role_ref = "SUPER_ADMIN"
2323
notification_type = "APP_IMPORT"
24-
status = "unsubscribed"
2524
}
2625
```
2726

@@ -30,45 +29,46 @@ resource "okta_role_subscription" "test" {
3029

3130
### Required
3231

33-
- `notification_type` (String) Type of the notification. Valid values:
34-
- 'CONNECTOR_AGENT' - Disconnects and reconnects: On-prem provisioning, on-prem MFA agents, and RADIUS server agent.
35-
- 'USER_LOCKED_OUT' - User lockouts.
36-
- 'APP_IMPORT' - App user import status.
37-
- 'LDAP_AGENT' - Disconnects and reconnects: LDAP agent.
38-
- 'AD_AGENT' - Disconnects and reconnects: AD agent.
39-
- 'OKTA_ANNOUNCEMENT' - Okta release notes and announcements.
40-
- 'OKTA_UPDATE' - Scheduled system updates.
41-
- 'IWA_AGENT' - Disconnects and reconnects: IWA agent.
42-
- 'USER_DEPROVISION' - User deprovisions.
43-
- 'REPORT_SUSPICIOUS_ACTIVITY' - User reporting of suspicious activity.
44-
- 'RATELIMIT_NOTIFICATION' - Rate limit warning and violation.
45-
- 'AGENT_AUTO_UPDATE_NOTIFICATION' - Agent auto-update notifications: AD Agent.
46-
- `role_type` (String) Type of the role. Valid values:
47-
'API_ADMIN',
48-
'APP_ADMIN',
49-
'CUSTOM',
50-
'GROUP_MEMBERSHIP_ADMIN',
51-
'HELP_DESK_ADMIN',
52-
'MOBILE_ADMIN',
53-
'ORG_ADMIN',
54-
'READ_ONLY_ADMIN',
55-
'REPORT_ADMIN',
56-
'SUPER_ADMIN',
57-
'USER_ADMIN'
58-
. See [API docs](https://developer.okta.com/docs/reference/api/admin-notifications/#role-types).
32+
- `role_ref` (String) A reference to an existing role. Valid values:
33+
`API_ADMIN`,
34+
`APP_ADMIN`,
35+
`CUSTOM`,
36+
`GROUP_MEMBERSHIP_ADMIN`,
37+
`HELP_DESK_ADMIN`,
38+
`MOBILE_ADMIN`,
39+
`ORG_ADMIN`,
40+
`READ_ONLY_ADMIN`,
41+
`REPORT_ADMIN`,
42+
`SUPER_ADMIN`,
43+
`USER_ADMIN`.
44+
See [API docs](https://developer.okta.com/docs/reference/api/admin-notifications/#role-types).
45+
- `notification_type` (String) Type of the notification. Valid values:
46+
- `CONNECTOR_AGENT` - Disconnects and reconnects: On-prem provisioning, on-prem MFA agents, and RADIUS server agent.
47+
- `USER_LOCKED_OUT` - User lockouts.
48+
- `APP_IMPORT` - App user import status.
49+
- `LDAP_AGENT` - Disconnects and reconnects: LDAP agent.
50+
- `AD_AGENT` - Disconnects and reconnects: AD agent.
51+
- `OKTA_ANNOUNCEMENT` - Okta release notes and announcements.
52+
- `OKTA_UPDATE` - Scheduled system updates.
53+
- `IWA_AGENT` - Disconnects and reconnects: IWA agent.
54+
- `USER_DEPROVISION` - User deprovisions.
55+
- `REPORT_SUSPICIOUS_ACTIVITY` - User reporting of suspicious activity.
56+
- `RATELIMIT_NOTIFICATION` - Rate limit warning and violation.
57+
- `AGENT_AUTO_UPDATE_NOTIFICATION` - Agent auto-update notifications: AD Agent.
5958

6059
### Optional
6160

62-
- `status` (String) Subscription status. Valid values: `subscribed`, `unsubscribed`.
61+
- `channels` (List of String) An array of sources to send notifications to users.
6362

6463
### Read-Only
6564

66-
- `id` (String) The ID of this resource.
65+
- `id` (String) The ID of this resource. Format: `<role_ref>/<notification_type>`.
66+
- `status` (String) The status of the subscription.
6767

6868
## Import
6969

7070
Import is supported using the following syntax:
7171

7272
```shell
73-
terraform import okta_role_subscription.example <role_type>/<notification_type>
73+
terraform import okta_role_subscription.example <role_ref>/<notification_type>
7474
```
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
page_title: "Resource: okta_user_subscription"
3+
description: |-
4+
Manages a user's notification subscription.
5+
This resource allows you to configure email notification subscriptions for a specific Okta user.
6+
---
7+
8+
# Resource: okta_user_subscription
9+
10+
Manages a user's notification subscription.
11+
12+
This resource allows you to configure email notification subscriptions for a specific Okta user.
13+
14+
## Example Usage
15+
16+
```terraform
17+
resource "okta_user_subscription" "test" {
18+
user_id = "usr00000000000001"
19+
notification_type = "APP_IMPORT"
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `user_id` (String) ID of an existing Okta user.
29+
- `notification_type` (String) Type of the notification. Valid values:
30+
- `CONNECTOR_AGENT` - Disconnects and reconnects: On-prem provisioning, on-prem MFA agents, and RADIUS server agent.
31+
- `USER_LOCKED_OUT` - User lockouts.
32+
- `APP_IMPORT` - App user import status.
33+
- `LDAP_AGENT` - Disconnects and reconnects: LDAP agent.
34+
- `AD_AGENT` - Disconnects and reconnects: AD agent.
35+
- `OKTA_ANNOUNCEMENT` - Okta release notes and announcements.
36+
- `OKTA_UPDATE` - Scheduled system updates.
37+
- `IWA_AGENT` - Disconnects and reconnects: IWA agent.
38+
- `USER_DEPROVISION` - User deprovisions.
39+
- `REPORT_SUSPICIOUS_ACTIVITY` - User reporting of suspicious activity.
40+
- `RATELIMIT_NOTIFICATION` - Rate limit warning and violation.
41+
- `AGENT_AUTO_UPDATE_NOTIFICATION` - Agent auto-update notifications: AD Agent.
42+
43+
### Optional
44+
45+
- `channels` (List of String) An array of sources to send notifications to the user.
46+
- `status` (String) The status of the subscription.
47+
48+
### Read-Only
49+
50+
- `id` (String) The ID of this resource. Format: `<user_id>/<notification_type>`.
51+
52+
## Import
53+
54+
Import is supported using the following syntax:
55+
56+
```shell
57+
terraform import okta_user_subscription.example <user_id>/<notification_type>
58+
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "okta_role_subscription" "test" {
2+
role_ref = "SUPER_ADMIN"
3+
id = "APP_IMPORT"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "okta_user_subscription" "test" {
2+
user_id = "usr00000000000001"
3+
id = "APP_IMPORT"
4+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
resource "okta_role_subscription" "test" {
2+
role_ref = "SUPER_ADMIN"
23
notification_type = "APP_IMPORT"
3-
role_type = "SUPER_ADMIN"
4-
status = "unsubscribed"
54
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resource "okta_user_subscription" "test" {
2+
user_id = "usr00000000000001"
3+
notification_type = "APP_IMPORT"
4+
}

0 commit comments

Comments
 (0)