| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Deletes an instance profile.
Caution
Make sure you do not have any Amazon EC2 instances running with the role or instance profile you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.
For more information about instance profiles, go to About Instance Profiles in Using AWS Identity and Access Management.
iam-instanceprofiledel
-s
INSTANCEPROFILENAME [ -r [-p] ]
| Name | Description | Required |
|---|---|---|
|
|
The name of the instance profile to delete. Type: String |
Yes |
|
|
Deletes the associated roles along with the instance profile. Type: String Default: None |
Optional |
|
|
Returns the roles that would be deleted, without actually recursively deleting the
instance profile or the roles. Use this option before using Type: String Constraints: You can apply -p only together with -r. Default: None |
Optional |
If successful, the output is empty.
The following example deletes the instance profile named myinstanceprofile. This example assumes the instance profile doesn't have roles attached.
PROMPT> iam-instanceprofiledel -s myinstanceprofile
The following example shows the roles associated with the instance profile that would be deleted if you were to recursively delete myinstanceprofile.
PROMPT> iam-instanceprofiledel -s myinstanceprofile -r -p
roles
arn:aws:iam::123456789012:role/myroleThe following example recursively deletes myinstanceprofile.
PROMPT> iam-instanceprofiledel -s myinstanceprofile -r