generated from terraform-modules/template_aws_submodules
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # Versions | ||
|
|
||
| * v1.0.0 -- {{ yyyy-mm-dd }} | ||
| * 1.0.0 -- 2023-09-08 | ||
| - initial creation | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| locals { | ||
| _module_version = "0.0.0" | ||
| _module_version = "1.0.0" | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,5 +5,5 @@ terraform { | |
| version = ">= 3.66.0" | ||
| } | ||
| } | ||
| # required_version = ">= 0.13" | ||
| # required_version = ">= 0.13" | ||
| } | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/availabilty_zones.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/data.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/defaults.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| locals { | ||
| account_id = var.account_id != "" ? var.account_id : data.aws_caller_identity.current.account_id | ||
| account_environment = data.aws_arn.current.partition == "aws-us-gov" ? "gov" : "ew" | ||
| region = data.aws_region.current.name | ||
| region_short = join("", [for c in split("-", local.region) : substr(c, 0, 1)]) | ||
|
|
||
| base_tags = { | ||
| "boc:tf_module_version" = local._module_version | ||
| "boc:tf_module_name" = local._module_name | ||
| "boc:created_by" = "terraform" | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| locals { | ||
| description = coalesce(var.description, var.name) | ||
| } | ||
|
|
||
| resource "aws_ssoadmin_permission_set" "pset" { | ||
| name = var.name | ||
| description = local.description | ||
| instance_arn = var.instance_arn | ||
| session_duration = var.session_duration | ||
|
|
||
| tags = merge( | ||
| local.base_tags, | ||
| var.tags, | ||
| ) | ||
| } | ||
|
|
||
| data "aws_iam_policy" "pset" { | ||
| for_each = toset(var.managed_policy_names) | ||
| name = each.key | ||
| } | ||
|
|
||
| resource "aws_ssoadmin_managed_policy_attachment" "pset" { | ||
| for_each = data.aws_iam_policy.pset | ||
| instance_arn = var.instance_arn | ||
| permission_set_arn = aws_ssoadmin_permission_set.pset.arn | ||
| managed_policy_arn = each.value.arn | ||
| } | ||
|
|
||
| resource "aws_ssoadmin_customer_managed_policy_attachment" "pset" { | ||
| for_each = var.customer_managed_policy_names | ||
| instance_arn = var.instance_arn | ||
| permission_set_arn = aws_ssoadmin_permission_set.pset.arn | ||
|
|
||
| customer_managed_policy_reference { | ||
| name = each.key | ||
| path = one(each.value, "/") | ||
| } | ||
| } | ||
|
|
||
| resource "aws_ssoadmin_permission_set_inline_policy" "pset" { | ||
| instance_arn = var.instance_arn | ||
| permission_set_arn = aws_ssoadmin_permission_set.pset.arn | ||
| inline_policy = var.inline_policy | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| locals { | ||
| _module_name = "aws-sso/permissionset" | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/prefixes.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/variables.common.availability_zones.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/variables.common.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| variable "name" { | ||
| description = "Permission set name" | ||
| type = string | ||
| } | ||
|
|
||
| variable "description" { | ||
| description = "Permission set description" | ||
| type = string | ||
| default = null | ||
| } | ||
|
|
||
| variable "instance_arn" { | ||
| description = "AWS SSO/IDC Instance ARN" | ||
| type = string | ||
| } | ||
|
|
||
| variable "session_duration" { | ||
| description = "Permission set duration (default 8H)" | ||
| type = string | ||
| default = "PT8H" | ||
| } | ||
|
|
||
| variable "managed_policy_names" { | ||
| description = "Names of AWS Managed Policy to attach to the permissionset" | ||
| type = list(string) | ||
| default = [] | ||
| } | ||
|
|
||
| variable "customer_managed_policy_names" { | ||
| description = "Map of policy name to permission boundary of Customer Managed Policy to attach to the permissionset" | ||
| type = map(string) | ||
| default = {} | ||
| } | ||
|
|
||
| variable "inline_policy" { | ||
| description = "AWS Policy document for the single allowed inline policy" | ||
| type = string | ||
| default = null | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/version.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../common/versions.tf |