File tree Expand file tree Collapse file tree 18 files changed +398
-1
lines changed
module-per-organizations-unit Expand file tree Collapse file tree 18 files changed +398
-1
lines changed Original file line number Diff line number Diff line change 22
33Terraform module which creates AWS SSO assignments on AWS.
44
5+ ## Usage
6+ ``` hcl
7+ module "account_assignments" {
8+ source = "speee/sso_assignments/aws"
9+
10+ instance_arn = "arn:aws:sso:::instance/ssoins-9999999999999999"
11+ identity_store_id = "d-9999999999"
12+
13+ organization_accounts = [
14+ {
15+ arn = "arn:aws:organizations::123456789012:account/o-xxxxxxxxxx/123456789012"
16+ 17+ id = "123456789012"
18+ name = "account1"
19+ },
20+ {
21+ arn = "arn:aws:organizations::123456789012:account/o-xxxxxxxxxx/234567890123"
22+ 23+ id = "234567890123"
24+ name = "account2"
25+ },
26+ ]
27+
28+ assignments = {
29+ "account1" = {
30+ "groups" = {
31+ "SystemAdministrator" = [
32+ "AdministratorAccess",
33+ ],
34+ "Engineer" = [
35+ "PowerUserAccess",
36+ ],
37+ "Manager" = [
38+ "ReadOnlyAccess",
39+ ],
40+ },
41+ "users" = {
42+ 43+ "AdministratorAccess",
44+ ],
45+ },
46+ },
47+ "account2" = {
48+ "users" = {
49+ 50+ "AdministratorAccess",
51+ ],
52+ 53+ "ReadOnlyAccess",
54+ ],
55+ },
56+ },
57+ }
58+ }
59+ ```
60+
61+ ## Examples
62+ - [ All account assignments in a single module] ( https://github.com/speee/terraform-aws-sso-assignment/tree/master/examples/all-in-one )
63+ - [ Account assignments per organization units] ( https://github.com/speee/terraform-aws-sso-assignment/tree/master/examples/module-per-organizations-unit )
64+
65+ ## Notes
66+ 1 . This module does not create no resource other than ` aws_ssoadmin_account_assignment ` resource. Use resources or data sources directly to manage other resources like ` aws_ssoadmin_permission_set ` .
67+
68+
569<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
670## Requirements
771
@@ -14,7 +78,7 @@ Terraform module which creates AWS SSO assignments on AWS.
1478
1579| Name | Version |
1680| ------| ---------|
17- | <a name =" provider_aws " ></a > [ aws] ( #provider\_ aws ) | 3.52 .0 |
81+ | <a name =" provider_aws " ></a > [ aws] ( #provider\_ aws ) | 3.24 .0 |
1882
1983## Modules
2084
Original file line number Diff line number Diff line change 1+ # All account assignments in a single module
2+
3+ Define all account assignments in a single module.
4+
5+ ## Usage
6+
7+ To run this example you need to execute:
8+
9+ ``` bash
10+ $ terraform init
11+ $ terraform plan
12+ $ terraform apply
13+ ```
14+
15+ <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
16+ ## Requirements
17+
18+ | Name | Version |
19+ | ------| ---------|
20+ | <a name =" requirement_terraform " ></a > [ terraform] ( #requirement\_ terraform ) | >= 0.13.7 |
21+ | <a name =" requirement_aws " ></a > [ aws] ( #requirement\_ aws ) | >=3.24.0 |
22+
23+ ## Providers
24+
25+ | Name | Version |
26+ | ------| ---------|
27+ | <a name =" provider_aws " ></a > [ aws] ( #provider\_ aws ) | 3.24.0 |
28+
29+ ## Modules
30+
31+ | Name | Source | Version |
32+ | ------| --------| ---------|
33+ | <a name =" module_all_assignments " ></a > [ all\_ assignments] ( #module\_ all\_ assignments ) | ../.. | n/a |
34+
35+ ## Resources
36+
37+ | Name | Type |
38+ | ------| ------|
39+ | [ aws_organizations_organization.organization] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/organizations_organization ) | data source |
40+ | [ aws_ssoadmin_instances.instances] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssoadmin_instances ) | data source |
41+
42+ ## Inputs
43+
44+ | Name | Description | Type | Default | Required |
45+ | ------| -------------| ------| ---------| :--------:|
46+ | <a name =" input_assignments_all " ></a > [ assignments\_ all] ( #input\_ assignments\_ all ) | All of account assignments. | ` map(map(map(list(string)))) ` | n/a | yes |
47+ | <a name =" input_sso_region " ></a > [ sso\_ region] ( #input\_ sso\_ region ) | Region of your AWS SSO instance. | ` string ` | n/a | yes |
48+
49+ ## Outputs
50+
51+ No outputs.
52+ <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Original file line number Diff line number Diff line change 1+ terraform {
2+ backend "local" {
3+ path = " terraform.tfstate"
4+ }
5+ }
Original file line number Diff line number Diff line change 1+ data "aws_ssoadmin_instances" "instances" {}
2+
3+ data "aws_organizations_organization" "organization" {}
4+
5+ locals {
6+ instance_arn = tolist (data. aws_ssoadmin_instances . instances . arns )[0 ]
7+ identity_store_id = tolist (data. aws_ssoadmin_instances . instances . identity_store_ids )[0 ]
8+ accounts = data. aws_organizations_organization . organization . accounts
9+ }
10+
11+ module "all_assignments" {
12+ source = " ../.."
13+
14+ instance_arn = local. instance_arn
15+ identity_store_id = local. identity_store_id
16+
17+ organization_accounts = local. accounts
18+
19+ assignments = var. assignments_all
20+ }
Original file line number Diff line number Diff line change 1+ provider "aws" {
2+ region = var. sso_region
3+ }
Original file line number Diff line number Diff line change 1+ assignments_all = {
2+ " account1" = {
3+ " groups" = {
4+ " SystemAdministrator" = [
5+ " AdministratorAccess" ,
6+ ],
7+ " Engineer" = [
8+ " PowerUserAccess" ,
9+ ],
10+ " Manager" = [
11+ " ReadOnlyAccess" ,
12+ ],
13+ },
14+ " users" = {
15+ 16+ " AdministratorAccess" ,
17+ ],
18+ },
19+ },
20+ " account2" = {
21+ " groups" = {
22+ " SystemAdministrator" = [
23+ " AdministratorAccess" ,
24+ ],
25+ " Engineer" = [
26+ " PowerUserAccess" ,
27+ ],
28+ " Manager" = [
29+ " ReadOnlyAccess" ,
30+ ],
31+ },
32+ " users" = {
33+ 34+ " AdministratorAccess" ,
35+ ],
36+ 37+ " ReadOnlyAccess" ,
38+ ],
39+ },
40+ },
41+ }
Original file line number Diff line number Diff line change 1+ variable "sso_region" {
2+ type = string
3+ description = " Region of your AWS SSO instance."
4+ }
5+
6+ variable "assignments_all" {
7+ type = map (map (map (list (string ))))
8+ description = " All of account assignments."
9+ }
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_version = " >= 0.13.7"
3+
4+ required_providers {
5+ aws = {
6+ source = " hashicorp/aws"
7+ version = " >=3.24.0"
8+ }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ # Account assignment per organization units
2+
3+ Define account assignments per organization units.
4+
5+ ## Usage
6+
7+ To run this example you need to execute:
8+
9+ ``` bash
10+ $ terraform init
11+ $ terraform plan
12+ $ terraform apply
13+ ```
14+
15+ <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
16+ ## Requirements
17+
18+ | Name | Version |
19+ | ------| ---------|
20+ | <a name =" requirement_terraform " ></a > [ terraform] ( #requirement\_ terraform ) | >= 0.13.7 |
21+ | <a name =" requirement_aws " ></a > [ aws] ( #requirement\_ aws ) | >=3.24.0 |
22+
23+ ## Providers
24+
25+ | Name | Version |
26+ | ------| ---------|
27+ | <a name =" provider_aws " ></a > [ aws] ( #provider\_ aws ) | 3.24.0 |
28+
29+ ## Modules
30+
31+ | Name | Source | Version |
32+ | ------| --------| ---------|
33+ | <a name =" module_ou1_assignments " ></a > [ ou1\_ assignments] ( #module\_ ou1\_ assignments ) | ../.. | n/a |
34+ | <a name =" module_ou2_assignments " ></a > [ ou2\_ assignments] ( #module\_ ou2\_ assignments ) | ../.. | n/a |
35+
36+ ## Resources
37+
38+ | Name | Type |
39+ | ------| ------|
40+ | [ aws_organizations_organization.organization] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/organizations_organization ) | data source |
41+ | [ aws_ssoadmin_instances.instances] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssoadmin_instances ) | data source |
42+
43+ ## Inputs
44+
45+ | Name | Description | Type | Default | Required |
46+ | ------| -------------| ------| ---------| :--------:|
47+ | <a name =" input_assignments_ou1 " ></a > [ assignments\_ ou1] ( #input\_ assignments\_ ou1 ) | Account assignments for Organization Unit 1. | ` map(map(map(list(string)))) ` | n/a | yes |
48+ | <a name =" input_assignments_ou2 " ></a > [ assignments\_ ou2] ( #input\_ assignments\_ ou2 ) | Account assignments for Organization Unit 2. | ` map(map(map(list(string)))) ` | n/a | yes |
49+ | <a name =" input_sso_region " ></a > [ sso\_ region] ( #input\_ sso\_ region ) | Region of your AWS SSO instance. | ` string ` | n/a | yes |
50+
51+ ## Outputs
52+
53+ No outputs.
54+ <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
You can’t perform that action at this time.
0 commit comments