[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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南