[aws-issue] cannot delete opsworks stack

0

Motivation

We want to cleanup some unused stacks in OpsWorks.

Steps to reproduce the issue

Problem

The IAM roles for the target stacks were somehow deleted. The missing IAM role is blocking the stack from being deleted.

Error: The IAM role for this stack is missing

We attempted to fix the issue by recreating the role, but the issue still persists.

Attempted Resolution

IAM

  1. Roles
  2. Create Role
  3. AWS service
  4. Select appropriate polices
  5. Name the role matching the missing one

OpsWorks

Verify role is bound to the stack

  1. select the target stack
  2. stack settings
  3. Advanced options
  4. click on the IAM role to verify it exists [PASSED]

Delete the stack

  1. Select delete stack
  2. Stop all instances [FAILED]

Error: The IAM role for this stack is missing

We also attempted to attach AdminAccess policy to the role to rule out permissions but issue still persists

3개 답변
0

Did you also add the trust policy to the role when you recreated it? If the role exists without the trust policy, the OpsWorks service will not be able to assume the role.

From: https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-servicerole.html

{
  "Version": "2008-10-17",
  "Statement": [
    {
      "Sid": "StsAssumeRole",
      "Effect": "Allow",
      "Principal": {
        "Service": "opsworks.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
AWS
답변함 2년 전
0

Sounds like the approach I would take... Curious to know if you have you tried this method? https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-stack-delete-failed/

답변함 2년 전
0

Update

So the instance profile was missing permissions, it wasn't the stack, though the error is still misleading

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠