Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This module handles creation of AWS SSO permission sets and assignment to AWS SS
Before this module can be used, please ensure that the following pre-requisites are met:
- Enable AWS Organizations and add AWS Accounts you want to be managed by SSO. [Documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tutorials_basic.html)
- Enable AWS SSO. [Documentation](https://docs.aws.amazon.com/singlesignon/latest/userguide/step1.html).
- Create AWS SSO entities (Users and Groups). [Documentation](https://docs.aws.amazon.com/singlesignon/latest/userguide/addusers.html).
- Create AWS SSO entities (Users and Groups) [Documentation](https://docs.aws.amazon.com/singlesignon/latest/userguide/addusers.html) or use identitystore [module](https://github.com/avlcloudtechnologies/terraform-aws-identitystore).
- Ensure that Terraform is using a role with permissions required for AWS SSO management. [Documentation](https://docs.aws.amazon.com/singlesignon/latest/userguide/iam-auth-access-using-id-policies.html#requiredpermissionsconsole).

## Usage
Expand Down Expand Up @@ -65,13 +65,13 @@ module "sso" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.23 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.30 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.34 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.30 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.34 |

## Modules

Expand Down
16 changes: 10 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,22 @@ data "aws_ssoadmin_instances" "this" {}
data "aws_identitystore_group" "this" {
for_each = toset(local.groups)
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
filter {
attribute_path = "DisplayName"
attribute_value = each.value
alternate_identifier {
unique_attribute {
attribute_path = "DisplayName"
attribute_value = each.value
}
}
}

data "aws_identitystore_user" "this" {
for_each = toset(local.users)
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
filter {
attribute_path = "UserName"
attribute_value = each.value
alternate_identifier {
unique_attribute {
attribute_path = "UserName"
attribute_value = each.value
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.30"
version = ">= 4.34"
}
}
}