aws_role_create | R Documentation |
Create a role
aws_role_create(
name,
assume_role_policy_document,
path = NULL,
description = NULL,
max_session_duration = NULL,
permission_boundary = NULL,
tags = NULL
)
name |
(character) A role name. required |
assume_role_policy_document |
(character) The trust relationship policy document that grants an entity permission to assume the role. json as string. required |
path |
(character) The path for the role name. optional. If it is not included, it defaults to a slash (/). |
description |
(character) a description fo the role. optional |
max_session_duration |
(character) The maximum session duration (in seconds) that you want to set for the specified role. optional |
permission_boundary |
(character) The ARN of the managed policy that is used to set the permissions boundary for the role. optional |
tags |
(list) A list of tags that you want to attach to the new user. optional |
See https://www.paws-r-sdk.com/docs/iam_create_role/ docs for details on the parameters
A tibble with information about the role created
Other roles:
aws_role()
,
aws_role_delete()
,
aws_role_exists()
,
aws_roles()
role_name <- "AMinorRole"
trust_policy <- list(
Version = "2012-10-17",
Statement = list(
list(
Effect = "Allow",
Principal = list(
Service = "lambda.amazonaws.com"
),
Action = "sts:AssumeRole"
)
)
)
doc <- jsonlite::toJSON(trust_policy, auto_unbox = TRUE)
desc <- "My test role"
z <- aws_role_create(role_name,
assume_role_policy_document = doc,
description = desc
)
# attach a policy
invisible(z %>% aws_policy_attach("AWSLambdaBasicExecutionRole"))
# cleanup
invisible(z %>% aws_policy_detach("AWSLambdaBasicExecutionRole"))
aws_role_delete(role_name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.