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
25 changes: 25 additions & 0 deletions modules/random/Random-Password/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

output "random_password" {
depends_on = [random_password.random_password]
value = random_password.random_password.result
sensitive = true
}
30 changes: 30 additions & 0 deletions modules/random/Random-Password/random_password.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

resource "random_password" "random_password" {
length = var.length
special = var.include_special_characters
override_special = var.override_special_characters
min_numeric = var.min_numeric
min_upper = var.min_upper
min_lower = var.min_lower
min_special = var.min_special
keepers = var.keepers
}
67 changes: 67 additions & 0 deletions modules/random/Random-Password/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

variable "length" {
description = "The length of the generated password"
type = number
default = 20
}

variable "include_special_characters" {
description = "Whether to include special characters in the generated password"
type = bool
default = true
}

variable "override_special_characters" {
description = "Override the default special characters with a custom set"
type = string
default = "_+.~^#*?"
}

variable "min_numeric" {
description = "The minimum number of numeric characters in the generated password"
type = number
default = 1
}

variable "min_upper" {
description = "The minimum number of uppercase characters in the generated password"
type = number
default = 1
}

variable "min_lower" {
description = "The minimum number of lowercase characters in the generated password"
type = number
default = 1
}

variable "min_special" {
description = "The minimum number of special characters in the generated password"
type = number
default = 1
}

variable "keepers" {
description = "Arbitrary map of values that, when changed, will trigger recreation of resource"
type = map(string)
default = {}
}
29 changes: 29 additions & 0 deletions modules/random/Random-Password/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# --------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.13"
required_providers {
random = {
source = "hashicorp/random"
version = ">= 2.2.0"
}
}
}