ine-labs / AWSGoat

AWSGoat : A Damn Vulnerable AWS Infrastructure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: `AWS_GOAT_ec2_profile: EntityAlreadyExists`

za opened this issue · comments

commented

Hi there,

I am getting this when applying the terraform:

│ Error: creating IAM instance profile AWS_GOAT_ec2_profile: EntityAlreadyExists: Instance Profile AWS_GOAT_ec2_profile already exists.
│ 	status code: 409, request id: ca6<snipped>
│ 
│   with aws_iam_instance_profile.goat_iam_profile,
│   on main.tf line 3484, in resource "aws_iam_instance_profile" "goat_iam_profile":
│ 3484: resource "aws_iam_instance_profile" "goat_iam_profile" {
│ 
╵
Error: Process completed with exit code 1.

I can destroy created resources with terraform destroy successfully though. Can someone have a look? Do we have duplicated command somewhere?

Hi @za ,
We tested the deployments there was no such duplication of resources or error. This may be caused by an alternate installation you may have run which could have left some stray resources.
These commands should delete the iam instance profile, but also make sure there are no IAM roles with names used in AWSGoat present in your account.

aws iam remove-role-from-instance-profile  --instance-profile-name AWS_GOAT_ec2_profile --role-name AWS_GOAT_ROLE
aws iam delete-instance-profile --instance-profile-name AWS_GOAT_ec2_profile

Also, please let us know if this solved your issue.

commented

Hi @SSKale1 thanks! It fixes my problem.

I wonder, where we can list created iam instance profiles from the aws web console? This is OOT, though.