How to pass AWS SSM ARN or Access Key and Secret as env variables in init container and then pass the SSM parameters to main container.
You're looking for a solution like https://github.com/godaddy/kubernetes-external-secrets
It supports both SSM Parameter Store
and AWS Secrets Manager
as backends. Pros of this comparing to init container is that you have a much more narrow scope of pods with an access to SSM. In your case it's every pod (every init container you run), in the case of kubernetes-external-secrets
it's only one controller pod per cluster. And of course, it gives less boilerplate.
Similar solutions: