Converting AWS IAM role creation console command into CLI command

Viewed 16

I am following an official AWS tutorial on how to concatenate ECS-issued multiline log messages. The tutorial's steps are described in terms of AWS console operations, and I'd like to convert them into AWS CLI ones. One of those steps is the creation of an IAM role:


 1. Open the IAM console at https://console.aws.amazon.com/iam/.
 [...]
 7. In the navigation pane, choose Roles and then choose Create Roles
 8. In the Trusted entity type section, choose AWS service
 9. For Use case, choose Elastic Container Service
 10. Choose Elastic Container Service Task and then Next
 11. Associate the role with the ecs-policy-for-firelens policy you created and choose Next

How could I convert the same creation into an AWS CLI call, especially steps 8-10? I've tried reading the official documentation, but couldn't find anything.

0 Answers
Related