Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions docs/resources/password_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
page_title: "spectrocloud_password_policy Resource - terraform-provider-spectrocloud"
subcategory: ""
description: |-

---

# spectrocloud_password_policy (Resource)



You can learn more about managing password policy in Palette by reviewing the [Password Policy](https://docs.spectrocloud.com/enterprise-version/system-management/account-management/credentials/#password-requirements-and-security) guide.

~> The password_policy resource enforces a password compliance policy. By default, a password policy is configured in Palette with default values. Users can update the password compliance settings as per their requirements. When a spectrocloud_password_policy resource is destroyed, the password policy will revert to the Palette default settings.

## Example Usage

An example of managing an password policy in Palette.

```hcl
resource "spectrocloud_password_policy" "policy_regex" {
# password_regex = "*"
password_expiry_days = 123
first_reminder_days = 5
min_digits = 1
min_lowercase_letters = 12
min_password_length = 12
min_special_characters = 1
min_uppercase_letters = 1
}

## import existing password policy
#import {
# to = spectrocloud_password_policy.password_policy
# id = "{tenantUID}" // tenant-uid.
#}

```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `first_reminder_days` (Number) The number of days before the password expiry to send the first reminder to the user. Default is `5` days before expiry.
- `min_digits` (Number) The minimum number of numeric digits (0-9) required in the password. Ensures that passwords contain numerical characters. Minimum length of digit should be `1`.
- `min_lowercase_letters` (Number) The minimum number of lowercase letters (a-z) required in the password. Ensures that lowercase characters are included for password complexity. Minimum length of lower case should be `1`.
- `min_password_length` (Number) The minimum length required for the password. Enforces a stronger password policy by ensuring a minimum number of characters. Default minimum length is `6`.
- `min_special_characters` (Number) The minimum number of special characters (e.g., !, @, #, $, %) required in the password. This increases the password's security level by including symbols. Minimum special characters should be `1`.
- `min_uppercase_letters` (Number) The minimum number of uppercase letters (A-Z) required in the password. Helps ensure password complexity with a mix of case-sensitive characters. Minimum length of upper case should be `1`.
- `password_expiry_days` (Number) The number of days before the password expires. Must be between 1 and 1000 days. Defines how often passwords must be changed. Default is `999` days for expiry.
- `password_regex` (String) A regular expression (regex) to define custom password patterns, such as enforcing specific characters or sequences in the password.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `delete` (String)
- `update` (String)
14 changes: 14 additions & 0 deletions examples/resources/spectrocloud_password_policy/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
terraform {
required_providers {
spectrocloud = {
version = ">= 0.1"
source = "spectrocloud/spectrocloud"
}
}
}

provider "spectrocloud" {
host = var.sc_host
api_key = var.sc_api_key
project_name = var.sc_project_name
}
16 changes: 16 additions & 0 deletions examples/resources/spectrocloud_password_policy/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "spectrocloud_password_policy" "policy_regex" {
# password_regex = "*"
password_expiry_days = 999
first_reminder_days = 5
min_password_length = 6
min_digits = 1
min_lowercase_letters = 1
min_special_characters = 1
min_uppercase_letters = 1
}

## import existing password policy
#import {
# to = spectrocloud_password_policy.password_policy
# id = "password-policy" // tenant-uid
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Spectro Cloud credentials
sc_host = "{Enter Spectro Cloud API Host}" #e.g: api.spectrocloud.com (for SaaS)
sc_api_key = "{Enter Spectro Cloud API Key}"
sc_project_name = "{Enter Spectro Cloud Project Name}" #e.g: Default
18 changes: 18 additions & 0 deletions examples/resources/spectrocloud_password_policy/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
variable "sc_host" {
description = "Spectro Cloud Endpoint"
default = "api.spectrocloud.com"
}

variable "sc_api_key" {
description = "Spectro Cloud API key"
}

variable "sc_project_name" {
description = "Spectro Cloud Project (e.g: Default)"
default = "Default"
}

variable "ssh_key_value" {
description = "ssh key value"
default = "ssh-rsa ...... == [email protected]"
}
25 changes: 13 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ require (
github.com/robfig/cron v1.2.0
github.com/spectrocloud/gomi v1.14.1-0.20240214074114-c19394812368
github.com/spectrocloud/hapi v1.14.1-0.20240214071352-81f589b1d86d
github.com/spectrocloud/palette-sdk-go v0.0.0-20241119151816-43a4f46d482e
github.com/stretchr/testify v1.9.0
github.com/spectrocloud/palette-sdk-go v0.0.0-20241219153631-ca32d3fd7126
github.com/stretchr/testify v1.10.0
gotest.tools v2.2.0+incompatible
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
Expand Down Expand Up @@ -72,7 +72,7 @@ require (
github.com/imdario/mergo v0.3.15 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
Expand Down Expand Up @@ -100,17 +100,18 @@ require (
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
go.mongodb.org/mongo-driver v1.16.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/grpc v1.57.1 // indirect
Expand Down
Loading
Loading