> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Devin for AWS Transform

> AWS Transform のモダナイゼーションジョブに Devin を追加し、変換後のコードをビルド・テストしてプルリクエストとして提供します

Devin for AWS Transform は、Devin をパートナーエージェントとして [AWS Transform](https://aws.amazon.com/transform/) に追加します。AWS Transform のジョブでは、Devin が変換の出力をあなたのリポジトリ上でビルド・テストし、プルリクエストとして提供します。さらに、Amazon ECS、Amazon EKS、Amazon EC2、AWS Lambda へデプロイするための CI/CD パイプラインと Infrastructure as Code も作成します。すべての承認は、あなたのチームが AWS Transform 上で行います。

> [!NOTE]
>
> このリスティングは、**外部の Devin ライセンスがあれば AWS Marketplace で無料**で利用できます。Devin の使用量はあなたの Devin サブスクリプションを通じて請求され、標準的な AWS インフラストラクチャ料金 (AgentCore Runtime、Secrets Manager、CloudWatch) が別途発生します。Devin サブスクリプションは [AWS Marketplace の Devin by Cognition](https://aws.amazon.com/marketplace/pp/prodview-yt3ntkdpdjdgm) から購入できます。

## 仕組み

この統合は 2 つの要素で構成されています。

* **コネクタ**は、**あなたのAWSアカウント**内の Amazon Bedrock AgentCore Runtime 上で実行するコンテナです。AWS Transform は、あなたが作成する IAM ロールを介してコネクタを呼び出します。コネクタは、ジョブのチャット、成果物、進捗状況の更新、レビュータスクを AWS Transform と Devin の間で中継します。
* **Devin** は、あなたの Devin サブスクリプションのもと、Cognition の環境で実行されます。Devin は既存のソース管理接続のみを通じてコミットし、変更はあなたが承認するプルリクエストとして提出されます。

AWS Transform ジョブ内での流れ:

1. **Devin: build, test, deploy** を選択し、モダナイゼーションの成果物と接続済みリポジトリを指定します。
2. ジョブのチャットで Devin とスコープを相談します。進捗はジョブの **Plan** と **Worklogs** に表示されます。
3. Devin が計画を提案し、判断が必要な事項を AWS Transform の**レビュータスク**としてあなたに送信します。未解決の質問はチャットで引き続き扱われます。
4. Devin は変換された成果物を別のベースラインブランチに適用し、ビルドとテストを行ったうえでプルリクエストを作成します。各プルリクエストは、あなたがレビュータスクで承認します。
5. あなたのチームは、自社の AWS IAM ロールを使用し、自社のレビュー済みパイプラインを通じてデプロイします。

## セキュリティモデル

* **長期間有効な AWS アクセスキーは不要。** 管理者の短期間有効な認証情報でインストールするか、キーレスの OIDC フェデレーションを使って Devin にインストールさせます。
* **ロールの分離。** インストール、ランタイム、AWS Transform はそれぞれ専用のロールを利用します。2 つのランタイムロールの権限は、最初にデプロイする権限境界 (permissions boundary) によって制限されます。
* **Devin APIキーは Secrets Manager に保管。** ランタイムは起動時にキーを読み込みます。キーがスタックパラメータ、チャット、ログ、git に現れることはありません。
* **リポジトリの制限。** Devin がプルリクエストを作成できるリポジトリを制限できます。
* **堅牢化されたイメージ。** コンテナにはシェルやパッケージマネージャーが含まれず、非 root ユーザーとして実行されます。また、リリース前にスキャンされ、SBOM 付きで提供されます。
* **アウトバウンド通信のみ。** ランタイムには Devin API および AWS エンドポイントへのアウトバウンド HTTPS 通信が必要です。AgentCore からの呼び出しを除き、インバウンドトラフィックは一切受け付けません。

## 前提条件

* `us-east-1` (現在サポートされている唯一のリージョン) で AWS Transform が有効になっている AWSアカウント。ランタイム、シークレット、ジョブはすべてこのアカウントで利用します。
* IAM ロールを作成する CloudFormation スタックをデプロイできる AWS 管理者。
* その管理者の認証情報で設定済みの AWS CLI v2。
* 対象のソースリポジトリが接続済みの Devin 組織。
* ランタイム用の Devin **サービスユーザー**と、**ViewOrgSessions**、**UseDevinSessions**、**ManageOrgSessions** の権限を持つその APIキー。あわせて、Devin の**組織ID**を控えておいてください。

## セットアップ

以下の手順では、AWS CLI を使用してコネクタをご自身でインストールします。ステップ 3〜6 を Devin に任せる場合は、[任意: Devin にインストールさせる](#optional-let-devin-install-it)を参照してください。

**1. AWS Marketplace でサブスクライブする**

AWS Marketplace で [**Devin for AWS Transform: Modernization Agent**](https://aws.amazon.com/marketplace/pp/prodview-rfmglejkakmb6) をサブスクライブします。フルフィルメントページでイメージ URI とイメージのリポジトリ ARN をコピーし、それぞれ `IMAGE_URI` と `MARKETPLACE_REPO_ARN` としてシェルに保存してください。これらは以下のコマンドで利用します。イメージ URI の末尾にあるタグが、後ほど AWS Transform で入力する**バージョン**になります。

**2. あなたのAWSアカウントを許可リストに追加する**

AWSアカウントを許可リストに登録するには、[お問い合わせ](https://devin.ai/contact)ください。その際、以下の情報をお知らせください。

* 12 桁のAWSアカウント ID
* 使用するリージョン (`us-east-1`)
* Devin 組織名

アカウントが許可リストに登録されたら、AWS Transform コンソールを開き、**Partner agents** に移動します。

![Partner agents が表示された AWS Transform コンソールのナビゲーション](https://mintcdn.com/cognitionai/Wx9ToiqzxbK6qll4/images/integrations/aws-transform/console-nav.png?fit=max\&auto=format\&n=Wx9ToiqzxbK6qll4\&q=85\&s=9864c0403b87b37b2c04ba4495c4eb50)

**devin-modernization** がステータス **Pending configuration** で表示されるようになります。ステップ 3〜6 でランタイムをデプロイして検証する間は、この状態のままにしておいてください。設定はステップ 7 で行います。

![devin-modernization が Pending configuration 状態で表示された Partner agents の一覧](https://mintcdn.com/cognitionai/Wx9ToiqzxbK6qll4/images/integrations/aws-transform/partner-agents-pending.png?fit=max\&auto=format\&n=Wx9ToiqzxbK6qll4\&q=85\&s=22f82da587672984f398aa6f95b6c349)

**3. Devin APIキーをSecrets Managerに保存する**

ランタイム用サービスユーザーのAPIキー (`cog_` で始まる値) を、`devin-atx/devin-api-key` という名前のプレーンテキストのシークレットとして保存します。

```bash theme={null}
export AWS_REGION=us-east-1
read -rs DEVIN_KEY   # キーを貼り付けて Enter を押す
aws secretsmanager create-secret --region "$AWS_REGION" --name devin-atx/devin-api-key --secret-string "$DEVIN_KEY"
unset DEVIN_KEY
```

Secrets Manager コンソールで作成することもできます。その場合は、**Other type of secret**、**Plaintext** の順に選択し、キーを貼り付けてください。

**4. 権限境界をデプロイする**

以下の[境界テンプレート](#permissions-boundary-template)を `boundary.yaml` として保存し、デプロイします。このテンプレートにより `devin-atx-boundary` ポリシーが作成されます。このポリシーは、どちらのランタイムロールについても実行可能な操作の上限を定めます。`MarketplaceImageRepository` パラメーターには、フルフィルメントページに記載されているリポジトリ ARN を指定します。この境界では、そのリポジトリからのイメージの pull のみが許可されます。

```bash theme={null}
aws cloudformation deploy --region "$AWS_REGION" \
  --stack-name devin-atx-boundary \
  --template-file boundary.yaml \
  --capabilities CAPABILITY_NAMED_IAM \
  --parameter-overrides MarketplaceImageRepository="$MARKETPLACE_REPO_ARN"
```

**5. ランタイムをデプロイ**

以下の[ランタイムテンプレート](#runtime-template)を `runtime.yaml` として保存します。続いて変更セットを作成し、内容をレビューしてから実行します。

```bash theme={null}
aws cloudformation deploy --region "$AWS_REGION" \
  --stack-name devin-atx-runtime \
  --template-file runtime.yaml \
  --capabilities CAPABILITY_NAMED_IAM \
  --no-execute-changeset \
  --parameter-overrides \
    ImageUri="$IMAGE_URI" \
    DevinOrgId="<devin-org-id>" \
    DevinTargetRepos="<owner/repo,owner/other-repo>"
# 表示された変更セットを確認してから、次を実行します:
aws cloudformation execute-change-set --region "$AWS_REGION" \
  --change-set-name <change-set-arn-from-output>
aws cloudformation wait stack-create-complete --region "$AWS_REGION" \
  --stack-name devin-atx-runtime
```

| パラメーター | 必須 | 値 |
| - | - | - |
| `ImageUri` | はい | Marketplace のフルフィルメントページに記載されている、バージョン付きのイメージ URI |
| `DevinOrgId` | はい | Devin 組織ID |
| `DevinTargetRepos` | 推奨 | Devin がプルリクエストを作成できるリポジトリ (`owner/repo`) のカンマ区切りリスト。空の場合は、接続済みのすべてのリポジトリが許可されます |
| `DevinPlaybookId` | いいえ | すべてのセッションにアタッチする Devin プレイブック |
| `DevinApiBaseUrl` | Enterprise のみ | Devin API のベース URL。空の場合は `https://api.devin.ai` が使用されます |
| `DevinWebUrl` | Enterprise のみ | Devin の Web アプリの URL (セッションのリンクに使用)。空の場合は `https://app.devin.ai` が使用されます |
| `DevinApiKeySecretName` | いいえ | デフォルトは `devin-atx/devin-api-key`。権限境界で許可されている唯一のプレフィックスである `devin-atx/` で始まる必要があります |
| `BoundaryPolicyName` | いいえ | デフォルトは `devin-atx-boundary` |

このスタックにより、AgentCore ランタイム `devin_atx_orchestrator`、その実行ロール `devin-atx-agentcore-execution`、および AWS Transform の呼び出しロール `devin-atx-transform-invoke` が作成されます。次の手順で必要な 2 つの ARN をスタックの出力から取得します。

```bash theme={null}
aws cloudformation describe-stacks --region "$AWS_REGION" \
  --stack-name devin-atx-runtime \
  --query "Stacks[0].Outputs[?OutputKey=='RuntimeArn' || OutputKey=='InvokeRoleArn']" \
  --output table
```

**6. ランタイムを確認する**

ランタイムのセルフチェックを呼び出します。セルフチェックでは Secrets Manager から Devin のキーを読み取り、read-only の Devin APIコールを 1 回実行します。

```bash theme={null}
aws bedrock-agentcore invoke-agent-runtime --region "$AWS_REGION" \
  --agent-runtime-arn "<RuntimeArn>" \
  --qualifier DEFAULT \
  --runtime-session-id "$(uuidgen | tr -d -)selfcheck" \
  --content-type application/json --accept application/json \
  --cli-binary-format raw-in-base64-out \
  --payload '{"jsonrpc":"2.0","id":"selfcheck","method":"devin_atx/selfcheck","params":{}}' \
  selfcheck.json
cat selfcheck.json
```

ランタイムが正常な場合は、`"ok": true` が返され、`"devinKey": "pass"` と `"devinApi": "pass"` が含まれます。いずれかが失敗した場合は、[トラブルシューティング](#troubleshooting)を参照してください。

**7. AWS Transformでパートナーエージェントを設定する**

**Partner agents** に戻り、**devin-modernization** (まだ **Pending configuration** の状態) を選択して **Configure** をクリックします。次の値を入力します。

* **Agent Version:** ステップ 1 で確認したバージョン
* **Runtime ARN:** スタックの `RuntimeArn` 出力
* **Role ARN:** スタックの `InvokeRoleArn` 出力

**Update** をクリックします。

![Agent Version、Runtime ARN、Role ARN を入力するエージェント設定フォーム](https://mintcdn.com/cognitionai/Wx9ToiqzxbK6qll4/images/integrations/aws-transform/configure-agent.png?fit=max\&auto=format\&n=Wx9ToiqzxbK6qll4\&q=85\&s=f17d37dd8feea30eeae6a5eff4d9121c)

ステータスが **Enabled** に変わります。

![devin-modernization が Enabled になっている Partner agents の一覧](https://mintcdn.com/cognitionai/Wx9ToiqzxbK6qll4/images/integrations/aws-transform/partner-agents-enabled.png?fit=max\&auto=format\&n=Wx9ToiqzxbK6qll4\&q=85\&s=6ea0e51a5da7625815e379e813e72f66)

![バージョン、ランタイム ARN、ロール ARN が表示された devin-modernization エージェントの詳細](https://mintcdn.com/cognitionai/Wx9ToiqzxbK6qll4/images/integrations/aws-transform/agent-details-enabled.png?fit=max\&auto=format\&n=Wx9ToiqzxbK6qll4\&q=85\&s=97d9b8deb589548f1af7fd5b0ca1f9c4)

**8. ジョブを開始**

AWS Transform ジョブを作成し、**Devin: build, test, deploy** を選択します。モダナイゼーションの成果物と接続済みのリポジトリを与えたうえで、ジョブのチャットでスコープについて相談します。計画と各プルリクエストは、ジョブのレビュータスクでレビューします。

## 更新とメンテナンス

* **新しいバージョン:** 新しい `ImageUri` でランタイムスタックを再デプロイし、セルフチェックを実行してから、**Configure** で新しい **Agent Version** を設定します。
* **キーのローテーション:** Secrets Manager コンソールでシークレットに新しいキーを貼り付けるか、`create-secret --name` の代わりに `put-secret-value --secret-id` を使用してステップ 3 のコマンドを実行します。その後、セルフチェックを再度実行します。
* **許可するリポジトリ:** `DevinTargetRepos` に新しい値を指定して、ランタイムスタックを再デプロイします。
* **アンインストール:** AWS Transform でパートナーエージェントの **Disable** を選択し、`devin-atx-runtime` スタック、境界スタック (Devin がインストーラーポリシースタックをインストールした場合はそのスタック)、およびシークレットを削除します。

## トラブルシューティング

| 症状 | 考えられる原因 |
| - | - |
| **devin-modernization** が Partner agents に表示されない | アカウントがまだ許可リストに登録されていないか、別のリージョンを利用しています。アカウント ID を添えて[お問い合わせください](https://devin.ai/contact)。 |
| スタックが `SupportedRegion` ルールで失敗する | サポート対象外のリージョンです。`us-east-1` を利用してください。 |
| ロールの作成時に権限境界エラーでスタックが失敗する | 先に境界スタックを同じアカウント・リージョンにデプロイしてください。 |
| ランタイムの起動またはイメージの取得に失敗する | Marketplace のサブスクリプションがアクティブでないか、`ImageUri` と `MarketplaceImageRepository` がフルフィルメントページに記載のイメージと一致していません。 |
| セルフチェック `devinKey` が失敗する | シークレットが存在しない、空である、もしくはプレーンテキストではありません。または `DevinApiKeySecretName` が一致していません。 |
| セルフチェック `devinKey` が KMS の `AccessDenied` エラーで失敗する | シークレットがカスタマー管理の KMS キーで暗号化されており、実行ロールにそのキーの復号権限がありません。AWS マネージドの Secrets Manager キーを利用してください。 |
| セルフチェック `devinApi` が 403 を返す | サービスユーザーのキーに **ViewOrgSessions** 権限がありません。 |
| セルフチェック `devinApi` が 404 または接続エラーを返す | エンタープライズホスト用の `DevinApiBaseUrl` が誤っているか、アウトバウンドの HTTPS 通信ができません。 |
| 以降の AWS Transform の呼び出しで `TerminalResourceException` が返される | ジョブの Devin セッションが終了しています。新しいジョブを開始してください。 |

ランタイムのログは CloudWatch の `/aws/bedrock-agentcore/runtimes/<runtime-id>-DEFAULT` に出力されます。Cognition へのお問い合わせの際は、AWS の RequestId と障害の発生時刻を添えてください。API キーや OIDC トークンは絶対に含めないでください。

## テンプレート

### 権限境界のテンプレート

> [accordion] boundary.yaml
>
> ```yaml theme={null}
> AWSTemplateFormatVersion: '2010-09-09'
> Description: Permissions boundary for the Devin for AWS Transform AgentCore execution and Transform invocation roles.
> Parameters:
>   MarketplaceImageRepository:
>     Type: String
>     AllowedPattern: 'arn:aws[a-z-]*:ecr:[a-z0-9-]+:[0-9]{12}:repository/.+'
>     Description: ECR repository ARN of the image on your AWS Marketplace fulfillment page.
>   ResourcePrefix:
>     Type: String
>     Default: devin-atx
>     AllowedPattern: '[a-z][a-z0-9-]{2,20}'
>     Description: Prefix for every stack, role, repository and secret Devin manages.
>   RuntimeName:
>     Type: String
>     Default: devin_atx_orchestrator
>     AllowedPattern: '[a-zA-Z][a-zA-Z0-9_]{0,47}'
>     Description: AgentRuntimeName of the orchestrator in runtime.yaml.
> Resources:
>   RoleBoundary:
>     Type: AWS::IAM::ManagedPolicy
>     Metadata:
>       cfn-lint:
>         config:
>           ignore_checks: [W3037]  # transform-agents/transform-registry は、まだ公開された IAM プレフィックスではありません
>     Properties:
>       ManagedPolicyName: !Sub ${ResourcePrefix}-boundary
>       Description: Maximum permissions for the AgentCore execution and Transform invocation roles Devin creates.
>       PolicyDocument:
>         Version: '2012-10-17'
>         Statement:
>           - Sid: EcrPull
>             Effect: Allow
>             Action: [ecr:BatchGetImage, ecr:GetDownloadUrlForLayer]
>             Resource:
>               - !Sub arn:${AWS::Partition}:ecr:${AWS::Region}:${AWS::AccountId}:repository/${ResourcePrefix}/*
>               - !Ref MarketplaceImageRepository
>           - Sid: EcrToken
>             Effect: Allow
>             Action: ecr:GetAuthorizationToken
>             Resource: '*'
>           - Sid: RuntimeLogs
>             Effect: Allow
>             Action: [logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEvents, logs:DescribeLogStreams]
>             Resource:
>               - !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/bedrock-agentcore/runtimes/*
>               - !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/bedrock-agentcore/runtimes/*:log-stream:*
>           - Sid: DescribeLogGroups
>             Effect: Allow
>             Action: logs:DescribeLogGroups
>             Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:*
>           - Sid: Tracing
>             Effect: Allow
>             Action: [xray:PutTraceSegments, xray:PutTelemetryRecords, xray:GetSamplingRules, xray:GetSamplingTargets]
>             Resource: '*'
>           - Sid: Metrics
>             Effect: Allow
>             Action: cloudwatch:PutMetricData
>             Resource: '*'
>             Condition:
>               StringEquals:
>                 cloudwatch:namespace: bedrock-agentcore
>           - Sid: GetAgentAccessToken
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:GetWorkloadAccessToken
>               - bedrock-agentcore:GetWorkloadAccessTokenForJWT
>               - bedrock-agentcore:GetWorkloadAccessTokenForUserId
>             Resource:
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default/workload-identity/*
>           - Sid: OrchestratorRuntime
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:InvokeAgentRuntime
>               - bedrock-agentcore:GetAgentRuntime
>               - bedrock-agentcore:GetAgentRuntimeEndpoint
>               - bedrock-agentcore:StopRuntimeSession
>             Resource:
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:runtime/${RuntimeName}-*
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:runtime/${RuntimeName}-*/runtime-endpoint/*
>           - Sid: AgentCoreRuntimeDiscovery
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:ListAgentRuntimeEndpoints
>               - bedrock-agentcore:ListAgentRuntimeVersions
>               - bedrock-agentcore:ListAgentRuntimes
>             Resource: '*'
>           - Sid: DevinKey
>             Effect: Allow
>             Action: secretsmanager:GetSecretValue
>             Resource: !Sub arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:${ResourcePrefix}/*
>           - Sid: TransformApis
>             Effect: Allow
>             Action:
>               - transform-agents:ListJobPlanSteps
>               - transform-agents:PutJobPlan
>               - transform-agents:UpdateJobPlanStep
>               - transform-agents:CreateWorklog
>               - transform-agents:SendMessage
>               - transform-agents:ListArtifacts
>               - transform-agents:CreateArtifactUploadUrl
>               - transform-agents:GetArtifactMetadata
>               - transform-agents:CompleteArtifactUpload
>               - transform-agents:CreateArtifactDownloadUrl
>               - transform-agents:GetJob
>               - transform-agents:UpdateJobStatus
>               - transform-agents:CreateHitlTask
>               - transform-agents:StartHitlTask
>               - transform-agents:GetHitlTask
>               - transform-agents:CloseHitlTask
>               - transform-agents:GetAgentInstance
>               - transform-agents:UpdateAgentInstance
>               - transform-agents:RefreshAuthToken
>             Resource: '*'
> Outputs:
>   BoundaryPolicyArn:
>     Value: !Ref RoleBoundary
> ```

### ランタイムテンプレート

> [accordion] runtime.yaml
>
> ```yaml theme={null}
> AWSTemplateFormatVersion: '2010-09-09'
> Description: AgentCore runtime and AWS Transform invocation roles for the Devin orchestrator.
> Parameters:
>   ResourcePrefix:
>     Type: String
>     Default: devin-atx
>   ImageUri:
>     Type: String
>     Description: Versioned image URI from your AWS Marketplace fulfillment page.
>   DevinOrgId:
>     Type: String
>   DevinTargetRepos:
>     Type: String
>     Default: ''
>   DevinPlaybookId:
>     Type: String
>     Default: ''
>   DevinApiBaseUrl:
>     Type: String
>     Default: ''
>   DevinWebUrl:
>     Type: String
>     Default: ''
>   DevinApiKeySecretName:
>     Type: String
>     Default: devin-atx/devin-api-key
>   BoundaryPolicyName:
>     Type: String
>     Default: devin-atx-boundary
> Mappings:
>   TransformRegions:
>     us-east-1:
>       ServicePrincipal: prod.us-east-1.compute.elastic-gumby.aws.internal
> Rules:
>   SupportedRegion:
>     Assertions:
>       - Assert:
>           Fn::Contains:
>             - [us-east-1]
>             - !Ref AWS::Region
>         AssertDescription: Choose a supported region listed in Mappings.TransformRegions.
> Resources:
>   AgentCoreExecutionRole:
>     Type: AWS::IAM::Role
>     Metadata:
>       cfn-lint:
>         config:
>           ignore_checks: [W3037] # transform-agents はまだ公開されている IAM プレフィックスではありません
>     Properties:
>       RoleName: !Sub ${ResourcePrefix}-agentcore-execution
>       PermissionsBoundary: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${BoundaryPolicyName}
>       AssumeRolePolicyDocument:
>         Version: '2012-10-17'
>         Statement:
>           - Effect: Allow
>             Principal:
>               Service: bedrock-agentcore.amazonaws.com
>             Action: sts:AssumeRole
>             Condition:
>               StringEquals:
>                 aws:SourceAccount: !Ref AWS::AccountId
>       Policies:
>         - PolicyName: AgentCoreExecutionPolicy
>           PolicyDocument:
>             Version: '2012-10-17'
>             Statement:
>               - Sid: ECRImageAccess
>                 Effect: Allow
>                 Action: [ecr:BatchGetImage, ecr:GetDownloadUrlForLayer]
>                 Resource: !Sub arn:${AWS::Partition}:ecr:${AWS::Region}:${AWS::AccountId}:repository/${ResourcePrefix}/*
>               - Sid: MarketplaceImageAccess
>                 Effect: Allow
>                 Action: [ecr:BatchGetImage, ecr:GetDownloadUrlForLayer]
>                 Resource: !Sub
>                   - arn:${AWS::Partition}:ecr:${ImageRegion}:${ImageAccount}:repository/${ImageRepository}
>                   - ImageAccount: !Select [0, !Split ['.', !Select [0, !Split ['/', !Ref ImageUri]]]]
>                     ImageRegion: !Select [3, !Split ['.', !Select [0, !Split ['/', !Ref ImageUri]]]]
>                     ImageRepository: !Select [0, !Split [':', !Select [0, !Split ['@', !Select [1, !Split ['.amazonaws.com/', !Ref ImageUri]]]]]]
>               - Sid: RuntimeLogs
>                 Effect: Allow
>                 Action: [logs:DescribeLogStreams, logs:CreateLogGroup]
>                 Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/bedrock-agentcore/runtimes/*
>               - Sid: DescribeLogGroups
>                 Effect: Allow
>                 Action: logs:DescribeLogGroups
>                 Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:*
>               - Sid: WriteRuntimeLogs
>                 Effect: Allow
>                 Action: [logs:CreateLogStream, logs:PutLogEvents]
>                 Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/bedrock-agentcore/runtimes/*:log-stream:*
>               - Sid: ECRTokenAccess
>                 Effect: Allow
>                 Action: ecr:GetAuthorizationToken
>                 Resource: '*'
>               - Sid: Tracing
>                 Effect: Allow
>                 Action:
>                   - xray:PutTraceSegments
>                   - xray:PutTelemetryRecords
>                   - xray:GetSamplingRules
>                   - xray:GetSamplingTargets
>                 Resource: '*'
>               - Sid: RuntimeMetrics
>                 Effect: Allow
>                 Action: cloudwatch:PutMetricData
>                 Resource: '*'
>                 Condition:
>                   StringEquals:
>                     cloudwatch:namespace: bedrock-agentcore
>               - Sid: GetAgentAccessToken
>                 Effect: Allow
>                 Action:
>                   - bedrock-agentcore:GetWorkloadAccessToken
>                   - bedrock-agentcore:GetWorkloadAccessTokenForJWT
>                   - bedrock-agentcore:GetWorkloadAccessTokenForUserId
>                 Resource:
>                   - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default
>                   - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default/workload-identity/*
>               - Sid: DevinKey
>                 Effect: Allow
>                 Action: secretsmanager:GetSecretValue
>                 Resource: !Sub arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:${DevinApiKeySecretName}-*
>               - Sid: TransformAgentsApiPolicy
>                 Effect: Allow
>                 Action: transform-agents:*
>                 Resource: '*'
>   AgentCoreRuntime:
>     Type: AWS::BedrockAgentCore::Runtime
>     Properties:
>       AgentRuntimeName: devin_atx_orchestrator
>       AgentRuntimeArtifact:
>         ContainerConfiguration:
>           ContainerUri: !Ref ImageUri
>       RoleArn: !GetAtt AgentCoreExecutionRole.Arn
>       NetworkConfiguration:
>         NetworkMode: PUBLIC
>       ProtocolConfiguration: HTTP
>       EnvironmentVariables:
>         STAGE: prod
>         REGION: !Ref AWS::Region
>         DEVIN_ORG_ID: !Ref DevinOrgId
>         DEVIN_API_KEY_SECRET_ID: !Ref DevinApiKeySecretName
>         DEVIN_TARGET_REPOS: !Ref DevinTargetRepos
>         DEVIN_PLAYBOOK_ID: !Ref DevinPlaybookId
>         DEVIN_API_BASE_URL: !Ref DevinApiBaseUrl
>         DEVIN_WEB_URL: !Ref DevinWebUrl
>         USE_EXTERNAL_AGENTIC_API: 'true'
>   TransformInvokeRole:
>     Type: AWS::IAM::Role
>     Properties:
>       RoleName: !Sub ${ResourcePrefix}-transform-invoke
>       PermissionsBoundary: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${BoundaryPolicyName}
>       AssumeRolePolicyDocument:
>         Version: '2012-10-17'
>         Statement:
>           - Effect: Allow
>             Principal:
>               Service: !FindInMap [TransformRegions, !Ref AWS::Region, ServicePrincipal]
>             Action: sts:AssumeRole
>       Policies:
>         - PolicyName: AWSTransform-BedrockAgentRuntimePolicy
>           PolicyDocument:
>             Version: '2012-10-17'
>             Statement:
>               - Sid: AWSTransformAgentCoreRuntimePermissions
>                 Effect: Allow
>                 Action:
>                   - bedrock-agentcore:GetAgentRuntime
>                   - bedrock-agentcore:GetAgentRuntimeEndpoint
>                   - bedrock-agentcore:InvokeAgentRuntime
>                   - bedrock-agentcore:ListAgentRuntimeEndpoints
>                   - bedrock-agentcore:ListAgentRuntimeVersions
>                   - bedrock-agentcore:ListAgentRuntimes
>                   - bedrock-agentcore:StopRuntimeSession
>                 Resource:
>                   - !GetAtt AgentCoreRuntime.AgentRuntimeArn
>                   - !Sub ${AgentCoreRuntime.AgentRuntimeArn}/*
> Outputs:
>   RuntimeArn:
>     Value: !GetAtt AgentCoreRuntime.AgentRuntimeArn
>   ExecutionRoleArn:
>     Value: !GetAtt AgentCoreExecutionRole.Arn
>   InvokeRoleArn:
>     Value: !GetAtt TransformInvokeRole.Arn
> ```

## 任意: Devin にインストールさせる

Devin セッションにインストールを代行させることもできます。その場合、Devin はすべての変更セットを提示し、あなたの承認を待ってから処理を進めます。この方式ではキーレスの OIDC フェデレーションを利用します。AWS はあなたの Devin 組織からのトークンを信頼しますが、対象となるのは専用のインストーラー用サービスユーザー1つのみです。

1. インストール用に2つ目の Devin サービスユーザーを作成します (ランタイム用のサービスユーザーとは別にします) 。その `service-user-…` ID を控えておきます。
2. あなたの `DevinOrgId`、インストーラー用の `DevinDeployServiceUserId`、`DevinIssuerHost` (`app.devin.ai`、または エンタープライズホスト) を指定して、[OIDC 信頼テンプレート](#oidc-trust-template)をデプロイします。これにより、権限を持たない `devin-aws-transform-agent` ロールが作成されます。
3. 境界のテンプレートの**代わりに**[インストーラーポリシーテンプレート](#installer-policy-template)をデプロイします。ステップ 4 と同じ `MarketplaceImageRepository` を渡してください。これにより、同じ `devin-atx-boundary` に加えて、そのロールにアタッチされた、スコープが限定された2つのインストーラーポリシーが作成されます。
4. インストーラー用サービスユーザーとして開始したセッションで、あなたの AWSアカウントとリージョンに Devin for AWS Transform をセットアップするよう Devin に依頼し、フルフィルメントページに記載されているイメージ URI とリポジトリ ARN を伝えます。なお、許可リストへの登録のリクエストとパートナーエージェントの設定は、引き続きご自身で行う必要があります。

### OIDC 信頼テンプレート

> [accordion] devin-oidc.yaml
>
> ```yaml theme={null}
> AWSTemplateFormatVersion: '2010-09-09'
> Description: Keyless Devin access for an AWS Transform account; no deployment permissions granted.
> Parameters:
>   DevinOrgId:
>     Type: String
>     AllowedPattern: '[A-Za-z0-9-]+'
>     Description: Exact org_id claim from a Devin token, not the account or enterprise ID.
>   DevinDeployServiceUserId:
>     Type: String
>     AllowedPattern: 'service-user-[A-Za-z0-9]+'
>     Description: service_user_id claim of the dedicated Devin service user allowed to deploy; sessions must request the token with subject-keys "org_id service_user_id"; sessions started by humans or other service users do not match.
>   DevinIssuerHost:
>     Type: String
>     AllowedPattern: '[a-z0-9.-]+'
>     Description: "Devin webapp host that issues the OIDC token: app.devin.ai or your enterprise host."
>   RoleName:
>     Type: String
>     Default: devin-aws-transform-agent
>     AllowedPattern: '[A-Za-z0-9+=,.@_-]+'
>     MaxLength: 64
>   CreateOidcProvider:
>     Type: String
>     Default: 'true'
>     AllowedValues: ['true', 'false']
>     Description: Set false if this account already has a provider for the configured issuer with the STS audience.
> Conditions:
>   CreateProvider: !Equals [!Ref CreateOidcProvider, 'true']
> Resources:
>   DevinOidcProvider:
>     Type: AWS::IAM::OIDCProvider
>     Condition: CreateProvider
>     Properties:
>       Url: !Sub https://${DevinIssuerHost}
>       ClientIdList: [sts.amazonaws.com]
>       Tags:
>         - Key: Project
>           Value: devin-aws-transform-agent
>   DevinRole:
>     Type: AWS::IAM::Role
>     Properties:
>       RoleName: !Ref RoleName
>       Description: Devin OIDC role trusted only to the configured org_id and service_user_id; an administrator must separately attach reviewed deployment permissions.
>       MaxSessionDuration: 3600
>       AssumeRolePolicyDocument: !Sub
>         - |
>           {
>             "Version": "2012-10-17",
>             "Statement": [
>               {
>                 "Effect": "Allow",
>                 "Principal": {
>                   "Federated": "${ProviderArn}"
>                 },
>                 "Action": "sts:AssumeRoleWithWebIdentity",
>                 "Condition": {
>                   "StringEquals": {
>                     "${DevinIssuerHost}:aud": "sts.amazonaws.com",
>                     "${DevinIssuerHost}:sub": "org_id:${DevinOrgId}:service_user_id:${DevinDeployServiceUserId}"
>                   }
>                 }
>               }
>             ]
>           }
>         - ProviderArn: !If
>             - CreateProvider
>             - !Ref DevinOidcProvider
>             - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:oidc-provider/${DevinIssuerHost}
>       Tags:
>         - Key: Project
>           Value: devin-aws-transform-agent
> Outputs:
>   DevinRoleArn:
>     Value: !GetAtt DevinRole.Arn
>   OidcProviderArn:
>     Value: !If
>       - CreateProvider
>       - !Ref DevinOidcProvider
>       - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:oidc-provider/${DevinIssuerHost}
> ```

### インストーラー用ポリシーテンプレート

> [accordion] devin-deploy-policy.yaml
>
> ```yaml theme={null}
> AWSTemplateFormatVersion: '2010-09-09'
> Description: >-
>   Installer permissions for the Devin OIDC role.
>   Scoped to the named orchestrator runtime, two bounded roles, devin-atx-* resources, and
>   selected AWS Transform registry and API actions. An administrator deploys this once,
>   after reviewing it.
> Parameters:
>   MarketplaceImageRepository:
>     Type: String
>     AllowedPattern: 'arn:aws[a-z-]*:ecr:[a-z0-9-]+:[0-9]{12}:repository/.+'
>     Description: ECR repository ARN of the image on your AWS Marketplace fulfillment page.
>   DevinRoleName:
>     Type: String
>     Default: devin-aws-transform-agent
>     AllowedPattern: '[A-Za-z0-9+=,.@_-]+'
>     Description: Name of the role created by devin-oidc.yaml.
>   ResourcePrefix:
>     Type: String
>     Default: devin-atx
>     AllowedPattern: '[a-z][a-z0-9-]{2,20}'
>     Description: Prefix for every stack, role, repository and secret Devin manages.
>   RuntimeName:
>     Type: String
>     Default: devin_atx_orchestrator
>     AllowedPattern: '[a-zA-Z][a-zA-Z0-9_]{0,47}'
>     Description: AgentRuntimeName of the orchestrator in runtime.yaml.
> Resources:
>   RoleBoundary:
>     Type: AWS::IAM::ManagedPolicy
>     Metadata:
>       cfn-lint:
>         config:
>           ignore_checks: [W3037]  # transform-agents/transform-registry は、まだ IAM の公開プレフィックスではありません
>     Properties:
>       ManagedPolicyName: !Sub ${ResourcePrefix}-boundary
>       Description: Maximum permissions for the AgentCore execution and Transform invocation roles Devin creates.
>       PolicyDocument:
>         Version: '2012-10-17'
>         Statement:
>           - Sid: EcrPull
>             Effect: Allow
>             Action: [ecr:BatchGetImage, ecr:GetDownloadUrlForLayer]
>             Resource:
>               - !Sub arn:${AWS::Partition}:ecr:${AWS::Region}:${AWS::AccountId}:repository/${ResourcePrefix}/*
>               - !Ref MarketplaceImageRepository
>           - Sid: EcrToken
>             Effect: Allow
>             Action: ecr:GetAuthorizationToken
>             Resource: '*'
>           - Sid: RuntimeLogs
>             Effect: Allow
>             Action: [logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEvents, logs:DescribeLogStreams]
>             Resource:
>               - !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/bedrock-agentcore/runtimes/*
>               - !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/bedrock-agentcore/runtimes/*:log-stream:*
>           - Sid: DescribeLogGroups
>             Effect: Allow
>             Action: logs:DescribeLogGroups
>             Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:*
>           - Sid: Tracing
>             Effect: Allow
>             Action: [xray:PutTraceSegments, xray:PutTelemetryRecords, xray:GetSamplingRules, xray:GetSamplingTargets]
>             Resource: '*'
>           - Sid: Metrics
>             Effect: Allow
>             Action: cloudwatch:PutMetricData
>             Resource: '*'
>             Condition:
>               StringEquals:
>                 cloudwatch:namespace: bedrock-agentcore
>           - Sid: GetAgentAccessToken
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:GetWorkloadAccessToken
>               - bedrock-agentcore:GetWorkloadAccessTokenForJWT
>               - bedrock-agentcore:GetWorkloadAccessTokenForUserId
>             Resource:
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default/workload-identity/*
>           - Sid: OrchestratorRuntime
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:InvokeAgentRuntime
>               - bedrock-agentcore:GetAgentRuntime
>               - bedrock-agentcore:GetAgentRuntimeEndpoint
>               - bedrock-agentcore:StopRuntimeSession
>             Resource:
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:runtime/${RuntimeName}-*
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:runtime/${RuntimeName}-*/runtime-endpoint/*
>           - Sid: AgentCoreRuntimeDiscovery
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:ListAgentRuntimeEndpoints
>               - bedrock-agentcore:ListAgentRuntimeVersions
>               - bedrock-agentcore:ListAgentRuntimes
>             Resource: '*'
>           - Sid: DevinKey
>             Effect: Allow
>             Action: secretsmanager:GetSecretValue
>             Resource: !Sub arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:${ResourcePrefix}/*
>           - Sid: TransformApis
>             Effect: Allow
>             Action:
>               - transform-agents:ListJobPlanSteps
>               - transform-agents:PutJobPlan
>               - transform-agents:UpdateJobPlanStep
>               - transform-agents:CreateWorklog
>               - transform-agents:SendMessage
>               - transform-agents:ListArtifacts
>               - transform-agents:CreateArtifactUploadUrl
>               - transform-agents:GetArtifactMetadata
>               - transform-agents:CompleteArtifactUpload
>               - transform-agents:CreateArtifactDownloadUrl
>               - transform-agents:GetJob
>               - transform-agents:UpdateJobStatus
>               - transform-agents:CreateHitlTask
>               - transform-agents:StartHitlTask
>               - transform-agents:GetHitlTask
>               - transform-agents:CloseHitlTask
>               - transform-agents:GetAgentInstance
>               - transform-agents:UpdateAgentInstance
>               - transform-agents:RefreshAuthToken
>             Resource: '*'
>   DeployPolicy:
>     Type: AWS::IAM::ManagedPolicy
>     Metadata:
>       cfn-lint:
>         config:
>           ignore_checks: [W3037]  # transform-agents/transform-registry は、まだ IAM の公開プレフィックスではありません
>     Properties:
>       ManagedPolicyName: !Sub ${ResourcePrefix}-devin-deploy
>       Description: Lets Devin build, deploy, register and debug the AWS Transform orchestrator.
>       Roles: [!Ref DevinRoleName]
>       PolicyDocument:
>         Version: '2012-10-17'
>         Statement:
>           - Sid: CloudFormationStacks
>             Effect: Allow
>             Action:
>               - cloudformation:CreateStack
>               - cloudformation:UpdateStack
>               - cloudformation:DeleteStack
>               - cloudformation:CreateChangeSet
>               - cloudformation:DescribeChangeSet
>               - cloudformation:ExecuteChangeSet
>               - cloudformation:DeleteChangeSet
>               - cloudformation:ListChangeSets
>               - cloudformation:DescribeStacks
>               - cloudformation:DescribeStackEvents
>               - cloudformation:DescribeStackResources
>               - cloudformation:GetTemplate
>             Resource: !Sub arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/${ResourcePrefix}-*/*
>           - Sid: CloudFormationRead
>             Effect: Allow
>             Action: [cloudformation:ListStacks, cloudformation:ValidateTemplate, cloudformation:GetTemplateSummary]
>             Resource: '*'
>           - Sid: EcrToken
>             Effect: Allow
>             Action: ecr:GetAuthorizationToken
>             Resource: '*'
>           - Sid: EcrRepositories
>             Effect: Allow
>             Action:
>               - ecr:CreateRepository
>               - ecr:DeleteRepository
>               - ecr:DescribeRepositories
>               - ecr:DescribeImages
>               - ecr:ListImages
>               - ecr:BatchGetImage
>               - ecr:BatchCheckLayerAvailability
>               - ecr:GetDownloadUrlForLayer
>               - ecr:InitiateLayerUpload
>               - ecr:UploadLayerPart
>               - ecr:CompleteLayerUpload
>               - ecr:PutImage
>               - ecr:BatchDeleteImage
>               - ecr:PutLifecyclePolicy
>               - ecr:PutImageScanningConfiguration
>               - ecr:TagResource
>               - ecr:UntagResource
>               - ecr:ListTagsForResource
>             Resource: !Sub arn:${AWS::Partition}:ecr:${AWS::Region}:${AWS::AccountId}:repository/${ResourcePrefix}/*
>           - Sid: CreateBoundedRoles
>             Effect: Allow
>             Action: [iam:CreateRole, iam:PutRolePolicy, iam:AttachRolePolicy, iam:DetachRolePolicy]
>             Resource:
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ResourcePrefix}-agentcore-execution
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ResourcePrefix}-transform-invoke
>             Condition:
>               StringEquals:
>                 iam:PermissionsBoundary: !Ref RoleBoundary
>           - Sid: ManageOwnRoles
>             Effect: Allow
>             Action:
>               - iam:GetRole
>               - iam:GetRolePolicy
>               - iam:ListRolePolicies
>               - iam:ListAttachedRolePolicies
>               - iam:DeleteRole
>               - iam:DeleteRolePolicy
>               - iam:UpdateRole
>               - iam:TagRole
>               - iam:UntagRole
>             Resource:
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ResourcePrefix}-agentcore-execution
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ResourcePrefix}-transform-invoke
>           - Sid: PassExecutionRoleToAgentCore
>             Effect: Allow
>             Action: iam:PassRole
>             Resource: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ResourcePrefix}-agentcore-execution
>             Condition:
>               StringEquals:
>                 iam:PassedToService: bedrock-agentcore.amazonaws.com
>           - Sid: ReadPolicies
>             Effect: Allow
>             Action: [iam:GetPolicy, iam:GetPolicyVersion, iam:SimulatePrincipalPolicy]
>             Resource:
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${ResourcePrefix}-*
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${ResourcePrefix}-*
>           - Sid: DevinKeySecret
>             Effect: Allow
>             Action:
>               - secretsmanager:CreateSecret
>               - secretsmanager:DeleteSecret
>               - secretsmanager:DescribeSecret
>               - secretsmanager:PutSecretValue
>               - secretsmanager:UpdateSecret
>               - secretsmanager:TagResource
>               - secretsmanager:UntagResource
>             Resource: !Sub arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:${ResourcePrefix}/*
>           - Sid: RuntimeLogsRead
>             Effect: Allow
>             Action: [logs:DescribeLogStreams, logs:GetLogEvents, logs:FilterLogEvents, logs:StartQuery]
>             Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/bedrock-agentcore/*
>           - Sid: LogsDiscovery
>             Effect: Allow
>             Action: [logs:DescribeLogGroups, logs:GetQueryResults]
>             Resource: '*'
>           - Sid: NoBoundaryOrTrustChanges
>             Effect: Deny
>             Action:
>               - iam:DeleteRolePermissionsBoundary
>               - iam:PutRolePermissionsBoundary
>               - iam:UpdateAssumeRolePolicy
>             Resource: '*'
>           - Sid: NoPolicyTampering
>             Effect: Deny
>             Action:
>               - iam:CreatePolicyVersion
>               - iam:DeletePolicy
>               - iam:DeletePolicyVersion
>               - iam:SetDefaultPolicyVersion
>             Resource:
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${ResourcePrefix}-boundary
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${ResourcePrefix}-devin-deploy
>               - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${ResourcePrefix}-devin-deploy-agentcore
>   DeployPolicyAgentCore:
>     Type: AWS::IAM::ManagedPolicy
>     Metadata:
>       cfn-lint:
>         config:
>           ignore_checks: [W3037]  # transform-agents/transform-registry は、まだ IAM の公開プレフィックスではありません
>     Properties:
>       ManagedPolicyName: !Sub ${ResourcePrefix}-devin-deploy-agentcore
>       Description: Lets Devin deploy the AgentCore runtime and call the AWS Transform APIs. Split from DeployPolicy to stay under the IAM policy size limit.
>       Roles: [!Ref DevinRoleName]
>       PolicyDocument:
>         Version: '2012-10-17'
>         Statement:
>           - Sid: AgentCoreServiceLinkedRole
>             Effect: Allow
>             Action: iam:CreateServiceLinkedRole
>             Resource: '*'
>             Condition:
>               StringLike:
>                 iam:AWSServiceName: bedrock-agentcore.amazonaws.com
>           - Sid: AgentCoreNoResourceScope
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:CreateAgentRuntime
>               - bedrock-agentcore:ListAgentRuntimes
>               - bedrock-agentcore:ListAgentRuntimeVersions
>               - bedrock-agentcore:ListAgentRuntimeEndpoints
>             Resource: '*'
>           - Sid: AgentCoreOrchestratorRuntime
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:UpdateAgentRuntime
>               - bedrock-agentcore:DeleteAgentRuntime
>               - bedrock-agentcore:GetAgentRuntime
>               - bedrock-agentcore:CreateAgentRuntimeEndpoint
>               - bedrock-agentcore:UpdateAgentRuntimeEndpoint
>               - bedrock-agentcore:DeleteAgentRuntimeEndpoint
>               - bedrock-agentcore:GetAgentRuntimeEndpoint
>               - bedrock-agentcore:InvokeAgentRuntime
>               - bedrock-agentcore:StopRuntimeSession
>               - bedrock-agentcore:TagResource
>               - bedrock-agentcore:UntagResource
>               - bedrock-agentcore:ListTagsForResource
>             Resource:
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:runtime/${RuntimeName}-*
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:runtime/${RuntimeName}-*/runtime-endpoint/*
>           - Sid: AgentCoreWorkloadIdentity
>             Effect: Allow
>             Action:
>               - bedrock-agentcore:CreateWorkloadIdentity
>               - bedrock-agentcore:GetWorkloadIdentity
>               - bedrock-agentcore:UpdateWorkloadIdentity
>               - bedrock-agentcore:DeleteWorkloadIdentity
>               - bedrock-agentcore:TagResource
>             Resource:
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default
>               - !Sub arn:${AWS::Partition}:bedrock-agentcore:${AWS::Region}:${AWS::AccountId}:workload-identity-directory/default/workload-identity/*
>           - Sid: TransformRegistry
>             Effect: Allow
>             Action:
>               - transform-registry:GetAgent
>               - transform-registry:GetAgentVersion
>               - transform-registry:RegisterAgent
>               - transform-registry:PublishAgentVersion
>               - transform-registry:UpdatePublisherAccessControl
>             Resource: '*'
>           - Sid: TransformApis
>             Effect: Allow
>             Action:
>               - transform-agents:ListJobPlanSteps
>               - transform-agents:PutJobPlan
>               - transform-agents:UpdateJobPlanStep
>               - transform-agents:CreateWorklog
>               - transform-agents:SendMessage
>               - transform-agents:ListArtifacts
>               - transform-agents:CreateArtifactUploadUrl
>               - transform-agents:GetArtifactMetadata
>               - transform-agents:CompleteArtifactUpload
>               - transform-agents:CreateArtifactDownloadUrl
>               - transform-agents:GetJob
>               - transform-agents:UpdateJobStatus
>               - transform-agents:CreateHitlTask
>               - transform-agents:StartHitlTask
>               - transform-agents:GetHitlTask
>               - transform-agents:CloseHitlTask
>               - transform-agents:GetAgentInstance
>               - transform-agents:UpdateAgentInstance
>               - transform-agents:RefreshAuthToken
>             Resource: '*'
>
> Outputs:
>   BoundaryPolicyArn:
>     Value: !Ref RoleBoundary
>   DeployPolicyArn:
>     Value: !Ref DeployPolicy
>   DeployPolicyAgentCoreArn:
>     Value: !Ref DeployPolicyAgentCore
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.