Skip to content

thoughtbot/terraform-aws-sso-permission-set-roles

Repository files navigation

AWS SSO Permission Set Roles

AWS SSO will create an IAM role in each account for each permission set, but the role name includes a random string, making it difficult to refer to these roles in IAM policies.

This module provides a map of each permission set by name to the role provisioned for that permission set.

Example

module "permission_set_roles" {
  source = "[email protected]:thoughtbot/terraform-aws-sso-permission-set-roles.git?ref=v0.2.0"
}

data "aws_iam_policy_document" "assume_role" {
  statement {
    actions = ["sts:AssumeRole"]
    principals {
      identifiers = [module.permission_set_roles.by_name.PowerUserAccess]
      type        = "AWS"
    }
  }
}

Requirements

Name Version
terraform >= 0.14.0
aws ~> 4.0

Providers

Name Version
aws ~> 4.0

Modules

No modules.

Resources

Name Type
aws_iam_roles.sso data source

Inputs

No inputs.

Outputs

Name Description
arns ARNs for SSO-provisioned roles
arns_without_path ARNs for SSO-provisioned roles without paths (for aws-auth)
by_name Role ARN for each permission set name
by_name_without_path Role ARN for each permission set name
names Names of permission sets with provisioned roles

Contributing

Please see CONTRIBUTING.md.

License

This module is Copyright © 2022 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About thoughtbot

thoughtbot

This module is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software! See our other projects or hire us to design, develop, and grow your product.

About

Lookup AWS SSO permission set roles by permission set name

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •