From afc45eeffdf136e106f84b65917c9a439b6849f8 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 14 Mar 2023 10:35:47 -0400 Subject: [PATCH 1/7] updated versions.tf to use 4.4.0 for AWS, updated main.tf of account-assignment module to use alternate_identifier instead of filter --- modules/account-assignment/main.tf | 14 +++++++------- versions.tf | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/account-assignment/main.tf b/modules/account-assignment/main.tf index 583e29f..b9058bb 100644 --- a/modules/account-assignment/main.tf +++ b/modules/account-assignment/main.tf @@ -2,7 +2,7 @@ resource "aws_ssoadmin_account_assignment" "this" { instance_arn = local.sso_instance_arn permission_set_arn = var.account_assignment.permission_set_arn != null ? var.account_assignment.permission_set_arn : data.aws_ssoadmin_permission_set.this[0].arn - principal_id = var.account_assignment.principal_type == "GROUP" ? data.aws_identitystore_group.this[0].id : data.aws_identitystore_user.this[0].id + principal_id = var.account_assignment.principal_type == "GROUP" ? data.aws_identitystore_group.this.alternate_identifier : data.aws_identitystore_user.this.alternate_identifier principal_type = var.account_assignment.principal_type target_id = var.account_assignment.target_id @@ -31,8 +31,8 @@ data "aws_identitystore_group" "this" { identity_store_id = local.identity_store_id - filter { - attribute_path = "DisplayName" + alternate_identifier { + attribute_name = "DisplayName" attribute_value = var.account_assignment.principal_name } } @@ -42,8 +42,8 @@ data "aws_identitystore_user" "this" { identity_store_id = local.identity_store_id - filter { - attribute_path = "UserName" + alternate_identifier { + attribute_name = "UserName" attribute_value = var.account_assignment.principal_name } } @@ -54,6 +54,6 @@ data "aws_ssoadmin_instances" "this" { locals { # Reduce api calls - identity_store_id = var.account_assignment.identity_store_id != null ? var.account_assignment.identity_store_id : data.aws_ssoadmin_instances.this[0].identity_store_ids[0] - sso_instance_arn = var.account_assignment.instance_arn != null ? var.account_assignment.instance_arn : data.aws_ssoadmin_instances.this[0].arns[0] + identity_store_id = var.account_assignment.identity_store_id != null ? var.account_assignment.identity_store_id : data.aws_ssoadmin_instances.this.identity_store_ids[0] + sso_instance_arn = var.account_assignment.instance_arn != null ? var.account_assignment.instance_arn : data.aws_ssoadmin_instances.this.arns[0] } diff --git a/versions.tf b/versions.tf index d55a08d..e201e0a 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.30" + version = ">= 4.4.0" } } } From d6fb41ed0665725fda7cad21818f3b32c87e0fc6 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 14 Mar 2023 10:39:13 -0400 Subject: [PATCH 2/7] make doc --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf9bd5a..c062a2b 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ Terraform module to manage AWS SSO Admin resources, including: | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 4.30 | +| [aws](#requirement\_aws) | >= 4.4.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.30 | +| [aws](#provider\_aws) | >= 4.4.0 | ## Resources From 6376e873c5b1e4443040b91ac2cc5268fd17b2b7 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 14 Mar 2023 14:17:16 -0400 Subject: [PATCH 3/7] Updated aws version typo 4.4.0 -> 4.40.0 --- README.md | 4 ++-- versions.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c062a2b..7f2b56e 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ Terraform module to manage AWS SSO Admin resources, including: | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 4.4.0 | +| [aws](#requirement\_aws) | >= 4.40.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.4.0 | +| [aws](#provider\_aws) | >= 4.40.0 | ## Resources diff --git a/versions.tf b/versions.tf index e201e0a..90645ee 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.4.0" + version = ">= 4.40.0" } } } From c831ba912aee432d4e325bd3969e90418b314497 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 14 Mar 2023 14:50:02 -0400 Subject: [PATCH 4/7] Reverted accidental changes --- modules/account-assignment/main.tf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/account-assignment/main.tf b/modules/account-assignment/main.tf index b9058bb..2d57313 100644 --- a/modules/account-assignment/main.tf +++ b/modules/account-assignment/main.tf @@ -2,7 +2,7 @@ resource "aws_ssoadmin_account_assignment" "this" { instance_arn = local.sso_instance_arn permission_set_arn = var.account_assignment.permission_set_arn != null ? var.account_assignment.permission_set_arn : data.aws_ssoadmin_permission_set.this[0].arn - principal_id = var.account_assignment.principal_type == "GROUP" ? data.aws_identitystore_group.this.alternate_identifier : data.aws_identitystore_user.this.alternate_identifier + principal_id = var.account_assignment.principal_type == "GROUP" ? data.aws_identitystore_group.this[0].id : data.aws_identitystore_user.this[0].id principal_type = var.account_assignment.principal_type target_id = var.account_assignment.target_id @@ -54,6 +54,7 @@ data "aws_ssoadmin_instances" "this" { locals { # Reduce api calls - identity_store_id = var.account_assignment.identity_store_id != null ? var.account_assignment.identity_store_id : data.aws_ssoadmin_instances.this.identity_store_ids[0] - sso_instance_arn = var.account_assignment.instance_arn != null ? var.account_assignment.instance_arn : data.aws_ssoadmin_instances.this.arns[0] + identity_store_id = var.account_assignment.identity_store_id != null ? var.account_assignment.identity_store_id : data.aws_ssoadmin_instances.this[0].identity_store_ids[0] + sso_instance_arn = var.account_assignment.instance_arn != null ? var.account_assignment.instance_arn : data.aws_ssoadmin_instances.this[0].arns[0] } + From 4138e90b4f0ffe12f188bc60c51e5cbda75e136b Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 21 Mar 2023 10:25:43 -0400 Subject: [PATCH 5/7] changed aws module version requirement, fixed alternate_identifier --- modules/account-assignment/README.md | 4 ++-- modules/account-assignment/main.tf | 12 ++++++++---- modules/account-assignment/versions.tf | 2 +- modules/permission-set/README.md | 4 ++-- modules/permission-set/versions.tf | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/account-assignment/README.md b/modules/account-assignment/README.md index 85d7b97..41b956d 100644 --- a/modules/account-assignment/README.md +++ b/modules/account-assignment/README.md @@ -8,13 +8,13 @@ Module for managing an AWS SSO Account Assignment | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 4.30 | +| [aws](#requirement\_aws) | >= 4.40.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.30 | +| [aws](#provider\_aws) | >= 4.40.0 | ## Resources diff --git a/modules/account-assignment/main.tf b/modules/account-assignment/main.tf index 2d57313..b33fafc 100644 --- a/modules/account-assignment/main.tf +++ b/modules/account-assignment/main.tf @@ -32,8 +32,10 @@ data "aws_identitystore_group" "this" { identity_store_id = local.identity_store_id alternate_identifier { - attribute_name = "DisplayName" - attribute_value = var.account_assignment.principal_name + unique_attribute { + attribute_path = "DisplayName" + attribute_value = var.account_assignment.principal_name + } } } @@ -43,8 +45,10 @@ data "aws_identitystore_user" "this" { identity_store_id = local.identity_store_id alternate_identifier { - attribute_name = "UserName" - attribute_value = var.account_assignment.principal_name + unique_attribute { + attribute_path = "UserName" + attribute_value = var.account_assignment.principal_name + } } } diff --git a/modules/account-assignment/versions.tf b/modules/account-assignment/versions.tf index d55a08d..90645ee 100644 --- a/modules/account-assignment/versions.tf +++ b/modules/account-assignment/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.30" + version = ">= 4.40.0" } } } diff --git a/modules/permission-set/README.md b/modules/permission-set/README.md index 7b9e859..d70a51f 100644 --- a/modules/permission-set/README.md +++ b/modules/permission-set/README.md @@ -8,13 +8,13 @@ Module for managing an AWS SSO Permission Set | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 4.30 | +| [aws](#requirement\_aws) | >= 4.40.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.30 | +| [aws](#provider\_aws) | >= 4.40.0 | ## Resources diff --git a/modules/permission-set/versions.tf b/modules/permission-set/versions.tf index d55a08d..90645ee 100644 --- a/modules/permission-set/versions.tf +++ b/modules/permission-set/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.30" + version = ">= 4.40.0" } } } From e6f0e3eeb795c0393795baba066e811b902f8597 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 21 Mar 2023 10:26:05 -0400 Subject: [PATCH 6/7] Bumps version to 2.0.0 --- .bumpversion.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index fab32b7..b49e513 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.0 +current_version = 2.0.0 commit = True message = Bumps version to {new_version} tag = False From e729d497a12c90da7e26d87c6d2ec04bd84bd028 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 21 Mar 2023 10:28:01 -0400 Subject: [PATCH 7/7] changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49097d8..9f2b80d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +### 2.0.0 + +**Commit Delta**: n/a + +**Released**: 2023.03.21 + +**Summary**: + +* Updates to use AWS module 4.40.0 +* Replaces "filter" with "alternate_identifier" + ### 1.0.0 **Commit Delta**: n/a