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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ