
Schedule AWS Transform continuous modernization analyses on AWS managed infrastructure
Use AWS managed mode in AWS Transform - continuous modernization to run weekly tech debt analyses without provisioning infrastructure stacks in your account. This step-by-step guide creates the required IAM execution role and sets up the analyses to run on your preferred schedule.
You can run recurring AWS Transform continuous modernization analyses on AWS Transform-managed infrastructure with no compute infrastructure to provision in your AWS account. This post will walk you through how to set up the required IAM execution role and schedule recurring analyses to run on
aws-managed infrastructure .Where continuous modernization runs
You can run analyses remotely in one of three modes (selected with the
--mode option in the atx ct CLI):Mode | What you provision | Supported work | Scheduling |
|---|---|---|---|
aws-managed (AWS Transform-managed infrastructure) | Nothing | Analyses only | Server-side schedule in AWS Transform. Requires an IAM execution role. |
ec2 (Amazon EC2) | A persistent Amazon EC2 instance, deployed as an AWS CloudFormation stack in private subnets | Analyses and remediations | Amazon EventBridge Scheduler schedule in your account |
batch (AWS Batch) | An AWS Batch (Fargate) stack in private subnets | Analyses and remediations | Amazon EventBridge Scheduler schedule in your account |
Choose
aws-managed when you need recurring analysis and want no compute stack to maintain. It does not support remediations or local sources, only analyses for remote sources. Choose ec2 or batch when you need remote remediations or want the compute in your own account. For provisioning steps, see Remote execution in the AWS Transform User Guide.How the execution role works
Each time a schedule runs, AWS Transform assumes the execution role. Assuming a role means AWS Transform receives temporary credentials with the role's permissions for the length of the session. AWS Transform uses those credentials to run the analysis and to retrieve the credentials it needs to clone your repositories.
The role has three components:
Component | Purpose | Value |
|---|---|---|
Trust policy | Defines which principal can assume the role | Service principal transform-custom.amazonaws.com |
AWS-managed policy | Grants AWS Transform custom permissions | AWSTransformCustomFullAccess |
Inline policy | Grants read access to source control credentials | secretsmanager:GetSecretValue and secretsmanager:DescribeSecret on atx/* secrets in AWS Secrets Manager |
The identity that creates the schedule also needs
iam:PassRole on this role (Step 6).Prerequisites
- An AWS identity that can create IAM roles and policies in the target account
- The AWS CLI, configured for that account
- The AWS Transform CLI (
atx)
- A source control source registered with continuous modernization
Walkthrough
Step 1: Set variables
ROLE_NAME="ATX-managed-execution-role-demo"REGION="us-east-1"ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"Step 2: Create the role with the AWS Transform trust policy
Save the trust policy and create the role:
cat > trust-policy.json <<'EOF'{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowAWSTransformCustom", "Effect": "Allow", "Principal": { "Service": "transform-custom.amazonaws.com" }, "Action": "sts:AssumeRole" } ]}EOF
aws iam create-role \ --role-name "$ROLE_NAME" \ --description "Execution role for AWS Transform-managed continuous modernization schedules." \ --assume-role-policy-document file://trust-policy.jsonIn the IAM console, the Trust relationships tab of the role lists one trusted entity,
transform-custom.amazonaws.com .
Figure 1: The trust policy allows only the AWS Transform custom service to assume the role.
Step 3: Attach the AWS-managed policy
aws iam attach-role-policy \ --role-name "$ROLE_NAME" \ --policy-arn arn:aws:iam::aws:policy/AWSTransformCustomFullAccessTo review the permissions this policy grants, open it in the IAM console. The summary view lists the allowed services, and the JSON view shows the
transform-custom:* action.
Figure 2: The summary view of
AWSTransformCustomFullAccess .
Figure 3: The JSON view of
AWSTransformCustomFullAccess .Step 4: Add the Secrets Manager inline policy
This policy allows
GetSecretValue and DescribeSecret on secrets whose names start with atx/ , in one account and one Region. The shell substitutes your values, so the example below needs no manual editing:cat > source-credentials-policy.json <<EOF{ "Version": "2012-10-17", "Statement": [ { "Sid": "AtxSourceCredentials", "Effect": "Allow", "Action": [ "secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret" ], "Resource": "arn:aws:secretsmanager:${REGION}:${ACCOUNT_ID}:secret:atx/*" } ]}EOF
aws iam put-role-policy \ --role-name "$ROLE_NAME" \ --policy-name AtxSourceCredentials \ --policy-document file://source-credentials-policy.json
Figure 4: The
AtxSourceCredentials inline policy in the IAM console.Step 5: Verify the role
Save the role ARN, then read back each component:
ROLE_ARN="$(aws iam get-role \ --role-name "$ROLE_NAME" \ --query 'Role.Arn' \ --output text)"
echo "$ROLE_ARN"
aws iam get-role \ --role-name "$ROLE_NAME" \ --query 'Role.{Arn:Arn,Description:Description,Trust:AssumeRolePolicyDocument}'
aws iam list-attached-role-policies --role-name "$ROLE_NAME"
aws iam get-role-policy \ --role-name "$ROLE_NAME" \ --policy-name AtxSourceCredentialsIn the IAM console, the Permissions tab lists one AWS-managed policy and one customer inline policy, and the permissions boundary is not set.

Figure 5: The completed role has one AWS-managed policy, one inline policy, and no permissions boundary.
Step 6: Grant iam:PassRole to the schedule creator
If the identity that runs
atx ct schedule create does not already have iam:PassRole , grant it on this role only, and only when the role is passed to AWS Transform:cat > pass-role-policy.json <<EOF{ "Version": "2012-10-17", "Statement": [ { "Sid": "PassAWSManagedTransformExecutionRole", "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::${ACCOUNT_ID}:role/${ROLE_NAME}", "Condition": { "StringEquals": { "iam:PassedToService": "transform-custom.amazonaws.com" } } } ]}EOFThe
iam:PassedToService condition limits the permission to passing the role to the AWS Transform custom service.Attach the policy to the IAM user or role that creates schedules. For an IAM role, replace
<CREATOR_ROLE_NAME> and run:aws iam put-role-policy \ --role-name <CREATOR_ROLE_NAME> \ --policy-name PassAtxExecutionRole \ --policy-document file://pass-role-policy.jsonDo not attach this policy to the execution role.
Step 7: Create the schedule
Pass the role ARN and set the mode to
aws-managed . Replace <SOURCE_NAME> with the name of your registered source:atx ct schedule create \ --name weekly-managed-analysis \ --mode aws-managed \ --execution-role "$ROLE_ARN" \ --type tech-debt-comprehensive \ --sources <SOURCE_NAME> \ --recurrence weekly:MONDAY \ --region "$REGION"Schedules on AWS Transform-managed infrastructure run in UTC. The
--recurrence value also accepts daily and monthly:<N> , where <N> is a day from 1 to 28.Step 8: Check the schedule and its runs
List schedules to get the schedule ID, then list the analyses that schedule has run, newest first:
atx ct schedule listatx ct analysis list --schedule-id <SCHEDULE_ID>To pause the schedule without deleting it, run
atx ct schedule disable <SCHEDULE_ID> .Clean up
Delete the schedule first. Get its ID from
atx ct schedule list :atx ct schedule listatx ct schedule delete <SCHEDULE_ID>Then delete the role. Run these commands only after no schedule uses it:
aws iam delete-role-policy \ --role-name "$ROLE_NAME" \ --policy-name AtxSourceCredentials
aws iam detach-role-policy \ --role-name "$ROLE_NAME" \ --policy-arn arn:aws:iam::aws:policy/AWSTransformCustomFullAccess
aws iam delete-role --role-name "$ROLE_NAME"Conclusion
With
--mode aws-managed , a recurring analysis needs an IAM role and one atx ct schedule create command. There is no CloudFormation stack to create or maintain in your account. AWS Transform runs each analysis on its own infrastructure and assumes the role only for the duration of the run.The trade-off is scope. This mode runs analyses only, so use
ec2 or batch if you also need remote remediations or local sources. For recurring analysis across your repositories, aws-managed is the lowest-effort option.Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article