aws.iam.ensure_instance_profile ​
Create or validate an IAM role and matching instance profile
Idempotently provisions an IAM role + instance profile suitable for binding to EC2 instances (e.g. ECS container instances).
Inputs:
- connection_uuid: Cloud connection UUID for AWS credentials (required)
- role_name: IAM role name (required)
- profile_name: Instance profile name. Defaults to role_name (optional)
- assume_role_policy: Trust policy document as dict. Defaults to EC2 service trust (optional)
- managed_policy_arns: List of managed policy ARNs to attach to the role (optional)
- role_description: Human-readable description (optional)
- tags: Dict of tags applied to role + profile (optional)
Outputs:
- role_name
- role_arn
- profile_name
- profile_arn
- existed: bool — true if both role and profile already existed
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | Base-aws |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | Cloud connection UUID |
role_name | string | Yes | — | IAM role name |
profile_name | string | No | — | Instance profile name (defaults to role_name) |
assume_role_policy | json | No | — | Trust policy document |
managed_policy_arns | json | No | — | List of managed policy ARNs to attach |
role_description | string | No | — | Human-readable role description |
tags | json | No | — | Tags applied to role + profile |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
existed | boolean | No | — | — |
profile_arn | string | No | — | — |
profile_name | string | No | — | — |
role_arn | string | No | — | — |
role_name | string | No | — | — |
assume_role_policy | json | No | — | — |
connection_uuid | uuid | No | — | — |
managed_policy_arns | json | No | — | — |
role_description | string | No | — | — |
tags | json | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "aws.iam.ensure_instance_profile",
"initial_data": {
"connection_uuid": "value",
"role_name": "value"
}
}