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

# Create a resource



## OpenAPI

````yaml /api-reference/openapi.yaml post /resource
openapi: 3.0.3
info:
  title: Gapstack API
  version: '1.0'
  description: >-
    REST API for Gapstack tenants, projects, environments, resources, and
    integrations.
servers:
  - url: https://9nr7sbhimh.execute-api.us-west-1.amazonaws.com/prod
    description: Production
security:
  - BearerAuth: []
tags:
  - name: healthcheck
    description: Service health
  - name: tenants
    description: Tenants, members, infrastructure, and API keys
  - name: invitations
    description: Tenant invitations
  - name: projects
    description: Projects, variables, webhooks, and integrations
  - name: environments
    description: Environments, deploys, artifacts, and variables
  - name: resources
    description: Cloud resources
  - name: workflows
    description: Deployment and infrastructure workflows
  - name: aws-accounts
    description: Linked AWS accounts
  - name: integrations
    description: Marketplace integrations
  - name: github
    description: GitHub App install and webhooks
  - name: costs
    description: Aggregated cloud costs
  - name: summary
    description: Tenant dashboard summary
  - name: subscription
    description: Plans, usage, and billing webhooks
  - name: settings
    description: System settings, permissions, and superadmins
paths:
  /resource:
    post:
      tags:
        - resources
      summary: Create a resource
      operationId: createResource
      parameters:
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceCreateUnion'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceDetailsUnion'
        '400':
          description: Bad request, validation failure, or applicable mapped 4xx errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Authenticated but not allowed (e.g. subscription limits).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict (e.g. duplicate or already exists).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  parameters:
    TenantId:
      name: Tenant-Id
      in: header
      required: true
      schema:
        type: string
      description: ID of the tenant (current tenant context).
  schemas:
    ResourceCreateUnion:
      description: One of the resource-specific create payloads (internal/app/resources).
      oneOf:
        - $ref: '#/components/schemas/S3ResourceCreate'
        - $ref: '#/components/schemas/LambdaResourceCreate'
        - $ref: '#/components/schemas/EventBusResourceCreate'
        - $ref: '#/components/schemas/ApiResourceCreate'
        - $ref: '#/components/schemas/CognitoResourceCreate'
        - $ref: '#/components/schemas/CronResourceCreate'
        - $ref: '#/components/schemas/DynamoDBResourceCreate'
        - $ref: '#/components/schemas/OpenSearchResourceCreate'
        - $ref: '#/components/schemas/PubSubResourceCreate'
        - $ref: '#/components/schemas/ParameterResourceCreate'
        - $ref: '#/components/schemas/SecretsResourceCreate'
        - $ref: '#/components/schemas/PostgresResourceCreate'
        - $ref: '#/components/schemas/RoleResourceCreate'
        - $ref: '#/components/schemas/ECSImageCreate'
    ResourceDetailsUnion:
      description: One of the resource-specific detail payloads (internal/app/resources).
      oneOf:
        - $ref: '#/components/schemas/S3ResourceDetails'
        - $ref: '#/components/schemas/LambdaResourceDetails'
        - $ref: '#/components/schemas/EventBusResourceDetails'
        - $ref: '#/components/schemas/ApiResourceDetails'
        - $ref: '#/components/schemas/CognitoResourceDetails'
        - $ref: '#/components/schemas/CronResourceDetails'
        - $ref: '#/components/schemas/DynamoDBResourceDetails'
        - $ref: '#/components/schemas/OpenSearchResourceDetails'
        - $ref: '#/components/schemas/PubSubResourceDetails'
        - $ref: '#/components/schemas/ParameterResourceDetails'
        - $ref: '#/components/schemas/SecretsResourceDetails'
        - $ref: '#/components/schemas/PostgresResourceDetails'
        - $ref: '#/components/schemas/RoleResourceDetails'
        - $ref: '#/components/schemas/ECSImageDetails'
    ErrorResponse:
      type: object
      description: >
        JSON body returned by WriteJsonError (internal/app/util.go
        errorResponse).

        Field `error` carries the human-readable message; `code` is set for
        Gapstack errors.
      properties:
        code:
          description: >
            Machine-readable code from paas-lib when the error is a
            GapstackError; omitted when not.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PaasLibErrorCode'
        error:
          type: string
          description: Human-readable error message (JSON key `error`, not `message`).
        meta:
          type: object
          additionalProperties:
            type: string
          description: Optional metadata (e.g. validation field names).
    S3ResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - bucket_name
            - removal_policy
            - encryption
            - block_public_access
            - allowed_headers
            - allowed_methods
            - allowed_origins
            - default_root_object
          properties:
            bucket_name:
              type: string
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            auto_delete_objects:
              type: boolean
            versioned:
              type: boolean
            encryption:
              $ref: '#/components/schemas/S3Encryption'
            block_public_access:
              $ref: '#/components/schemas/S3BlockPublicAccess'
            enforce_ssl:
              type: boolean
              x-go-name: EnforceSSL
            allowed_headers:
              type: array
              items:
                type: string
            allowed_methods:
              type: array
              items:
                $ref: '#/components/schemas/S3AllowedMethods'
            allowed_origins:
              type: array
              items:
                type: string
            default_root_object:
              type: string
            allow_cdn_access:
              type: boolean
              x-go-name: AllowCDNAccess
    LambdaResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - function_name
            - runtime
            - architecture
            - memory_size
            - handler
            - timeout
          properties:
            function_name:
              type: string
            runtime:
              $ref: '#/components/schemas/LambdaRuntime'
            architecture:
              $ref: '#/components/schemas/LambdaArchitecture'
            memory_size:
              type: integer
            handler:
              type: string
            timeout:
              type: integer
            code:
              type: string
              nullable: true
              description: >
                S3 code folder; optional in the schema. Required (non-empty)
                when artifact_type is null, omitted, empty, or `artifact`.

                Not used when artifact_type is `ecr_image`.
            retry_attempts:
              type: integer
            artifact_version:
              type: string
              nullable: true
              description: >
                Optional in the schema. Required (non-empty) when artifact_type
                is null, omitted, empty, or `artifact`.

                Not used when artifact_type is `ecr_image`.
            inline_policy:
              type: string
            allow_actions:
              type: array
              items:
                type: string
            allow_resources:
              type: array
              items:
                type: string
            layers:
              type: array
              items:
                $ref: '#/components/schemas/LambdaLayer'
            artifact_type:
              nullable: true
              description: >-
                Type of deployable artifact (null or omitted = regular S3
                artifact).
              allOf:
                - $ref: '#/components/schemas/LambdaArtifactType'
            ecr_config:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/LambdaECRConfig'
    EventBusResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - event_source
            - dead_letter_queue_name
            - dead_letter_queue_time_retention
            - rules
          properties:
            event_source:
              type: string
            dead_letter_queue_name:
              type: string
            dead_letter_queue_time_retention:
              type: integer
            rules:
              type: array
              items:
                $ref: '#/components/schemas/EventBusRules'
    ApiResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - allowed_headers
            - allowed_hosts
            - domain
            - lambda_id
            - logging_level
          properties:
            metrics_enabled:
              type: boolean
            data_trace_enabled:
              type: boolean
            logging_level:
              $ref: '#/components/schemas/LoggingLevel'
            domain:
              $ref: '#/components/schemas/Domain'
            lambda_id:
              type: string
            allowed_headers:
              type: array
              items:
                type: string
            allowed_hosts:
              type: array
              items:
                type: string
            binary_media_types:
              type: array
              items:
                type: string
    CognitoResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - user_pool_name
            - removal_policy
            - password_policy
          properties:
            user_pool_name:
              type: string
            auto_verify_email:
              type: boolean
            roles:
              type: array
              items:
                type: string
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            custom_attributes:
              type: array
              items:
                $ref: '#/components/schemas/CustomAttribute'
            password_policy:
              $ref: '#/components/schemas/PasswordPolicy'
            lambda_triggers:
              type: array
              items:
                $ref: '#/components/schemas/LambdaTrigger'
            lambda_id:
              type: string
    CronResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - schedule
            - lambda_id
          properties:
            schedule:
              type: string
            lambda_id:
              type: string
            event:
              type: object
              description: >
                Arbitrary JSON object passed to the scheduled Lambda (string
                keys, values may be any JSON type).

                In Go this maps to map[string]any (generated code may use
                map[string]interface{}).
              additionalProperties: true
    DynamoDBResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - table_name
            - removal_policy
            - billing_mode
            - partition_key_name
            - partition_key_type
            - gsis
            - stream
          properties:
            table_name:
              type: string
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            billing_mode:
              $ref: '#/components/schemas/BillingMode'
            deletion_protection:
              type: boolean
            partition_key_name:
              type: string
            partition_key_type:
              $ref: '#/components/schemas/DynamoDbKeyType'
            sort_key_name:
              type: string
            sort_key_type:
              $ref: '#/components/schemas/DynamoDbKeyType'
            gsis:
              type: array
              x-go-name: GSIs
              items:
                $ref: '#/components/schemas/DynamoDbGSI'
            stream:
              $ref: '#/components/schemas/Stream'
    OpenSearchResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - index_type
            - standby_replicas
            - index
            - lambda_id
          properties:
            index_type:
              $ref: '#/components/schemas/IndexType'
            standby_replicas:
              $ref: '#/components/schemas/StandbyReplicas'
            index:
              type: array
              items:
                $ref: '#/components/schemas/OpenSearchIndex'
            lambda_id:
              type: string
    PubSubResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - topic_name
            - queues
          properties:
            topic_name:
              type: string
            queues:
              type: array
              items:
                $ref: '#/components/schemas/PubSubQueueModel'
    ParameterResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - parameters
          properties:
            parameters:
              type: array
              items:
                $ref: '#/components/schemas/ParameterModel'
    SecretsResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - secrets
          properties:
            secrets:
              type: array
              items:
                $ref: '#/components/schemas/SecretModel'
    PostgresResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - default_database
            - username
            - allocated_storage
            - version
            - instance_class
            - instance_size
            - removal_policy
          properties:
            default_database:
              type: string
            username:
              type: string
            allocated_storage:
              type: integer
              format: int64
            multi_az:
              type: boolean
            publicly_accessible:
              type: boolean
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            version:
              $ref: '#/components/schemas/PostgresVersion'
            instance_class:
              $ref: '#/components/schemas/EC2InstanceClass'
            instance_size:
              $ref: '#/components/schemas/EC2InstanceSize'
    RoleResourceCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - required:
            - role_name
            - max_session_duration
            - assume_by
        - type: object
          required:
            - role_name
            - max_session_duration
            - assume_by
          properties:
            role_name:
              type: string
            max_session_duration:
              type: integer
            assume_by:
              $ref: '#/components/schemas/Principal'
            policy_statements:
              type: array
              items:
                $ref: '#/components/schemas/RolePolicyStatement'
    ECSImageCreate:
      allOf:
        - $ref: '#/components/schemas/BaseResourceCreate'
        - type: object
          required:
            - image_source
            - image_name
            - desired_count
            - cpu
            - memory
          properties:
            image_source:
              $ref: '#/components/schemas/DockerImageSource'
            image_name:
              type: string
            image_tag:
              type: string
              nullable: true
            container_port:
              type: integer
            desired_count:
              type: integer
              minimum: 1
            public_load_balancer:
              type: boolean
            cpu:
              $ref: '#/components/schemas/ECSImageCpuUnit'
            memory:
              type: integer
            environment_variables:
              type: object
              additionalProperties:
                type: string
            health_check_path:
              type: string
              nullable: true
            command:
              type: array
              items:
                type: string
            enable_logs:
              type: boolean
            min_tasks:
              type: integer
              nullable: true
            max_tasks:
              type: integer
              nullable: true
            cpu_scaling_target:
              type: integer
              nullable: true
            assign_public_ip:
              type: boolean
            task_role_permissions:
              type: array
              items:
                $ref: '#/components/schemas/PermissionStatement'
            execution_role_permissions:
              type: array
              items:
                $ref: '#/components/schemas/PermissionStatement'
    S3ResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - bucket_name
            - removal_policy
            - auto_delete_objects
            - versioned
            - encryption
            - block_public_access
            - enforce_ssl
            - allowed_headers
            - allowed_methods
            - allowed_origins
            - default_root_object
        - type: object
          properties:
            bucket_name:
              type: string
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            auto_delete_objects:
              type: boolean
            versioned:
              type: boolean
            encryption:
              $ref: '#/components/schemas/S3Encryption'
            block_public_access:
              $ref: '#/components/schemas/S3BlockPublicAccess'
            enforce_ssl:
              type: boolean
              x-go-name: EnforceSSL
            allowed_headers:
              type: array
              items:
                type: string
            allowed_methods:
              type: array
              items:
                $ref: '#/components/schemas/S3AllowedMethods'
            allowed_origins:
              type: array
              items:
                type: string
            default_root_object:
              type: string
            allow_cdn_access:
              type: boolean
              x-go-name: AllowCDNAccess
            stack_info:
              $ref: '#/components/schemas/S3ResourceStackInfo'
            month_cost:
              nullable: true
    LambdaResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - type: object
          description: Lambda-specific fields (stack_info from deployment).
          properties:
            function_name:
              type: string
            runtime:
              $ref: '#/components/schemas/LambdaRuntime'
            architecture:
              $ref: '#/components/schemas/LambdaArchitecture'
            memory_size:
              type: integer
            handler:
              type: string
            timeout:
              type: integer
            code:
              type: string
            retry_attempts:
              type: integer
            artifact_version:
              type: string
            inline_policy:
              type: string
            allow_actions:
              type: array
              items:
                type: string
            allow_resources:
              type: array
              items:
                type: string
            layers:
              type: array
              items:
                $ref: '#/components/schemas/LambdaLayer'
            artifact_type:
              nullable: true
              description: >-
                Type of deployable artifact (null or omitted = regular S3
                artifact).
              allOf:
                - $ref: '#/components/schemas/LambdaArtifactType'
            ecr_config:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/LambdaECRConfig'
            stack_info:
              $ref: '#/components/schemas/LambdaResourceStackInfo'
            month_cost:
              nullable: true
    EventBusResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - event_source
            - dead_letter_queue_name
            - dead_letter_queue_time_retention
            - rules
        - type: object
          properties:
            event_source:
              type: string
            dead_letter_queue_name:
              type: string
            dead_letter_queue_time_retention:
              type: integer
            rules:
              type: array
              items:
                $ref: '#/components/schemas/EventBusRules'
            stack_info:
              $ref: '#/components/schemas/EventbusStackInfo'
            month_cost:
              nullable: true
    ApiResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - type: object
          required:
            - allowed_headers
            - allowed_hosts
            - domain
            - lambda_id
            - logging_level
          properties:
            metrics_enabled:
              type: boolean
            data_trace_enabled:
              type: boolean
            logging_level:
              $ref: '#/components/schemas/LoggingLevel'
            domain:
              $ref: '#/components/schemas/Domain'
            lambda_id:
              type: string
            allowed_headers:
              type: array
              items:
                type: string
            allowed_hosts:
              type: array
              items:
                type: string
            binary_media_types:
              type: array
              items:
                type: string
            stack_info:
              $ref: '#/components/schemas/ApiResourceStackInfo'
            month_cost:
              nullable: true
    CognitoResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - user_pool_name
            - removal_policy
            - password_policy
        - type: object
          properties:
            user_pool_name:
              type: string
            auto_verify_email:
              type: boolean
            roles:
              type: array
              items:
                type: string
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            custom_attributes:
              type: array
              items:
                $ref: '#/components/schemas/CustomAttribute'
            password_policy:
              $ref: '#/components/schemas/PasswordPolicy'
            lambda_triggers:
              type: array
              items:
                $ref: '#/components/schemas/LambdaTrigger'
            lambda_id:
              type: string
            stack_info:
              $ref: '#/components/schemas/CognitoResourceStackInfo'
            month_cost:
              nullable: true
    CronResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - schedule
            - lambda_id
        - type: object
          properties:
            schedule:
              type: string
            lambda_id:
              type: string
            stack_info:
              $ref: '#/components/schemas/CronResourceStackInfo'
            month_cost:
              nullable: true
            event:
              type: object
              description: >
                Arbitrary JSON object passed to the scheduled Lambda (string
                keys, values may be any JSON type).

                In Go this maps to map[string]any (generated code may use
                map[string]interface{}).
              additionalProperties: true
    DynamoDBResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - table_name
            - removal_policy
            - billing_mode
            - partition_key_name
            - partition_key_type
            - sort_key_name
            - sort_key_type
            - gsis
            - stream
        - type: object
          properties:
            table_name:
              type: string
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            billing_mode:
              $ref: '#/components/schemas/BillingMode'
            deletion_protection:
              type: boolean
            partition_key_name:
              type: string
            partition_key_type:
              $ref: '#/components/schemas/DynamoDbKeyType'
            sort_key_name:
              type: string
            sort_key_type:
              $ref: '#/components/schemas/DynamoDbKeyType'
            gsis:
              type: array
              x-go-name: GSIs
              items:
                $ref: '#/components/schemas/DynamoDbGSI'
            stream:
              $ref: '#/components/schemas/Stream'
            stack_info:
              $ref: '#/components/schemas/DynamoDBResourceStackInfo'
            month_cost:
              nullable: true
    OpenSearchResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - index_type
            - standby_replicas
            - index
            - lambda_id
        - type: object
          properties:
            index_type:
              $ref: '#/components/schemas/IndexType'
            standby_replicas:
              $ref: '#/components/schemas/StandbyReplicas'
            index:
              type: array
              items:
                $ref: '#/components/schemas/OpenSearchIndex'
            lambda_id:
              type: string
            month_cost:
              nullable: true
    PubSubResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - topic_name
            - queues
        - type: object
          properties:
            topic_name:
              type: string
            queues:
              type: array
              items:
                $ref: '#/components/schemas/PubSubQueueModel'
            stack_info:
              $ref: '#/components/schemas/PubSubResourceStackInfo'
            month_cost:
              nullable: true
    ParameterResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - parameters
        - type: object
          properties:
            parameters:
              type: array
              items:
                $ref: '#/components/schemas/ParameterModel'
            stack_info:
              $ref: '#/components/schemas/ParameterResourceStackInfo'
            month_cost:
              nullable: true
    SecretsResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - secrets
        - type: object
          properties:
            secrets:
              type: array
              items:
                $ref: '#/components/schemas/SecretModel'
            stack_info:
              $ref: '#/components/schemas/SecretsResourceStackInfo'
            month_cost:
              nullable: true
    PostgresResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - required:
            - username
            - allocated_storage
            - default_database
            - removal_policy
            - version
            - instance_class
            - instance_size
        - type: object
          properties:
            username:
              type: string
            allocated_storage:
              type: integer
              format: int64
            multi_az:
              type: boolean
            publicly_accessible:
              type: boolean
            default_database:
              type: string
            removal_policy:
              $ref: '#/components/schemas/RemovalPolicy'
            version:
              $ref: '#/components/schemas/PostgresVersion'
            instance_class:
              $ref: '#/components/schemas/EC2InstanceClass'
            instance_size:
              $ref: '#/components/schemas/EC2InstanceSize'
            stack_info:
              $ref: '#/components/schemas/PostgresResourceStackInfo'
            month_cost:
              nullable: true
    RoleResourceDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - type: object
          properties:
            role_name:
              type: string
            max_session_duration:
              type: integer
            assume_by:
              $ref: '#/components/schemas/Principal'
            policy_statements:
              type: array
              items:
                $ref: '#/components/schemas/RolePolicyStatement'
            stack_info:
              $ref: '#/components/schemas/RoleResourceStackInfo'
            month_cost:
              nullable: true
    ECSImageDetails:
      allOf:
        - $ref: '#/components/schemas/BaseResourceDetails'
        - type: object
          properties:
            image_source:
              $ref: '#/components/schemas/DockerImageSource'
            image_name:
              type: string
            image_tag:
              type: string
              nullable: true
            container_port:
              type: integer
            desired_count:
              type: integer
            public_load_balancer:
              type: boolean
            cpu:
              $ref: '#/components/schemas/ECSImageCpuUnit'
            memory:
              type: integer
            environment_variables:
              type: object
              additionalProperties:
                type: string
            health_check_path:
              type: string
              nullable: true
            command:
              type: array
              items:
                type: string
            enable_logs:
              type: boolean
            min_tasks:
              type: integer
              nullable: true
            max_tasks:
              type: integer
              nullable: true
            cpu_scaling_target:
              type: integer
              nullable: true
            assign_public_ip:
              type: boolean
            stack_info:
              $ref: '#/components/schemas/ECSImageStackInfo'
            task_role_permissions:
              type: array
              items:
                $ref: '#/components/schemas/PermissionStatement'
            execution_role_permissions:
              type: array
              items:
                $ref: '#/components/schemas/PermissionStatement'
    PaasLibErrorCode:
      type: string
      description: >
        Machine-readable code from paas-lib (errors.Code). Matches
        github.com/gapai-io/paas-lib/pkg/errors.Code.
      enum:
        - common.internal_error
        - common.unavailable
        - common.timeout
        - common.conflict
        - common.not_implemented
        - validation.invalid
        - validation.required
        - auth.unauthorized
        - auth.forbidden
        - storage.not_found
        - storage.already_exists
        - storage.db_error
        - storage.constraint_violation
        - service.invalid_state
        - service.rule_violation
        - service.aborted
        - external.error
        - external.timeout
        - external.bad_response
        - stack.manual_deletion
        - subscription.invalid_state
        - subscription.rule_violation
        - subscription.canceled
        - subscription.not_found
        - subscription.limit_reached
      x-enum-varnames:
        - ErrInternalErrorCode
        - ErrUnavailableErrorCode
        - ErrTimeoutErrorCode
        - ErrConflictErrorCode
        - ErrNotImplementedErrorCode
        - ErrValidationInvalidCode
        - ErrValidationRequiredCode
        - ErrUnauthorizedCode
        - ErrForbiddenCode
        - ErrRepoNotFoundErrorCode
        - ErrRepoAlreadyExistsErrorCode
        - ErrRepoDBErrorCode
        - ErrRepoConstraintViolationErrorCode
        - ErrInvalidStateCode
        - ErrBusinessRuleCode
        - ErrOperationAbortCode
        - ErrExternalErrorCode
        - ErrExternalTimeoutCode
        - ErrExternalBadRespCode
        - ErrStackManualDeletionCode
        - ErrSubscriptionInvalidStateCode
        - ErrSubscriptionBusinessRuleCode
        - ErrSubscriptionCanceledCode
        - ErrSubscriptionNotFoundCode
        - ErrSubscriptionLimitReachedCode
    BaseResourceCreate:
      type: object
      description: >-
        Shared fields for resource create payloads (merged into each resource
        create schema).
      required:
        - name
        - description
        - resource_type
        - environment_id
      properties:
        name:
          type: string
        description:
          type: string
        resource_type:
          $ref: '#/components/schemas/ResourceType'
        environment_id:
          type: string
    RemovalPolicy:
      type: string
      description: models.RemovalPolicy (paas-lib).
      enum:
        - DESTROY
        - RETAIN
        - SNAPSHOT
        - RETAIN_ON_UPDATE_OR_DELETE
    S3Encryption:
      type: string
      description: models.S3Encryption (paas-lib).
      enum:
        - UNENCRYPTED
        - S3_MANAGED
        - KMS_MANAGED
        - KMS
        - DSSE_MANAGED
        - DSSE
    S3BlockPublicAccess:
      type: string
      description: models.S3BlockPublicAccess (paas-lib).
      enum:
        - BLOCK_ALL
        - BLOCK_ACLS
    S3AllowedMethods:
      type: string
      description: models.S3AllowedMethods (paas-lib).
      enum:
        - GET
        - PUT
        - POST
        - DELETE
        - HEAD
    LambdaRuntime:
      type: string
      description: models.LambdaRuntime (paas-lib).
      enum:
        - nodejs4.3
        - nodejs6.10
        - nodejs8.10
        - nodejs10.x
        - nodejs12.x
        - nodejs14.x
        - nodejs16.x
        - nodejs18.x
        - nodejs20.x
        - nodejs_latest
        - nodejs22.x
        - python2.7
        - python3.6
        - python3.7
        - python3.8
        - python3.9
        - python3.10
        - python3.11
        - python3.12
        - python3.13
        - java8
        - java8.corretto
        - java11
        - java17
        - java21
        - dotnet6
        - dotnet8
        - dotnet9
        - dotnetcore1
        - dotnetcore2
        - dotnetcore2.1
        - dotnetcore3.1
        - go1.x
        - ruby2.5
        - ruby2.7
        - ruby3.2
        - ruby3.3
        - ruby3.4
        - provided
        - provided.al2
        - provided.al2023
        - from_image
    LambdaArchitecture:
      type: string
      description: models.LambdaArchitecture (paas-lib).
      enum:
        - arm64
        - x86_64
      x-enum-varnames:
        - LambdaArchitectureArm64
        - LambdaArchitectureX8664
    LambdaLayer:
      type: object
      required:
        - code_path
      properties:
        code_path:
          type: string
          description: Path to the layer code in the environment artifacts S3 bucket.
    LambdaArtifactType:
      type: string
      description: >-
        models.LambdaArtifactType (paas-lib). Omitted or null means regular S3
        artifact (code path).
      enum:
        - artifact
        - ecr_image
      x-enum-varnames:
        - LambdaArtifactTypeArtifact
        - LambdaArtifactTypeECRImage
    LambdaECRConfig:
      type: object
      description: >-
        models.LambdaECRConfig (paas-lib). ECR image reference when
        artifact_type is ecr_image.
      required:
        - image_name
        - image_tag
      properties:
        image_name:
          type: string
        image_tag:
          type: string
    EventBusRules:
      type: object
      properties:
        name:
          type: string
        event_pattern:
          type: string
        retry_attempts:
          type: integer
        target_to_lambda_version_id:
          type: string
        put_events_to_lambda_id:
          type: string
    LoggingLevel:
      type: string
      description: models.LoggingLevel (paas-lib).
      enum:
        - 'OFF'
        - ERROR
        - INFO
    Domain:
      type: object
      description: models.Domain (paas-lib)
      properties:
        domain_name:
          type: string
        certificate_arn:
          type: string
    CustomAttribute:
      type: object
      required:
        - name
        - type
        - max_len
        - min_len
      properties:
        name:
          type: string
        type:
          $ref: '#/components/schemas/AttributeType'
        mutable:
          type: boolean
        max_len:
          type: integer
        min_len:
          type: integer
    PasswordPolicy:
      type: object
      properties:
        min_length:
          type: integer
        require_lowercase:
          type: boolean
        require_numbers:
          type: boolean
        require_symbols:
          type: boolean
        require_uppercase:
          type: boolean
    LambdaTrigger:
      type: string
      description: models.LambdaTrigger (paas-lib)
      enum:
        - CreateAuthChallenge
        - CustomMessage
        - DefineAuthChallenge
        - PostAuthentication
        - PostConfirmation
        - PreAuthentication
        - PreSignUp
        - PreTokenGeneration
        - UserMigration
        - VerifyAuthChallengeResponse
        - CustomEmailSender
        - CustomSMSSender
    BillingMode:
      type: string
      description: models.BillingMode (paas-lib).
      enum:
        - PAY_PER_REQUEST
        - PROVISIONED
    DynamoDbKeyType:
      type: string
      description: models.DynamoDbKeyType (paas-lib).
      enum:
        - STRING
        - NUMBER
        - BINARY
      x-enum-varnames:
        - DynamoDbKeyTypeString
        - DynamoDbKeyTypeNumber
        - DynamoDbKeyTypeBinary
    DynamoDbGSI:
      type: object
      properties:
        index_name:
          type: string
        partition_key_name:
          type: string
        partition_key_type:
          $ref: '#/components/schemas/DynamoDbKeyType'
        sort_key_name:
          type: string
        sort_key_type:
          $ref: '#/components/schemas/DynamoDbKeyType'
        projection_type:
          $ref: '#/components/schemas/ProjectionType'
        non_key_attributes:
          type: array
          items:
            type: string
    Stream:
      type: object
      description: >-
        models.Stream — DynamoDB stream / event source mapping settings
        (paas-lib).
      properties:
        starting_position:
          type: string
        batch_size:
          type: integer
        bisect_batch_on_error:
          type: boolean
        report_batch_item_fails:
          type: boolean
        parallelization_factor:
          type: integer
        retry_attempts:
          type: integer
        max_batching_window:
          type: integer
        filters:
          type: string
        lambda_id:
          type: string
    IndexType:
      type: string
      description: models.IndexType (paas-lib).
      enum:
        - SEARCH
        - TIMESERIES
        - VECTORSEARCH
      x-enum-varnames:
        - IndexTypeSearch
        - IndexTypeTimeSeries
        - IndexTypeVector
    StandbyReplicas:
      type: string
      description: models.StandbyReplicas (paas-lib).
      enum:
        - DISABLED
    OpenSearchIndex:
      type: object
      description: models.OpenSearchIndex (paas-lib)
      properties:
        name:
          type: string
        mapping:
          type: string
    PubSubQueueModel:
      type: object
      description: models.PubSubQueue
      properties:
        name:
          type: string
        removal_policy:
          $ref: '#/components/schemas/RemovalPolicy'
        encryption:
          $ref: '#/components/schemas/Encryption'
        enable_ssl:
          type: boolean
          x-go-name: EnableSSL
        retention_days:
          type: integer
        filter_policy:
          type: string
        lambda_id:
          type: string
    ParameterModel:
      type: object
      description: models.Parameter
      properties:
        name:
          type: string
        value:
          type: string
    SecretModel:
      type: object
      description: models.Secret
      properties:
        secret_name:
          type: string
        description:
          type: string
        secret_string_template:
          type: string
        generate_string_key:
          type: string
        secret_object_value:
          type: string
    PostgresVersion:
      type: string
      description: models.PostgresVersion (paas-lib).
      enum:
        - '11'
        - '12'
        - '13'
        - '14'
        - '15'
        - '16'
        - '17'
    EC2InstanceClass:
      type: string
      description: models.EC2InstanceClass (paas-lib).
      enum:
        - t2
        - t3
        - t3a
        - t4g
        - m3
        - m4
        - m5
        - m5a
        - m6g
        - c4
        - c5
        - c6g
        - r5
        - r6g
        - d2
        - d3
        - i3
        - i4i
        - p2
        - p3
        - g3
        - g4dn
        - f1
      x-enum-varnames:
        - InstanceClassBurstable2
        - InstanceClassBurstable3
        - InstanceClassBurstable3a
        - InstanceClassBurstable4Graviton
        - InstanceClassStandard3
        - InstanceClassStandard4
        - InstanceClassStandard5
        - InstanceClassStandard5a
        - InstanceClassStandard6g
        - InstanceClassCompute4
        - InstanceClassCompute5
        - InstanceClassCompute6g
        - InstanceClassMemory5
        - InstanceClassMemory6g
        - InstanceClassStorage2
        - InstanceClassStorage3
        - InstanceClassI3
        - InstanceClassI4i
        - InstanceClassP2
        - InstanceClassP3
        - InstanceClassG3
        - InstanceClassG4dn
        - InstanceClassF1
    EC2InstanceSize:
      type: string
      description: models.EC2InstanceSize (paas-lib).
      enum:
        - nano
        - micro
        - small
        - medium
        - large
        - xlarge
        - 2xlarge
        - 4xlarge
        - 8xlarge
        - 9xlarge
        - 10xlarge
        - 12xlarge
        - 16xlarge
        - 18xlarge
        - 24xlarge
        - 32xlarge
        - 48xlarge
        - 56xlarge
        - 112xlarge
      x-enum-varnames:
        - EC2InstanceSizeNano
        - EC2InstanceSizeMicro
        - EC2InstanceSizeSmall
        - EC2InstanceSizeMedium
        - EC2InstanceSizeLarge
        - EC2InstanceSizeXlarge
        - EC2InstanceSize2Xlarge
        - EC2InstanceSize4Xlarge
        - EC2InstanceSize8Xlarge
        - EC2InstanceSize9Xlarge
        - EC2InstanceSize10Xlarge
        - EC2InstanceSize12Xlarge
        - EC2InstanceSize16Xlarge
        - EC2InstanceSize18Xlarge
        - EC2InstanceSize24Xlarge
        - EC2InstanceSize32Xlarge
        - EC2InstanceSize48Xlarge
        - EC2InstanceSize56Xlarge
        - EC2InstanceSize112Xlarge
    Principal:
      type: object
      required:
        - principal_type
        - federated
        - assume_role_action
        - conditions
      properties:
        principal_type:
          $ref: '#/components/schemas/PrincipalType'
        federated:
          type: string
        assume_role_action:
          type: string
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
    RolePolicyStatement:
      type: object
      required:
        - effect
        - action
        - resource
      properties:
        effect:
          $ref: '#/components/schemas/PolicyStatementEffect'
        action:
          type: array
          items:
            type: string
        resource:
          type: array
          items:
            type: string
    DockerImageSource:
      type: string
      description: models.DockerImageSource (paas-lib).
      enum:
        - ECR_REGISTRY
        - PUBLIC_REGISTRY
    ECSImageCpuUnit:
      type: integer
      description: ECS task CPU units (256, 512, 1024, ...).
      enum:
        - 256
        - 512
        - 1024
        - 2048
        - 4096
        - 8192
        - 16384
      x-enum-varnames:
        - ECSImageCpuUnit256
        - ECSImageCpuUnit512
        - ECSImageCpuUnit1024
        - ECSImageCpuUnit2048
        - ECSImageCpuUnit4096
        - ECSImageCpuUnit8192
        - ECSImageCpuUnit16384
    PermissionStatement:
      type: object
      properties:
        actions:
          type: array
          items:
            type: string
        resource_arns:
          type: array
          items:
            type: string
    BaseResourceDetails:
      type: object
      description: Shared resource metadata (merged into each resource details schema).
      required:
        - name
        - description
        - resource_type
        - id
        - sk
        - type
        - created_at
        - updated_at
        - status
      properties:
        name:
          type: string
        description:
          type: string
        resource_type:
          $ref: '#/components/schemas/ResourceType'
        id:
          type: string
          x-go-name: Pk
        sk:
          type: string
        type:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/ResourceStatus'
        deletable:
          type: boolean
    S3ResourceStackInfo:
      type: object
      properties:
        bucket_name:
          type: string
        bucket_arn:
          type: string
        bucket_domain_name:
          type: string
        bucket_regional_domain:
          type: string
        bucket_website_url:
          type: string
        bucket_website_domain_name:
          type: string
        bucket_dual_stack_domain_name:
          type: string
        distribution_arn:
          type: string
        distribution_domain_name:
          type: string
        distribution_id:
          type: string
    LambdaResourceStackInfo:
      type: object
      properties:
        function_arn:
          type: string
        function_name:
          type: string
        runtime:
          $ref: '#/components/schemas/LambdaRuntime'
        layers:
          type: array
          items:
            type: string
    EventbusStackInfo:
      type: object
      description: JSON field names match internal/app/resources.EventbusStackInfo.
      properties:
        eventBusArn:
          type: string
        deadLetterQueueArn:
          type: string
        rules:
          type: array
          items:
            $ref: '#/components/schemas/EventbusRule'
    ApiResourceStackInfo:
      type: object
      properties:
        rest_api_id:
          type: string
        rest_api_name:
          type: string
        rest_api_url:
          type: string
    CognitoResourceStackInfo:
      type: object
      properties:
        user_pool_arn:
          type: string
        user_pool_id:
          type: string
        user_pool_client_id:
          type: string
    CronResourceStackInfo:
      type: object
      properties:
        cron_arn:
          type: string
        cron_name:
          type: string
    DynamoDBResourceStackInfo:
      type: object
      properties:
        table_name:
          type: string
        table_arn:
          type: string
    PubSubResourceStackInfo:
      type: object
      properties:
        topic_arn:
          type: string
        topic_name:
          type: string
        queues:
          type: array
          items:
            $ref: '#/components/schemas/PubSubQueueStackInfo'
    ParameterResourceStackInfo:
      type: object
      required:
        - parameters
      properties:
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/ParameterStackInfo'
    SecretsResourceStackInfo:
      type: object
      properties:
        secrets:
          type: array
          items:
            $ref: '#/components/schemas/SecretStackInfo'
    PostgresResourceStackInfo:
      type: object
      properties:
        endpoint:
          type: string
        port:
          type: integer
        arn:
          type: string
        secret_arn:
          type: string
        secret_name:
          type: string
    RoleResourceStackInfo:
      type: object
      properties:
        role_arn:
          type: string
        role_name:
          type: string
    ECSImageStackInfo:
      type: object
      properties:
        cluster_arn:
          type: string
        cluster_name:
          type: string
        service_name:
          type: string
        service_arn:
          type: string
        task_definition_arn:
          type: string
        load_balancer_arn:
          type: string
        load_balancer_dns_name:
          type: string
        target_group_arn:
          type: string
        service_url:
          type: string
        task_role_arn:
          type: string
        task_role_name:
          type: string
        execution_role_arn:
          type: string
        execution_role_name:
          type: string
    ResourceType:
      type: string
      description: models.ResourceType in paas-lib.
      enum:
        - s3
        - event_bus
        - lambda
        - api_gateway
        - cognito
        - cron
        - dynamodb
        - opensearch
        - pub_sub
        - parameter
        - secrets
        - postgres
        - role
        - ecs_image
    AttributeType:
      type: string
      description: models.AttributeType (Cognito custom attributes, paas-lib).
      enum:
        - String
        - Number
        - Date
        - Bool
    ProjectionType:
      type: string
      description: models.ProjectionType (paas-lib).
      enum:
        - ALL
        - KEYS_ONLY
        - INCLUDE
    Encryption:
      type: string
      description: models.Encryption for pub/sub queues (paas-lib).
      enum:
        - UNENCRYPTED
        - KMS_MANAGED
        - KMS
        - SSL_MANAGED
      x-enum-varnames:
        - EncryptionUnencrypted
        - EncryptionKMS
        - EncryptionKMSKey
        - EncryptionSSL
    PrincipalType:
      type: string
      description: models.PrincipalType (paas-lib).
      enum:
        - FEDERATED
    Condition:
      type: object
      required:
        - type
        - key
        - value
      properties:
        type:
          type: string
        key:
          type: string
        value:
          type: array
          items:
            type: string
    PolicyStatementEffect:
      type: string
      description: models.PolicyStatementEffect (paas-lib).
      enum:
        - Allow
        - Deny
    ResourceStatus:
      type: string
      description: models.ResourceStatus (paas-lib).
      enum:
        - DEFINED
        - MODIFIED
        - DEPLOYED
    EventbusRule:
      type: object
      description: JSON field names match internal/app/resources.EventbusRule.
      properties:
        ruleName:
          type: string
        ruleArn:
          type: string
    PubSubQueueStackInfo:
      type: object
      properties:
        type:
          type: string
        queue_arn:
          type: string
        queue_name:
          type: string
    ParameterStackInfo:
      type: object
      properties:
        arn:
          type: string
        type:
          type: string
        name:
          type: string
    SecretStackInfo:
      type: object
      properties:
        arn:
          type: string
        name:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token in the Authorization header (e.g. JWT / Cognito access
        token).
    ApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: API key in the X-Api-Key header.

````