Skip to content

Conversation

YutaOkoshi
Copy link

@YutaOkoshi YutaOkoshi commented Sep 27, 2025

Summary

Adds ECS Service Linked Role (AWSServiceRoleForECS) to sandbox account resources to resolve ECS cluster creation failures

Screenshot from 2025-09-27 10-08-57

Changes

  • Add CfnServiceLinkedRole for ECS service in IsbSandboxAccountResources
  • Configure proper cleanup exclusion for IAMServiceLinkedRole in nuke-config.yaml
  • Add cfn-guard suppression using direct metadata approach

Problem Solved

Fixes "Unable to assume the service linked role" error when creating ECS clusters in sandbox accounts.

Testing

  • ✅ Build successful
  • ✅ Infrastructure tests pass
  • ✅ Snapshots updated

Ensures ECS clusters can be created in the sandbox account without permission issues by adding the ECS service-linked role to the Nuke configuration. This prevents Nuke from deleting the role and causing issues when creating ECS clusters.
Simplifies the creation of the ECS service-linked role by using `CfnServiceLinkedRole` instead of manually defining the role and its policies.

This change also removes unnecessary suppressions for cfn-guard, as the `CfnServiceLinkedRole` doesn't support `cfnOptions`.
The nuke config is also updated to reflect the changes.
@YutaOkoshi
Copy link
Author

Hi @aws-khargita !
I imagine many people test-run ECS clusters in Sandbox environments, so if you'd be so kind, I'd appreciate your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant