AWS Control Tower - Member account Pre-enrollment Readiness Tool
This tool performs a read-only readiness assessment of an existing AWS member account before AWS Control Tower enrollment, checking IAM, logging, security services, networking, quotas, storage, and prior Control Tower artifacts. It generates console, text, and HTML reports that highlight blockers, warnings, and manual review items so teams can remediate issues before enrollment.
Purpose
<filename.py> is a read-only assessment script for checking whether an existing AWS member account is ready to be enrolled into AWS Control Tower.The script is intended to be run from inside the member account, usually from AWS CloudShell. It collects account, IAM, security, logging, networking, quota, cost, and prior-Control-Tower-artifact signals, then produces a console summary plus text and HTML reports.
Use this script before Control Tower enrollment to identify issues that could block enrollment, create duplicate controls, increase cost, or require manual cleanup.
What This Script Should Be Used For
Use this script when you need to:
- assess an existing AWS account before enrolling it into Control Tower
- identify leftover artifacts from a previous or failed Control Tower enrollment
- check whether required IAM, AWS Config, CloudTrail, Security Hub, GuardDuty, S3, KMS, and networking conditions look safe for enrollment
- create a handover report for a cloud platform, security, or migration team
- document
FAIL,WARN, andMANUALitems before proceeding with enrollment
- provide evidence to an AWS Support case if cleanup is required before re-enrollment
The script is especially useful for accounts that were created before Control Tower, accounts that may have been partially enrolled in the past, or accounts with existing security tooling that could conflict with Control Tower baselines.
What This Script Does Not Do
The script does not:
- enroll the account into Control Tower
- create, update, or delete AWS resources
- assume access to the Control Tower management account
- replace AWS Control Tower enrollment validation
- replace human review of commercial, support, contract, or governance items
- guarantee that enrollment will succeed
It is a readiness and evidence-gathering tool. Any remediation actions must be performed separately by the account owner, platform team, or AWS Support where required.
Where To Run It
Run the script from AWS CloudShell or another trusted workstation while authenticated into the member account being assessed.
Recommended location:
python3 <filename.py>Run against a specific primary region:
python3 <filename.py> --region <primary-region>Run against multiple regions:
python3 <filename.py> --regions <region-1> <region-2> <region-3>If
--regions is not provided, the script checks only the primary region. The script default primary region is the value configured in the script.Recommended Operating Workflow
- Sign in to the member account that you want to assess.
- Open AWS CloudShell in the region you normally use for administration.
- Run
aws sts get-caller-identityto confirm the account ID.
- Run the script with the correct region list.
- Review the console output for immediate
FAIL,WARN, andMANUALitems.
- Open the generated HTML report for the full assessment.
- Remediate blockers and rerun the script.
- Keep the text or HTML report as enrollment evidence.
- Proceed with Control Tower enrollment only after critical blockers are understood or resolved.
Output Files
The script creates two report files in the current working directory:
<report-prefix>_<account-id>_<timestamp>.txt
<report-prefix>_<account-id>_<timestamp>.htmlThe text report is useful for email, support tickets, and change records.
The HTML report is useful for handover because it includes a richer table view, status colors, summary counts, recommended actions, and status filtering.
In CloudShell, download the HTML report from:
Actions -> Download file -> <report-prefix>_<account-id>_<timestamp>.htmlResult Status Meaning
Status | Meaning | Typical action |
|---|---|---|
PASS | The check did not identify a readiness issue. | No action normally required. |
FAIL | The check found a likely blocker or high-risk condition. | Fix before enrollment or document an approved exception. |
WARN | The check found a risk, conflict, cost concern, or item requiring review. | Review before enrollment. Some warnings may be acceptable. |
MANUAL | The script cannot verify the item through available APIs. | Human review is required. |
INFO | Informational signal only. | Use for context and planning. |
SKIP | The check was skipped or not applicable. | Confirm if the skipped area matters for this account. |
Major Checks Performed
Account And Organization Readiness
The script checks caller identity and attempts to confirm whether the account is active in AWS Organizations. If the caller does not have permission to query Organizations from the member account, the script records a warning rather than failing the entire assessment.
This is expected in many environments because member accounts often cannot query organization-level metadata.
IAM And Control Tower Role Readiness
The script reviews IAM conditions that commonly affect Control Tower enrollment:
-
AWSControlTowerExecutionrole presence and trust policy
- existing organization access roles
- Control Tower baseline role artifacts
- IAM trust relationships
- root MFA status
- root access key presence
- IAM account password policy
- IAM user access key age
- IAM users without MFA
- permissions boundary compatibility
- service-linked roles
Important note: if
AWSControlTowerExecution already exists, the script checks whether the role trust looks appropriate. For Control Tower enrollment, the trust should align to the Control Tower management account model, not an unrelated service principal or wildcard trust.AWS Config Readiness
For each selected region, the script checks:
- AWS Config recorders
- delivery channels
- existing Config rules
- possible overlap with Control Tower guardrail rules
- estimated AWS Config configuration item cost impact
- leftover Control Tower baseline Config artifacts
This matters because Control Tower depends heavily on AWS Config. Existing recorders, delivery channels, or prior Control Tower artifacts can create enrollment problems or duplicate cost.
CloudTrail Readiness
For each selected region, the script inspects existing CloudTrail trails and captures:
- trail presence
- logging status
- multi-region setting
- organization trail setting
- S3 bucket target
- event selector information
- possible Control Tower baseline trail artifacts
This helps identify whether an account already has logging patterns that need to be preserved, adjusted, or compared against Control Tower baseline behavior.
Networking And Security Group Readiness
For each selected region, the script reviews:
- security groups with broad ingress exposure
- default VPC presence
- VPC Flow Logs
- EC2 IMDSv2 enforcement
These checks are not always direct enrollment blockers, but they help identify security and operational cleanup work before the account is brought under a governed landing zone.
CloudFormation And StackSet Conflicts
For each selected region, the script checks:
- Control Tower baseline stack artifacts
- CloudFormation stacks that may signal prior enrollment
- StackSet instance conflicts
This is important for re-enrollment scenarios. Leftover
AWSControlTowerBP-* artifacts or StackSet remnants can indicate a previous partial or failed enrollment that may need AWS Support cleanup.Security Services
The script checks GuardDuty and Security Hub status per selected region, including:
- GuardDuty detector presence
- GuardDuty administrator relationship
- Security Hub enablement
- Security Hub administrator relationship
- Security Hub Control Tower service-managed standard presence
These checks help determine whether the member account already participates in a delegated security administration model and whether that model aligns with the expected Control Tower security account design.
S3 And Encryption Controls
The script checks:
- account-level S3 Block Public Access
- bucket names that may conflict with Control Tower naming patterns
- S3 bucket encryption
- EBS encryption by default per selected region
- KMS key policy compatibility signals
These checks help identify storage and encryption posture concerns before enrollment.
Cost, Quota, And Commercial Signals
The script includes checks for:
- Service Quotas
- extended regional quotas
- Reserved Instances
- Savings Plans
- support plan visibility
- manual commercial checks for credits, EDP, and private pricing agreement considerations
- budgets and cost alerting
Some commercial checks are deliberately marked
MANUAL because they cannot be reliably validated from member-account service APIs.Backup And Operational Readiness
The script also checks:
- AWS Backup plans per selected region
- Trusted Advisor security checks where Support API access is available
- account contact completeness
- SNS, Lambda, and CloudWatch Logs naming conflicts that may overlap with Control Tower-created resources
Prior Control Tower Enrollment Diagnosis
One of the most useful parts of the script is its consolidated prior-enrollment diagnosis. It looks across multiple services for evidence that the account may have been enrolled, partially enrolled, or unsuccessfully unenrolled before.
Signals include:
- Control Tower baseline Config recorder or delivery channel
- Control Tower baseline CloudTrail
- Control Tower baseline CloudFormation stacks
- Control Tower IAM role artifacts
- Control Tower Security Hub service-managed standard
- Control Tower SNS, Lambda, or CloudWatch Logs naming patterns
If multiple signals are found, the report helps explain what was detected and why cleanup may be needed before another enrollment attempt.
Required Permissions
The script is read-only in intent, but it needs broad read access across several AWS services. At minimum, the execution role or user should be able to call APIs similar to the following:
Service area | Example permissions used |
|---|---|
Identity | sts:GetCallerIdentity |
IAM | iam:GetAccountSummary , iam:GetRole , iam:ListRoles , iam:GetAccountPasswordPolicy , iam:ListPolicies , iam:ListUsers , iam:ListAccessKeys |
Organizations | organizations:DescribeAccount |
AWS Config | config:DescribeConfigurationRecorders , config:DescribeDeliveryChannels , config:DescribeConfigRules , config:GetDiscoveredResourceCounts |
CloudTrail | cloudtrail:DescribeTrails , cloudtrail:GetTrailStatus , cloudtrail:GetEventSelectors |
EC2 | ec2:DescribeRegions , ec2:DescribeReservedInstances , ec2:DescribeVpcs , ec2:DescribeSecurityGroups , ec2:GetEbsEncryptionByDefault |
S3 | s3:ListAllMyBuckets |
S3 Control | s3control:GetPublicAccessBlock |
GuardDuty | guardduty:ListDetectors , guardduty:GetDetector , guardduty:GetAdministratorAccount |
Security Hub | securityhub:DescribeHub , securityhub:GetAdministratorAccount , securityhub:GetEnabledStandards |
CloudFormation | cloudformation:ListStacks |
Service Quotas | service-quotas:GetServiceQuota , service-quotas:GetAWSDefaultServiceQuota |
Lambda | lambda:ListFunctions |
SNS | sns:ListTopics |
CloudWatch Logs | logs:DescribeLogGroups |
KMS | kms:GetKeyPolicy |
Support | support:DescribeSeverityLevels |
Savings Plans | savingsplans:DescribeSavingsPlans |
Account | account:ListRegions , account:GetContactInformation |
Access denied responses do not always mean the account is misconfigured. In some cases, they mean the current role does not have enough read permissions for that check. The report should be interpreted with that distinction in mind.
Interpreting The Report
Start with the summary counts:
- address all
FAILitems first
- review all
WARNitems and decide whether they are acceptable
- complete each
MANUALitem with a human validation step
- use
INFOitems for context, not as blockers
The best practical enrollment posture is:
- no unresolved
FAILitems
- no unexplained prior-enrollment artifacts
- AWS Config and CloudTrail state understood in every governed region
- IAM execution role state understood
- root MFA enabled and root access keys removed
- no unmanaged service administrator relationship that conflicts with the target Control Tower design
- cost and quota impact understood before enrollment
Common Findings And What They Usually Mean
Finding type | What it usually means | What to do |
|---|---|---|
AWSControlTowerExecution role missing | Normal for accounts not yet enrolled. Control Tower can create it during enrollment. | No action unless your enrollment process requires pre-creation. |
AWSControlTowerExecution role has unexpected trust | Existing role may be wrong or unsafe for enrollment. | Review and correct the trust policy before enrollment. |
Control Tower baseline Config artifacts found | Account may have previous or partial Control Tower state. | Confirm enrollment history and consider AWS Support cleanup. |
Existing Config rules overlap with Control Tower controls | Enrollment may cause duplicate evaluations and additional cost. | Review whether existing rules should remain. |
GuardDuty or Security Hub has a different administrator account | Security delegation may not align with the target landing zone. | Confirm intended delegated administrator model. |
Root MFA disabled | Control Tower guardrails and security baseline will flag the account. | Enable root MFA before enrollment. |
Root access keys present | High-risk root credential condition. | Remove root access keys. |
S3 account Block Public Access disabled | Public exposure risk and likely governance concern. | Enable account-level S3 Block Public Access unless there is an approved exception. |
Large AWS Config resource count | Control Tower may increase Config cost. | Review recording scope and budget impact. |
Troubleshooting
The script cannot determine identity
Confirm the current session has valid AWS credentials:
aws sts get-caller-identityIf this fails, fix authentication before running the script.
Organizations checks return access denied
This can be normal from a member account. Validate organization membership and account status from the management account or delegated administration process.
Support or Trusted Advisor checks fail
The AWS Support API requires an appropriate support plan and permissions. If the API is unavailable, perform those checks manually.
Regional checks show errors
Confirm the selected region is enabled for the account. If the region is not in scope for Control Tower governance, exclude it from the
--regions list.The HTML report is not visible
The file is written to the current working directory. In CloudShell, use the CloudShell
Actions menu and download the generated .html file by name.Security And Data Handling
The generated reports can include account IDs, ARNs, bucket names, IAM role names, region lists, service configuration details, and security findings. Treat the reports as internal operational evidence.
Do not publish the reports externally without reviewing and redacting account-specific data.
Recommended Use Before Enrollment
For a production onboarding process, use this sequence:
- Run the script in the target member account.
- Save the HTML and text reports.
- Review all
FAIL,WARN, andMANUALitems with the platform and security teams.
- Fix IAM, Config, CloudTrail, and prior-Control-Tower-artifact issues first.
- Confirm service administrator relationships for GuardDuty and Security Hub.
- Confirm regions, quotas, budgets, support plan, and commercial constraints.
- Rerun the script.
- Attach the clean or accepted-risk report to the change record.
- Proceed with Control Tower enrollment.
Bottom Line
<filename.py> is a pre-enrollment readiness and evidence tool for existing AWS member accounts. It helps reduce surprises before Control Tower enrollment by surfacing blockers, conflicts, prior enrollment artifacts, security posture gaps, quota concerns, and manual review items in one place.It should be used as part of the account onboarding checklist, not as a replacement for Control Tower enrollment validation or AWS Support guidance when broken prior enrollment artifacts are found.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article