-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Command for creating roles #59
Comments
Probably need a |
response = client.create_role(
Path='string',
RoleName='string',
AssumeRolePolicyDocument='string',
Description='string',
MaxSessionDuration=123,
PermissionsBoundary='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
) Looks like only Tempted to add a |
If you run this command twice:
Should it redefine the I think it should... but it should maybe show an interactive warning that you are about to replace an existing role (since the command is called |
I need to try this out myself first - ideally by shipping a lambda function that can read/write to an S3 bucket via a role created using the procedure I would use to implement this command. |
Maybe name the command |
Current list of commands from
I think |
If I do this it would be useful to be able to try out the newly created roles with the They could grow a |
Also maybe have a way of returning temporary authentication credentials for a specified role. Something like this:
Could also offer an option to |
This is beginning to make the |
Annoying that |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "access-analyzer.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
} So they aren't policies for what the role is allowed to do - they are policies that control who or what is allowed to assume that role. Re-reading the docs, that field is described as "The trust relationship policy document that grants an entity permission to assume the role." - but it's also a required field! So you can't create a role without having that document. I guess that means the |
OK, it looks like you have to create a role, then attach policies to it using https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iam.html#IAM.Client.attach_role_policy response = client.attach_role_policy(
RoleName='string',
PolicyArn='string'
) That requires a policy ARN - but the docs say:
So it looks like I should use response = client.put_role_policy(
RoleName='string',
PolicyName='string',
PolicyDocument='string'
) The s3-credentials/s3_credentials/cli.py Lines 421 to 424 in 722bf52
s3-credentials/s3_credentials/cli.py Lines 446 to 450 in 722bf52
|
Looking at my existing code, I have this: s3-credentials/s3_credentials/cli.py Lines 727 to 748 in 7fb4db1
Where did I get that That came out of my research in: After puzzling over the A useful clue: in the web console it's called trusted entities, as seen in this screenshot: |
Here's what the AWS CLI
|
Design question: what should the options to the command be for generating the I think the following:
|
At least one of these three options is required, or the command returns an error. |
Detailed documentation about what can go in Multiple values can be provided, for example:
Presumably it's possible to have both |
I could offer |
If you want to access S3 from a Lambda function, AWS recommend you create a dedicated role that the Lambda function can then use. But... you still need to attach JSON policies to it!
https://aws.amazon.com/premiumsupport/knowledge-center/lambda-execution-role-s3-bucket/
A similar mechanism is available for EC2 instances: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-instance-access-s3-bucket/
So a command which can create a role using the same
--read-only
and suchlike options as the other commands would be really useful.Maybe something like:
The text was updated successfully, but these errors were encountered: