To create an IAM Role, you need to define a trust policy and one or more permission policies. Here is an example of how you can create an IAM Role using the AWS CLI:
aws iam create-role --role-name ExampleRole --assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}'