-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from reste85/feat/iam-idc-application-support
feat: add support for IAM IdC Applications (with testing)
- Loading branch information
Showing
18 changed files
with
920 additions
and
2 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
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
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 +1,3 @@ | ||
v1.0.0 | ||
v1.0.1 | ||
|
||
|
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
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,66 @@ | ||
This directory contains examples of using the module to **create** applications, application assignments configurations, users, groups and application assignments to both users and groups | ||
|
||
**IMPORTANT:** Ensure that the name of your object matches the name of your principal (e.g. user name or group name). See the following example with object/principal names 'Admin' and 'nuzumaki': | ||
|
||
```hcl | ||
sso_groups = { | ||
Admin : { | ||
group_name = "Admin" | ||
group_description = "Admin IAM Identity Center Group" | ||
}, | ||
} | ||
// Create desired USERS in IAM Identity Center | ||
sso_users = { | ||
nuzumaki : { | ||
group_membership = ["Admin",] | ||
user_name = "nuzumaki" | ||
given_name = "Naruto" | ||
family_name = "Uzumaki" | ||
email = "[email protected]" | ||
}, | ||
} | ||
// Create desired Applications in IAM Identity Center | ||
sso_applications = { | ||
FirstApplication : { | ||
application_provider_arn = "arn:aws:sso::aws:applicationProvider/custom" | ||
description = "I am the First Application" | ||
name = "FirstApplication" | ||
portal_options = { | ||
sign_in_options = { | ||
application_url = "http://example.com" | ||
origin = "APPLICATION" | ||
} | ||
visibility = "ENABLED" | ||
} | ||
status = "ENABLED" | ||
assignment_required = true | ||
assignments_access_scope = [ | ||
{ | ||
authorized_targets = ["FirstApplication"] | ||
scope = "sso:account:access" | ||
} | ||
] | ||
group_assignments = ["Dev"] | ||
user_assignments = ["nuzumaki"] | ||
} | ||
} | ||
``` | ||
|
||
These names are referenced throughout the module. Failure to do this may lead to unintentional errors such as the following: | ||
|
||
``` | ||
Error: Invalid index | ||
│ | ||
│ on ../../main.tf line 141, in resource "aws_identitystore_group_membership" "sso_group_membership": | ||
│ 141: member_id = (contains(local.this_users, each.value.user_name) ? aws_identitystore_user.sso_users[each.value.user_name].user_id : data.aws_identitystore_user.existing_sso_users[each.value.user_name].id) | ||
│ ├──────────────── | ||
│ │ aws_identitystore_user.sso_users is object with 2 attributes | ||
│ │ each.value.user_name is "nuzumaki" | ||
│ | ||
│ The given key does not identify an element in this collection value. | ||
``` | ||
|
||
To resolve this, ensure your object and principal names are the same and re-run `terraform plan` and `terraform apply`. |
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,98 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
This directory contains examples of using the module to **create** applications, application assignments configurations, users, groups and application assignments to both users and groups | ||
|
||
**IMPORTANT:** Ensure that the name of your object matches the name of your principal (e.g. user name or group name). See the following example with object/principal names 'Admin' and 'nuzumaki': | ||
|
||
```hcl | ||
sso_groups = { | ||
Admin : { | ||
group_name = "Admin" | ||
group_description = "Admin IAM Identity Center Group" | ||
}, | ||
} | ||
// Create desired USERS in IAM Identity Center | ||
sso_users = { | ||
nuzumaki : { | ||
group_membership = ["Admin",] | ||
user_name = "nuzumaki" | ||
given_name = "Naruto" | ||
family_name = "Uzumaki" | ||
email = "[email protected]" | ||
}, | ||
} | ||
// Create desired Applications in IAM Identity Center | ||
sso_applications = { | ||
FirstApplication : { | ||
application_provider_arn = "arn:aws:sso::aws:applicationProvider/custom" | ||
description = "I am the First Application" | ||
name = "FirstApplication" | ||
portal_options = { | ||
sign_in_options = { | ||
application_url = "http://example.com" | ||
origin = "APPLICATION" | ||
} | ||
visibility = "ENABLED" | ||
} | ||
status = "ENABLED" | ||
assignment_required = true | ||
assignments_access_scope = [ | ||
{ | ||
authorized_targets = ["FirstApplication"] | ||
scope = "sso:account:access" | ||
} | ||
] | ||
group_assignments = ["Dev"] | ||
user_assignments = ["nuzumaki"] | ||
} | ||
} | ||
``` | ||
|
||
These names are referenced throughout the module. Failure to do this may lead to unintentional errors such as the following: | ||
|
||
``` | ||
Error: Invalid index | ||
│ | ||
│ on ../../main.tf line 141, in resource "aws_identitystore_group_membership" "sso_group_membership": | ||
│ 141: member_id = (contains(local.this_users, each.value.user_name) ? aws_identitystore_user.sso_users[each.value.user_name].user_id : data.aws_identitystore_user.existing_sso_users[each.value.user_name].id) | ||
│ ├──────────────── | ||
│ │ aws_identitystore_user.sso_users is object with 2 attributes | ||
│ │ each.value.user_name is "nuzumaki" | ||
│ | ||
│ The given key does not identify an element in this collection value. | ||
``` | ||
|
||
To resolve this, ensure your object and principal names are the same and re-run `terraform plan` and `terraform apply`. | ||
|
||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_aws-iam-identity-center"></a> [aws-iam-identity-center](#module\_aws-iam-identity-center) | ../.. | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_ssm_parameter.account1_account_id](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source | | ||
|
||
## Inputs | ||
|
||
No inputs. | ||
|
||
## Outputs | ||
|
||
No outputs. | ||
<!-- END_TF_DOCS --> |
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,14 @@ | ||
# Fetch Account Id from SSM Parameter Store | ||
data "aws_ssm_parameter" "account1_account_id" { | ||
name = "tf-aws-iam-idc-module-testing-account1-account-id" // replace with your SSM Parameter Key | ||
} | ||
|
||
locals { | ||
# Account IDs | ||
account1_account_id = nonsensitive(data.aws_ssm_parameter.account1_account_id.value) | ||
# account1_account_id = "111111111111" | ||
# account2_account_id = "222222222222" | ||
# account3_account_id = "333333333333" | ||
# account4_account_id = "444444444444" | ||
|
||
} |
Oops, something went wrong.