Skip to content

Commit

Permalink
add settings
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Feb 8, 2024
1 parent 41e30b0 commit df81dff
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions common/variables.settings.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variable "settings_file" {
description = "File name and path to YAML with users(list), account_ids(list), org_ous(list), and all(bool). See sample.yml in code."
type = string
default = null
}
1 change: 1 addition & 0 deletions group-assignment/sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ permissionset_name: string
all: true
account_names: []
account_ids: []
auto_policy_count: null
org_ous: []
user_mapping: {}
users: []
1 change: 1 addition & 0 deletions group-assignment/variables.settings.tf
6 changes: 0 additions & 6 deletions group-assignment/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ variable "organizational_unit_hierarchy" {
default = {}
}

variable "settings_file" {
description = "File name and path to YAML with users(list), account_ids(list), org_ous(list), and all(bool). See sample.yml in code."
type = string
default = null
}

## "Enterprise-GOV:Workloads:SystemAcceptance" = {
## "fullname" = "Enterprise-GOV:Workloads:SystemAcceptance"
## "levels" = tolist([
Expand Down
1 change: 1 addition & 0 deletions permissionset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ No modules.
| <a name="input_override_prefixes"></a> [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no |
| <a name="input_relay_state"></a> [relay\_state](#input\_relay\_state) | Relay State to pass along to permissionset | `string` | `null` | no |
| <a name="input_session_duration"></a> [session\_duration](#input\_session\_duration) | Permission set duration (default 8H) | `string` | `"PT8H"` | no |
| <a name="input_settings_file"></a> [settings\_file](#input\_settings\_file) | File name and path to YAML with users(list), account\_ids(list), org\_ous(list), and all(bool). See sample.yml in code. | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | AWS Tags to apply to appropriate resources | `map(string)` | `{}` | no |

## Outputs
Expand Down
6 changes: 6 additions & 0 deletions permissionset/settings.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
locals {
settings = var.settings_file != null && fileexists(var.settings_file) ? yamldecode(file(var.settings_file)) : null
name = coalesce(var.name, try(local.settings.group, null))
description = coalesce(var.description, try(local.settings.description, null), local.name)
auto_policy_acount = try(local.settings.auto_policy_count, var.auto_policy_count)
}
1 change: 1 addition & 0 deletions permissionset/variables.settings.tf

0 comments on commit df81dff

Please sign in to comment.