From 2ab1834147c0282d6aa0733e8c639cc1facd5a1e Mon Sep 17 00:00:00 2001 From: Zachary Hill Date: Sat, 30 Dec 2023 09:43:16 -0500 Subject: [PATCH] initial commit and configuration --- .../identity_center/permission_set/README.md | 151 ++++++++++++++++++ .../identity_center/permission_set/main.tf | 20 +++ .../identity_center/permission_set/outputs.tf | 14 ++ .../permission_set/variables.tf | 28 ++++ 4 files changed, 213 insertions(+) create mode 100755 modules/aws/identity_center/permission_set/README.md create mode 100644 modules/aws/identity_center/permission_set/main.tf create mode 100644 modules/aws/identity_center/permission_set/outputs.tf create mode 100644 modules/aws/identity_center/permission_set/variables.tf diff --git a/modules/aws/identity_center/permission_set/README.md b/modules/aws/identity_center/permission_set/README.md new file mode 100755 index 00000000..5942d8f4 --- /dev/null +++ b/modules/aws/identity_center/permission_set/README.md @@ -0,0 +1,151 @@ + + + + + + + +[![Contributors][contributors-shield]][contributors-url] +[![Forks][forks-shield]][forks-url] +[![Stargazers][stars-shield]][stars-url] +[![Issues][issues-shield]][issues-url] +[![MIT License][license-shield]][license-url] +[![LinkedIn][linkedin-shield]][linkedin-url] + + + +
+
+ + Logo + + +

module_name

+

+ module_description +
+ Explore the docs » +
+
+ Zachary Hill + · + Report Bug + · + Request Feature +

+
+ + + +
+ Table of Contents +
    +
  1. Usage
  2. +
  3. Requirements
  4. +
  5. Providers
  6. +
  7. Modules
  8. +
  9. Resources
  10. +
  11. Inputs
  12. +
  13. Outputs
  14. +
  15. License
  16. +
  17. Contact
  18. +
  19. Acknowledgments
  20. +
+
+ + + +## Usage +### Simple Example +``` +module test { + source = + + variable = +} +``` + +_For more examples, please refer to the [Documentation](https://github.com/zachreborn/terraform-modules)_ + +

(back to top)

+ + + + +## Requirements + +No requirements. + +## Providers + +No providers. + +## Modules + +No modules. + +## Resources + +No resources. + +## Inputs + +No inputs. + +## Outputs + +No outputs. + + + +## License + +Distributed under the MIT License. See `LICENSE.txt` for more information. + +

(back to top)

+ + + + +## Contact + +Zachary Hill - [![LinkedIn][linkedin-shield]][linkedin-url] - zhill@zacharyhill.co + +Project Link: [https://github.com/zachreborn/terraform-modules](https://github.com/zachreborn/terraform-modules) + +

(back to top)

+ + + + +## Acknowledgments + +* [Zachary Hill](https://zacharyhill.co) +* [Jake Jones](https://github.com/jakeasarus) + +

(back to top)

+ + + + +[contributors-shield]: https://img.shields.io/github/contributors/zachreborn/terraform-modules.svg?style=for-the-badge +[contributors-url]: https://github.com/zachreborn/terraform-modules/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/zachreborn/terraform-modules.svg?style=for-the-badge +[forks-url]: https://github.com/zachreborn/terraform-modules/network/members +[stars-shield]: https://img.shields.io/github/stars/zachreborn/terraform-modules.svg?style=for-the-badge +[stars-url]: https://github.com/zachreborn/terraform-modules/stargazers +[issues-shield]: https://img.shields.io/github/issues/zachreborn/terraform-modules.svg?style=for-the-badge +[issues-url]: https://github.com/zachreborn/terraform-modules/issues +[license-shield]: https://img.shields.io/github/license/zachreborn/terraform-modules.svg?style=for-the-badge +[license-url]: https://github.com/zachreborn/terraform-modules/blob/master/LICENSE.txt +[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 +[linkedin-url]: https://www.linkedin.com/in/zachary-hill-5524257a/ +[product-screenshot]: /images/screenshot.webp +[Terraform.io]: https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform +[Terraform-url]: https://terraform.io \ No newline at end of file diff --git a/modules/aws/identity_center/permission_set/main.tf b/modules/aws/identity_center/permission_set/main.tf new file mode 100644 index 00000000..da6618db --- /dev/null +++ b/modules/aws/identity_center/permission_set/main.tf @@ -0,0 +1,20 @@ +terraform { + required_version = ">= 1.0.0" + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.0.0" + } + } +} + +data "aws_ssoadmin_instances" "this" {} + +resource "aws_ssoadmin_permission_set" "this" { + name = var.name + description = var.description + instance_arn = tolist(data.aws_ssoadmin_instances.this.arns)[0] + relay_state = var.relay_state + session_duration = var.session_duration + tags = merge(var.tags, { "Name" = var.name }) +} diff --git a/modules/aws/identity_center/permission_set/outputs.tf b/modules/aws/identity_center/permission_set/outputs.tf new file mode 100644 index 00000000..81be115c --- /dev/null +++ b/modules/aws/identity_center/permission_set/outputs.tf @@ -0,0 +1,14 @@ +output "arn" { + description = "The ARN of the permission set" + value = aws_ssoadmin_permission_set.this.arn +} + +output "created_date" { + description = "The date the permission set was created" + value = aws_ssoadmin_permission_set.this.created_date +} + +output "id" { + description = "The ID of the permission set" + value = aws_ssoadmin_permission_set.this.id +} diff --git a/modules/aws/identity_center/permission_set/variables.tf b/modules/aws/identity_center/permission_set/variables.tf new file mode 100644 index 00000000..17966e28 --- /dev/null +++ b/modules/aws/identity_center/permission_set/variables.tf @@ -0,0 +1,28 @@ +variable "description" { + description = "(Optional) The description of the permission set." + type = string + default = null +} + +variable "name" { + description = "(Required) The name of the permission set." + type = string +} + +variable "relay_state" { + description = "(Optional) The relay state URL used to redirect users within the application during the federation authentication process." + type = string + default = null +} + +variable "session_duration" { + description = "(Optional) The length of time that the application user sessions are valid in the ISO-8601 standard." + type = string + default = "PT1H" +} + +variable "tags" { + description = "(Optional) Key-value map of resource tags." + type = map(string) + default = {} +}