View a markdown version of this page

Well-Architected optimization access model - AWS Well-Architected

Well-Architected optimization access model

Well-Architected optimization uses customer-managed IAM roles for cross-account resource discovery and service-linked roles for organization-wide onboarding. The customer-managed roles (through a pass-role and role-chaining model, described in this section) give you full control over the permissions that WA optimization has in your environment and support the cross-account access patterns required for multi-account infrastructure analysis. In addition, WA optimization uses two service-linked roles, the role and the role, which are created when you enable the organization integration for WA optimization. For details about these service-linked roles, see Using service-linked roles for AWS Well-Architected.

Three principals interact with WA optimization through IAM:

  • Admin users create and manage profiles, define scope and goals, configure cross-account access, and provide additional customer context. Admin users need permissions for profile management actions such as wellarchitected:CreateAgentProfile and wellarchitected:DeleteAgentProfile.

  • Regular users access generated recommendations, update recommendation lifecycle (mark as complete or suppress), and provide feedback. Regular users need permissions for actions such as wellarchitected:ListAgentRecommendations and wellarchitected:GetAgentRecommendation.

  • WA optimization as an AWS service accesses your AWS infrastructure (like accounts, resources, and applications) and understands context (like business goals) to generate recommendations. This access is implemented through a pass role mechanism where you create and manage your own IAM roles.

Execution roles

When you create a profile, you pass an execution role to WA optimization. The execution role is an IAM role in the same AWS account as the profile. WA optimization assumes this role to orchestrate resource discovery across your configured accounts. The execution role requires a trust policy allowing the wellarchitected.amazonaws.com service principal to assume it, and a permissions policy granting sts:AssumeRole on the access roles in your target accounts. WA optimization performs a pass role check during profile creation to validate that the caller has permission to pass the specified role to the service.

Cross-account access

WA optimization uses IAM role chaining to access resources across multiple accounts:

  1. Admin account (profile account): Contains the WA optimization profile and the execution role. WA optimization assumes the execution role in this account.

  2. Target accounts: Each target account contains an access role that the execution role can assume. The access role grants WA optimization read-only permissions to discover and analyze resources.

  3. Role chain: WA optimization assumes the execution role, which then assumes the access role in each target account.

Each access role requires:

  • A trust policy allowing the execution role to assume it.

  • The WellArchitectedAgentResourceScanning managed policy attached (recommended), or a custom policy scoped to only the actions you want WA optimization to perform.

Use the following trust policy template for your access roles:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::ProfileOwningAccountID:role/service-role/ExecutionRoleName" }, "Action": "sts:AssumeRole" } ] }

Replace ProfileOwningAccountID with the AWS account ID where your WA optimization profile is created, and ExecutionRoleName with the name of the execution role. When the WA optimization console creates the execution role, it places it under the service-role/ path. Confirm the exact ARN from your profile details page. Onboarding is opt-in per account. For details on setting up roles, see Getting started with Well-Architected optimization.

Confused deputy prevention

WA optimization uses the profile ARN as an external ID in the role assumption chain, preventing the execution role from being used outside the context of its configured profile. WA optimization also performs a pass role check during profile creation to validate that the calling principal has permission to pass the execution role to the service.

Revoking access

You retain full control over WA optimization's access at all times. Remove the trust policy from an access role, delete an access role entirely, or revoke active sessions to terminate in-progress data collection. If WA optimization encounters a permission denial during recommendation generation, the details appear in the generation records.

Best practices

Run WA optimization profiles from a dedicated AWS account without production workloads. Use the execution role ARN (not the root principal) in access role trust policies. Monitor AWS CloudTrail for WA optimization API activity. Periodically review access role permissions and remove accounts that no longer require analysis.