PynamoDB icon indicating copy to clipboard operation
PynamoDB copied to clipboard

added new sts role configuration parameter to assume aws role dynamic…

Open KiraPC opened this issue 4 years ago • 3 comments

This PR is intended to add a new feature in order to allow dynamic assume role by just configuring the role-arn in the META class.

class Tip(Model):
    class Meta:
        aws_sts_role_arn='arn:aws:iam::1234567:role/my-aws-role'  
        table_name = "my_table"
        region = 'eu-central-1'

    id = UnicodeAttribute(hash_key=True)

This is a draft, to get your POV about this feature: if it is acceptable, if my code can be improved, or so on.

I will add tests and update the doc in next days.

KiraPC avatar May 30 '21 10:05 KiraPC

Hey @KiraPC, I think this is straying a little too far into re-implementing botocore concepts. Is there a reason that https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html wouldn't work for you?

garrettheel avatar Jun 13 '21 19:06 garrettheel

Hi @garrettheel thank you.

To be honest, I didn't tested this approach. I'll try in next days.

Anyway, if you think that implementation is far to standard, close it.

KiraPC avatar Jun 13 '21 19:06 KiraPC

Hey @KiraPC, I think this is straying a little too far into re-implementing botocore concepts. Is there a reason that https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html wouldn't work for you?

How is this re-implementing botocore concepts? This would allow you to assume a role, and then tell Pynamo to use that role. It's not always possible to use that role from the command line.

andrewlytle avatar Apr 10 '22 18:04 andrewlytle