Skip to content

Commit 39bc6f1

Browse files
committed
feat: add subscription resources
1 parent 3e47611 commit 39bc6f1

25 files changed

Lines changed: 1258 additions & 267 deletions

File tree

Lines changed: 9 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+
Get 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+
Get 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+
id = "OKTA_ANNOUNCEMENT"
16+
role_ref = "SUPER_ADMIN"
1717
}
1818
```
1919

@@ -22,12 +22,11 @@ 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 (e.g., `OKTA_ANNOUNCEMENT`).
26+
- `role_ref` (String) A reference to an existing role (e.g., `SUPER_ADMIN`).
2727

2828
### Read-Only
2929

30-
- `id` (String) The ID of this resource.
31-
- `status` (String) Status of subscription
32-
33-
30+
- `channels` (List of String) Sources that send notifications to users (e.g., `["email"]`).
31+
- `notification_type` (String) The type of notification.
32+
- `status` (String) Status of the subscription.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
page_title: "Data Source: okta_user_subscription"
3+
description: |-
4+
Get a subscription by notification type for a specified user.
5+
---
6+
7+
# Data Source: okta_user_subscription
8+
9+
Get a subscription by notification type for a specified user.
10+
11+
## Example Usage
12+
13+
```terraform
14+
data "okta_user_subscription" "example" {
15+
id = "OKTA_ANNOUNCEMENT"
16+
user_id = "replace_with_user_id"
17+
}
18+
```
19+
20+
<!-- schema generated by tfplugindocs -->
21+
## Schema
22+
23+
### Required
24+
25+
- `id` (String) The notification type to look up (e.g., `OKTA_ANNOUNCEMENT`).
26+
- `user_id` (String) ID of an existing Okta user.
27+
28+
### Read-Only
29+
30+
- `channels` (List of String) Sources that send notifications to users (e.g., `["email"]`).
31+
- `notification_type` (String) The type of notification.
32+
- `status` (String) Status of the subscription.
Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
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.
6-
Check configure email notifications https://help.okta.com/oie/en-us/Content/Topics/Security/custom-admin-role/administrator-email-settings.htm
7-
page regarding what notifications are available for specific admin roles.
4+
Manages email subscription settings for an Okta administrator role notification type.
85
---
96

107
# Resource: okta_role_subscription
118

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)
16-
page regarding what notifications are available for specific admin roles.
9+
Manages email subscription settings for an Okta administrator role notification type.
10+
11+
This resource allows you to subscribe or unsubscribe an admin role from a specific notification type.
12+
See [configure email notifications](https://help.okta.com/oie/en-us/Content/Topics/Security/custom-admin-role/administrator-email-settings.htm)
13+
for available notifications per admin role.
1714

1815
## Example Usage
1916

2017
```terraform
21-
resource "okta_role_subscription" "test" {
22-
role_type = "SUPER_ADMIN"
23-
notification_type = "APP_IMPORT"
24-
status = "unsubscribed"
18+
resource "okta_role_subscription" "example" {
19+
role_ref = "SUPER_ADMIN"
20+
notification_type = "OKTA_ANNOUNCEMENT"
2521
}
2622
```
2723

@@ -30,45 +26,31 @@ resource "okta_role_subscription" "test" {
3026

3127
### Required
3228

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).
59-
60-
### Optional
61-
62-
- `status` (String) Subscription status. Valid values: `subscribed`, `unsubscribed`.
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+
- `role_ref` (String) A reference to an existing role. Valid values: `API_ADMIN`, `APP_ADMIN`, `CUSTOM`, `GROUP_MEMBERSHIP_ADMIN`, `HELP_DESK_ADMIN`, `MOBILE_ADMIN`, `ORG_ADMIN`, `READ_ONLY_ADMIN`, `REPORT_ADMIN`, `SUPER_ADMIN`, `USER_ADMIN`. See [API docs](https://developer.okta.com/docs/reference/api/admin-notifications/#role-types).
6343

6444
### Read-Only
6545

66-
- `id` (String) The ID of this resource.
46+
- `channels` (List of String) Sources that send notifications to users (e.g., `["email"]`).
47+
- `id` (String) The ID of this resource, in the format `{role_ref}/{notification_type}`.
48+
- `status` (String) Status of the subscription. Value is `subscribed` or `unsubscribed`.
6749

6850
## Import
6951

7052
Import is supported using the following syntax:
7153

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

examples/resources/okta_policy_password/basic.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ data "okta_group" "all" {
33
}
44

55
resource "okta_policy_password" "test" {
6-
name = "testAcc_replace_with_uuid"
7-
status = "ACTIVE"
8-
description = "Terraform Acceptance Test Password Policy"
9-
password_history_count = 5
10-
groups_included = [data.okta_group.all.id]
11-
breached_password_expire_after_days = 0
12-
breached_password_logout_enabled = false
6+
name = "testAcc_replace_with_uuid"
7+
status = "ACTIVE"
8+
description = "Terraform Acceptance Test Password Policy"
9+
password_history_count = 5
10+
groups_included = [data.okta_group.all.id]
11+
breached_password_expire_after_days = 0
12+
breached_password_logout_enabled = false
1313
breached_password_delegated_workflow_id = ""
1414
}

examples/resources/okta_policy_password/basic_updated.tf

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@ data "okta_group" "all" {
33
}
44

55
resource "okta_policy_password" "test" {
6-
name = "testAcc_replace_with_uuid"
7-
status = "INACTIVE"
8-
description = "Terraform Acceptance Test Password Policy Updated"
9-
password_min_length = 12
10-
password_min_lowercase = 0
11-
password_min_uppercase = 0
12-
password_min_number = 0
13-
password_min_symbol = 1
14-
password_exclude_username = false
15-
password_exclude_first_name = true
16-
password_exclude_last_name = true
17-
password_max_age_days = 60
18-
password_expire_warn_days = 15
19-
password_min_age_minutes = 60
20-
password_history_count = 0
21-
password_max_lockout_attempts = 10
22-
password_auto_unlock_minutes = 2
23-
password_show_lockout_failures = true
24-
password_lockout_notification_channels = ["EMAIL"]
25-
question_min_length = 10
26-
recovery_email_token = 20160
27-
sms_recovery = "ACTIVE"
28-
breached_password_expire_after_days = 6
29-
breached_password_logout_enabled = true
6+
name = "testAcc_replace_with_uuid"
7+
status = "INACTIVE"
8+
description = "Terraform Acceptance Test Password Policy Updated"
9+
password_min_length = 12
10+
password_min_lowercase = 0
11+
password_min_uppercase = 0
12+
password_min_number = 0
13+
password_min_symbol = 1
14+
password_exclude_username = false
15+
password_exclude_first_name = true
16+
password_exclude_last_name = true
17+
password_max_age_days = 60
18+
password_expire_warn_days = 15
19+
password_min_age_minutes = 60
20+
password_history_count = 0
21+
password_max_lockout_attempts = 10
22+
password_auto_unlock_minutes = 2
23+
password_show_lockout_failures = true
24+
password_lockout_notification_channels = ["EMAIL"]
25+
question_min_length = 10
26+
recovery_email_token = 20160
27+
sms_recovery = "ACTIVE"
28+
breached_password_expire_after_days = 6
29+
breached_password_logout_enabled = true
3030
breached_password_delegated_workflow_id = "1074260"
31-
groups_included = [data.okta_group.all.id]
31+
groups_included = [data.okta_group.all.id]
3232
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
resource "okta_role_subscription" "test" {
2-
notification_type = "APP_IMPORT"
3-
role_type = "SUPER_ADMIN"
4-
status = "unsubscribed"
2+
role_ref = "SUPER_ADMIN"
3+
notification_type = "OKTA_ANNOUNCEMENT"
54
}

0 commit comments

Comments
 (0)