diff --git a/.github/labeler.yaml b/.github/labeler.yaml index bc0d2cf..fffa788 100644 --- a/.github/labeler.yaml +++ b/.github/labeler.yaml @@ -11,5 +11,8 @@ ":floppy_disk: group-rule": - modules/group-rule/**/* +":floppy_disk: organization": +- modules/organization/**/* + ":floppy_disk: user": - modules/user/**/* diff --git a/.github/labels.yaml b/.github/labels.yaml index 9d11c77..a3d4de0 100644 --- a/.github/labels.yaml +++ b/.github/labels.yaml @@ -52,6 +52,9 @@ - color: "fbca04" description: "This issue or pull request is related to group-rule module." name: ":floppy_disk: group-rule" +- color: "fbca04" + description: "This issue or pull request is related to organization module." + name: ":floppy_disk: organization" - color: "fbca04" description: "This issue or pull request is related to user module." name: ":floppy_disk: user" diff --git a/README.md b/README.md index 8ab6262..fdd5a15 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Terraform module to manage all of things on Okta organization. - [brand](./modules/brand/) - [group](./modules/group/) - [group-rule](./modules/group-rule/) +- [organization](./modules/organization/) - [user](./modules/user/) diff --git a/VERSION b/VERSION index 6e8bf73..0ea3a94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.2.0 diff --git a/modules/organization/README.md b/modules/organization/README.md new file mode 100644 index 0000000..4f1022d --- /dev/null +++ b/modules/organization/README.md @@ -0,0 +1,42 @@ +# organization + +This module creates following resources. + +- `okta_security_notification_emails` + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.6 | +| [okta](#requirement\_okta) | >= 4.8 | + +## Providers + +| Name | Version | +|------|---------| +| [okta](#provider\_okta) | 4.8.1 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [okta_security_notification_emails.this](https://registry.terraform.io/providers/okta/okta/latest/docs/resources/security_notification_emails) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [security\_notification\_email\_preferences](#input\_security\_notification\_email\_preferences) | (Optional) A preferences for security notification emails. `security_notification_email_preferences` block as defined below.
(Optional) `report_on_suspicious_activity` - Whether to notify end users about suspicious
or unrecognized activity from their account. Defaults to `true`.
(Optional) `notify_on_factor_enrollment` - Whether to notify end users of any activity on their account related to MFA factor enrollment. Defaults to `true`.
(Optional) `notify_on_factor_reset` - Whether to notify end users that one or more factors have been reset for their account. Defaults to `true`.
(Optional) `notify_on_new_device` - Whether to notify end users about new sign-on activity. Defaults to `false`.
(Optional) `notify_on_password_changed` - Whether to notify end users that the password for their account has changed. Defaults to `true`. |
object({
report_on_suspicious_activity = optional(bool, true)
notify_on_factor_enrollment = optional(bool, true)
notify_on_factor_reset = optional(bool, true)
notify_on_new_device = optional(bool, false)
notify_on_password_changed = optional(bool, true)
})
| `{}` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [security\_notification\_email\_preferences](#output\_security\_notification\_email\_preferences) | The preferences for security notification emails. | + diff --git a/modules/organization/main.tf b/modules/organization/main.tf new file mode 100644 index 0000000..3d60d00 --- /dev/null +++ b/modules/organization/main.tf @@ -0,0 +1,29 @@ +# locals { +# metadata = { +# package = "terraform-okta-modules" +# version = trimspace(file("${path.module}/../../VERSION")) +# module = basename(path.module) +# name = var.name +# } +# module_tags = { +# "module.terraform.io/package" = local.metadata.package +# "module.terraform.io/version" = local.metadata.version +# "module.terraform.io/name" = local.metadata.module +# "module.terraform.io/full-name" = "${local.metadata.package}/${local.metadata.module}" +# "module.terraform.io/instance" = local.metadata.name +# } +# } + + +################################################### +# Security Notification Preferences for Organization +################################################### + +resource "okta_security_notification_emails" "this" { + report_suspicious_activity_enabled = var.security_notification_email_preferences.report_on_suspicious_activity + + send_email_for_factor_enrollment_enabled = var.security_notification_email_preferences.notify_on_factor_enrollment + send_email_for_factor_reset_enabled = var.security_notification_email_preferences.notify_on_factor_reset + send_email_for_new_device_enabled = var.security_notification_email_preferences.notify_on_new_device + send_email_for_password_changed_enabled = var.security_notification_email_preferences.notify_on_password_changed +} diff --git a/modules/organization/outputs.tf b/modules/organization/outputs.tf new file mode 100644 index 0000000..a18e806 --- /dev/null +++ b/modules/organization/outputs.tf @@ -0,0 +1,10 @@ +output "security_notification_email_preferences" { + description = "The preferences for security notification emails." + value = { + report_on_suspicious_activity = okta_security_notification_emails.this.report_suspicious_activity_enabled + notify_on_factor_enrollment = okta_security_notification_emails.this.send_email_for_factor_enrollment_enabled + notify_on_factor_reset = okta_security_notification_emails.this.send_email_for_factor_reset_enabled + notify_on_new_device = okta_security_notification_emails.this.send_email_for_new_device_enabled + notify_on_password_changed = okta_security_notification_emails.this.send_email_for_password_changed_enabled + } +} diff --git a/modules/organization/variables.tf b/modules/organization/variables.tf new file mode 100644 index 0000000..cff0f97 --- /dev/null +++ b/modules/organization/variables.tf @@ -0,0 +1,26 @@ +# variable "name" { +# description = "(Required) A name of the organization." +# type = string +# nullable = false +# } + +variable "security_notification_email_preferences" { + description = <