-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
There's two areas where I feel like the examples are a bit lacking:
- There's no examples (in either the README, or in any of the individual example directories) of how to use a customer-managed policy; the lack of examples, combined with the fact that the data type for
permission_sets
is listed simply asany
rather than having an enforced structure, means that the only way to even know that the key is supposed to becustomer_managed_policies
is to look at the code; and to figure out what the value of the key should be, you need to either reason through the code yourself, or do some trial and error (I mean, it turns out to be the "obvious" option, which is that it's just an array of strings, each of which is a policy name; but it wouldn't be that weird to expect it to be an array of maps withname
andpath
keys, like thecustomer_managed_policy_reference
attribute in thessoadmin_customer_managed_policy_attachment
resource) - In the
existing-users-and-groups
example, there's some (apparent) conflation between the map keys used to reference users and groups, the value of theprincipal_name
key within an account assignment, and the value of theuser_name
/group_name
keys in theexisting_sso_users
andexisting_sso_groups
entries. From reading the module, I was able to suss out the following:- The map keys within
existing_sso_users
andexisting_sso_groups
can be whatever you want them to be, but you'll need to refer to them later. - The value of the
user_name
andgroup_name
keys within the individual records in those maps, needs to match the actual name of the record in Identity Center. - The map keys within the
account_assignments
map are completely arbitrary and don't need to match anything (and good thing, too; if the map key needed to match the principal then you couldn't have multiple records for the same principal). - The value of the
principal_name
key in the account assignment needs to match the key from theexisting_sso_users
orexisting_sso_groups
map.
- The map keys within
That's all well and good, but, in the examples the same value is used in all four places. It'd be a lot clearer if the example looked like, e.g.
existing_sso_users = {
testuser : {
user_name = "[email protected]"
}
}
existing_sso_groups = {
testgroup : {
group_name = "Test Group"
}
}
account_assignments = {
testgroup_admin : {
principal_name = "testgroup"
principal_type = "GROUP"
principal_idp = "EXTERNAL"
permission_sets = ["AdministratorAccess", "ViewOnlyAccess", ]
account_ids = [...]
}
testgroup_poweruser : {
principal_name = "testgroup"
principal_type = "GROUP"
principal_idp = "EXTERNAL"
permission_sets = ["PowerUserAccess", "ViewOnlyAccess", ]
account_ids = [...]
}
testuser_something : {
principal_name = "testuser"
principal_type = "USER"
principal_idp = "EXTERNAL"
permission_sets = ["ViewOnlyAccess"]
account_ids = [...]
}
}
This would make it much more clear which specific keys and values need to match each other (especially since the name of the principal_name
key really makes it sound as it's supposed to be the actual record name that AWS sees, e.g. [email protected]
or Test Group
, etc).
edimolfetta, jsmythsci, julienmoreau276 and dennmee
Metadata
Metadata
Assignees
Labels
No labels