Rancher setup wizard failing on permissions check

I’m trying to setup the rancher set-up wizard from your gouide with a terraform script I’ve vreated.

I can see the the IAM policy and role have been correctly created and assigned to the instance but the instance always fails to successfully test the policy / role permissions.

From the instance logs I have fthe follwoing error:

E, [2023-06-21T13:09:01.294532 #504] ERROR -- : [c6d52b0c-07d7-4742-a71c-829e63f8add3] Exit status:     255
Standard output:
Error output:
An error occurred (NoSuchEntity) when calling the SimulatePrincipalPolicy operation: Unable to retrieve specified IAM entity.

I, [2023-06-21T13:09:01.294963 #504]  INFO -- : [c6d52b0c-07d7-4742-a71c-829e63f8add3]   Rendered engines/aws/app/views/aws/permissions/show.html.haml within layouts/application (Duration: 1271.5ms | Allocations: 6518)
I, [2023-06-21T13:09:01.295032 #504]  INFO -- : [c6d52b0c-07d7-4742-a71c-829e63f8add3]   Rendered layout layouts/application.html.haml (Duration: 1271.7ms | Allocations: 6552)
I, [2023-06-21T13:09:01.295328 #504]  INFO -- : [c6d52b0c-07d7-4742-a71c-829e63f8add3] Completed 500 Internal Server Error in 3272ms (ActiveRecord: 0.3ms | Allocations: 9996)
F, [2023-06-21T13:09:01.296584 #504] FATAL -- : [c6d52b0c-07d7-4742-a71c-829e63f8add3]
[c6d52b0c-07d7-4742-a71c-829e63f8add3] ActionView::Template::Error (
An error occurred (NoSuchEntity) when calling the SimulatePrincipalPolicy operation: Unable to retrieve specified IAM entity.
):
[c6d52b0c-07d7-4742-a71c-829e63f8add3]     10:   - else
[c6d52b0c-07d7-4742-a71c-829e63f8add3]     11:     %p= t('engines.aws.permissions.missing')
[c6d52b0c-07d7-4742-a71c-829e63f8add3]     12:     %ul
[c6d52b0c-07d7-4742-a71c-829e63f8add3]     13:       - @permissions.missing.each do |perm|
[c6d52b0c-07d7-4742-a71c-829e63f8add3]     14:         %li= perm
[c6d52b0c-07d7-4742-a71c-829e63f8add3]     15:   = link_to(t('actions.retest'), permissions_path, class: 'btn btn-primary')
[c6d52b0c-07d7-4742-a71c-829e63f8add3]     16: -# end
[c6d52b0c-07d7-4742-a71c-829e63f8add3]
[c6d52b0c-07d7-4742-a71c-829e63f8add3] app/models/concerns/executable.rb:68:in `rescue in cheetah_execute'
[c6d52b0c-07d7-4742-a71c-829e63f8add3] app/models/concerns/executable.rb:45:in `cheetah_execute'
[c6d52b0c-07d7-4742-a71c-829e63f8add3] app/models/concerns/executable.rb:31:in `execute'
I, [2023-06-21T13:09:01.297443 #504]  INFO -- : [c6d52b0c-07d7-4742-a71c-829e63f8add3] Processing by ExceptionsApp#internal_server_error as HTML

But I am unable to decipher what is missing.

I should note I get the same issue when trying build the environment and instance manually.