-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat: Use aws_service_principal
data source for deriving IAM service prinicpals
#3539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
use the service prinipal name in policies Signed-off-by: Fred Myerscough <[email protected]>
Signed-off-by: Fred Myerscough <[email protected]>
Are you facing an issue |
Hi @bryantbiggs - yes, when trying to deploy into some AWS Partitions - using that Partitions domain to create the SPN, results in throwing an Invalid principal in policy validation error when deploying. Using the DNS suffix is an old, deprecated way of creating one. aws_service_principal solves this, by creating the correct, backwards compatible SPN for a service, depending on which region you are deploying to :) |
I'd like to learn more about this error you encountered, the error message, and what partition. the |
Sure! So in some of the old AWS partitions, using the DNS suffix was accepted as part of the SPN, but this was quickly deprecated as more Partitions where created in favour of a standardised If you use the DNS suffix in the newer ones, where its not accepted you get an error like:
The So, this change should keep things simple, and allow the modules to be easily deployed to different regions/partitions :D |
thanks for the information, we use this pattern quite a bit so I wanted to understand better, and we've also encountered issues with partitions (mostly because services don't do a great job at defining when the partition/suffix should change) |
aws_service_principal
data source for deriving IAM service prinicpals
Signed-off-by: Fred Myerscough <[email protected]>
Signed-off-by: Fred Myerscough <[email protected]>
Updated to address the recommendations! Will be happy to look through the other repos in |
Leaving the
|
Using a Regions DNS Suffix is not an accurate way to determine the Service Principal Name for a service in different AWS Partitions.
This MR removes its use, in preference of the TF
aws_service_principal
resource, that will better determine the name and not cause deployment issues in Partitions.