-
Notifications
You must be signed in to change notification settings - Fork 404
feat(aws): add region support to ssm and sm #475
feat(aws): add region support to ssm and sm #475
Conversation
@silasbw do you have some time to look into this? |
Yo! I merged #454 which caused a bunch of conflicts here. |
Signed-off-by: Moritz Johner <[email protected]>
e31bc57
to
f3ea0ba
Compare
Thanks for the update @Flydiverny, i rebased my changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me, but one question. If I pass a region, is this for only specifying the region for the secret? Which region is the IAM role in? Currently I think the IAM role would be assumed using the default region. But I could be wrong about that. What would be the expected behavior?
Thanks for the feedback! True, documentation is lacking. The readme is already really long, we should consider using something to generate static pages and serve them using github pages (i'll open a issue for that). Let me try to outline the mechanics: Take this slightly modified example from the AWS docs: {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetResourcePolicy",
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds"
],
"Resource": [
"arn:aws:secretsmanager:us-west-2:111122223333:secret:aes128-1a2b3c",
"arn:aws:secretsmanager:us-central-1:111122223333:secret:aes192-4D5e6F",
"arn:aws:secretsmanager:us-east-1:111122223333:secret:aes256-7g8H9i"
]
}
]
} IAM roles are global, the attached policies grant access to certain resources in certain regions (or If it is not defined explicitly it falls back to use (see docs):
So, essentially, if the region property is set it will take precedence over the above chain. |
Yes, we should definitely set up some docs. Was planning to try setting something up with docusaurus but didn't get around to it. Think we can merge this as is then. |
This PR adds multi-region support for ssm and sm #354
I feel like we should (somehow) cache & reuse the ssm/sm
client
object so we don't assume a role in each_get
call. E.g. by using the hash of theExternalSecret
or${namespace}/${name}/${metadata.generation}
as cache key for the client object.