Skip to content

Commit ff70937

Browse files
Piccirelloclaude
andcommitted
Update docs with API efficiency settings
- Document identity_store_id benefits (eliminates describe_sso_instance calls) - Document PermissionSet ARN support (skips list_permission_sets calls) - Add identity_store_id to deployment example - Add PermissionSet ARN example in config - Fix duplicate source line in module example Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0049215 commit ff70937

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ The fields in the configuration dictionary are:
352352

353353
- **ResourceType**: This field specifies the type of resource being requested, such as "Account." As of now, the only supported value is "Account."
354354
- **Resource**: This field defines the specific resource(s) being requested. It accepts either a single string or a list of strings. Setting this field to "*" allows the rule to match all resources associated with the specified `ResourceType`.
355-
- **PermissionSet**: Here, you indicate the permission set(s) being requested. This can be either a single string or a list of strings. If set to "*", the rule matches all permission sets available for the defined `Resource` and `ResourceType`.
355+
- **PermissionSet**: Here, you indicate the permission set(s) being requested. This can be either a single string or a list of strings. You can specify permission sets by **name** (e.g., `"AdministratorAccess"`) or by **ARN** (e.g., `"arn:aws:sso:::permissionSet/ssoins-1234567890abcdef/ps-1234567890abcdef"`). Using ARNs is recommended for Terraform users as it reduces API calls and allows direct reference to `aws_ssoadmin_permission_set.*.arn`. If set to "*", the rule matches all permission sets available for the defined `Resource` and `ResourceType`.
356356
- **Approvers**: This field lists the potential approvers for the request. It accepts either a single string or a list of strings representing different approvers.
357357
- **AllowSelfApproval**: This field can be a boolean, indicating whether the requester, if present in the `Approvers` list, is permitted to approve their own request. It defaults to `None`.
358358
- **ApprovalIsNotRequired**: This field can also be a boolean, signifying whether the approval can be granted automatically, bypassing the approvers entirely. The default value is `None`.
@@ -486,12 +486,15 @@ data "aws_ssm_parameter" "sso_elevator_slack_bot_token" {
486486
}
487487
488488
module "aws_sso_elevator" {
489-
source = "github.com/fivexl/terraform-aws-sso-elevator.git"
490489
source = "fivexl/sso-elevator/aws"
491490
version = "2.0.2"
492-
slack_signing_secret = data.aws_ssm_parameter.sso_elevator_slack_signing_secret.value
493-
slack_bot_token = data.aws_ssm_parameter.sso_elevator_slack_bot_token.value
494-
slack_channel_id = local.slack_channel_id
491+
492+
slack_signing_secret = data.aws_ssm_parameter.sso_elevator_slack_signing_secret.value
493+
slack_bot_token = data.aws_ssm_parameter.sso_elevator_slack_bot_token.value
494+
slack_channel_id = local.slack_channel_id
495+
496+
# Recommended: Pass identity_store_id to reduce API calls (eliminates describe_sso_instance calls)
497+
identity_store_id = tolist(data.aws_ssoadmin_instances.this.identity_store_ids)[0]
495498
496499
s3_logging = {
497500
target_bucket = module.naming_conventions.s3_access_logs_bucket_name
@@ -597,7 +600,16 @@ module "aws_sso_elevator" {
597600
"ResourceType" : "Account",
598601
"Resource" : "account_id",
599602
"PermissionSet" : ["ReadOnlyPlus", "AdministratorAccess"],
600-
"Approvers" : ["ciso@corp.com"],
603+
"Approvers" : ["ciso@corp.com"],
604+
"AllowSelfApproval" : true,
605+
},
606+
# Recommended: Use PermissionSet ARNs for better API efficiency
607+
# This avoids list_permission_sets API calls when resolving names
608+
{
609+
"ResourceType" : "Account",
610+
"Resource" : "account_id",
611+
"PermissionSet" : aws_ssoadmin_permission_set.developer.arn,
612+
"Approvers" : ["tech-lead@corp.com"],
601613
"AllowSelfApproval" : true,
602614
},
603615

vars.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,14 @@ variable "attribute_sync_event_rule_name" {
462462
}
463463

464464
variable "identity_store_id" {
465-
description = "The Identity Store ID. If not provided and sso_instance_arn is also not provided, it will be automatically discovered."
465+
description = <<EOT
466+
The Identity Store ID (e.g., "d-1234567890").
467+
If not provided and sso_instance_arn is also not provided, it will be automatically discovered.
468+
469+
Providing this value is RECOMMENDED for API efficiency - it eliminates describe_sso_instance API calls
470+
on every Lambda invocation. You can find this value in the AWS IAM Identity Center console or via:
471+
aws sso-admin list-instances --query 'Instances[0].IdentityStoreId' --output text
472+
EOT
466473
type = string
467474
default = ""
468475
}

0 commit comments

Comments
 (0)