---
title: "Simulate Component"
method: POST
path: "/simulate/component"
---

# Simulate Component

`POST /simulate/component`

## Request

- Base URL: `https://emfirge.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://emfirge.cloud/simulate/component`
- Auth: none declared

Simulate adding/modifying a component in the infrastructure.

1. Load infrastructure from DB
2. Deep-copy and mutate based on component config
3. Rebuild graph, run BFS, run all checks
4. Diff findings (new vs original)
5. Calculate risk delta
6. Call Claude Haiku for narrative prose
7. Return structured response

Shares rate limits with /simulate (10/min per IP, 3/day per account).
NO side effects — no drift events, no analysis saves.

## Request body

- ComponentRequest
  - `config` union, required
    - EC2Config
      - `component_type` 'ec2_instance'
      - `instance_type` string
      - `public_ip` boolean
      - `sg_ids` string[]
      - `subnet_id` string
      - `imdsv2_required` boolean
    - RDSConfig
      - `component_type` 'rds_instance'
      - `engine` string
      - `publicly_accessible` boolean
      - `encrypted` boolean
      - `multi_az` boolean
      - `subnet_id` string
      - `sg_ids` string[]
      - `deletion_protection` boolean
    - S3Config
      - `component_type` 's3_bucket'
      - `is_public` boolean
      - `encrypted` boolean
      - `versioning` boolean
      - `has_cloudfront` boolean
    - LambdaConfig
      - `component_type` 'lambda_function'
      - `in_vpc` boolean
      - `subnet_ids` string[]
      - `role_type` 'least_privilege' | 'admin'
      - `timeout` integer
      - `runtime` string
    - ALBConfig
      - `component_type` 'load_balancer'
      - `lb_type` 'ALB' | 'NLB'
      - `https_only` boolean
      - `waf_attached` boolean
      - `target_instance_ids` string[]
    - APIGatewayConfig
      - `component_type` 'api_gateway'
      - `gw_type` 'REST' | 'HTTP'
      - `auth` 'none' | 'iam' | 'cognito'
      - `is_public` boolean
      - `waf_attached` boolean
    - ElastiCacheConfig
      - `component_type` 'elasticache'
      - `engine` 'redis' | 'memcached'
      - `in_vpc` boolean
      - `encryption_in_transit` boolean
      - `auth_enabled` boolean
    - ECSConfig
      - `component_type` 'ecs_service'
      - `launch_type` 'FARGATE' | 'EC2'
      - `privileged` boolean
      - `resource_limits` boolean
      - `public_ip` boolean
    - SGRuleConfig
      - `component_type` 'sg_rule'
      - `sg_id` string, required
      - `action` 'add' | 'remove'
      - `port` integer
      - `protocol` 'tcp' | 'udp'
      - `source` string
    - IAMPolicyConfig
      - `component_type` 'iam_policy'
      - `role_name` string, required
      - `action` 'attach' | 'detach'
      - `policy_name` string
  - `analysis_id` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/emfirge/apis/aws-risk-analysis-agent.md) · [All operations](https://skmtc.dev/emfirge/apis/aws-risk-analysis-agent/llms.txt) · [OpenAPI document](https://skmtc.dev/emfirge/apis/aws-risk-analysis-agent/revisions/149a9263d07a?raw)
