Creating an Instance Profile
To create an instance profile:
- Run the following command:
aws iam create-instance-profile \
--instance-profile-name <Workernodes Instance profile name> - Record your assigned worker node's instance profile name in the AWS worksheet. In our example we will use
srgdemo-workernodes-instance-profile
. The command will return a description of the newly-created instance profile. For example:
{ "InstanceProfile":{ "InstanceProfileId":"AIPAJMBYC7DLSPEXAMPLE", "Roles":[ ], "CreateDate":"2015-03-09T20:33:19.626Z", "InstanceProfileName":"Webserver", "Path":"/", "Arn":"arn:aws:iam::123456789012:instance-profile/Webserver" } }
- Record the Arn value in the AWS Worksheet as
Workernodes Instance profile ARN.
- Run the following command to add the role to the instance profile:
aws iam add-role-to-instance-profile \
--instance-profile-name <Workernodes Instance profile name> \
--role-name <Workernodes role name>
Where:
<Workernodes Instance profile name>
: Use the instance profile name created above or by your AWS infrastructure administrators and recorded in the AWS worksheet. For example, srgdemo-workernodes-instance-profile.
<Workernodes role name>:
Use the role name created by your AWS infrastructure administrators and recorded in the AWS worksheet. For example, srgdemo-workernodes-svc-role.
Example:
aws iam add-role-to-instance-profile --instance-profile-name srgdemo-workernodes-instance-profile --role-name srgdemo-workernodes-svc-role
Next Step: Create and Configure a Launch Template