Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
boise-state-development avatar

Cors Deployment

  • 3 installs
  • 15 repo stars
  • Updated August 3, 2026
  • boise-state-development/agentcore-public-stack

cors-deployment is a Claude Code skill that documents CORS configuration across CDK stacks, GitHub Actions workflows, and Python backends.

About

cors-deployment is a Claude Code skill documenting how CORS is configured across all CDK stacks, GitHub Actions workflows, and Python backends in this monorepo. It describes a two-layer origin model derived from CDK_DOMAIN_NAME and CDK_CORS_ORIGINS, a shared buildCorsOrigins helper, and how workflow env vars must be set at the job level. A developer uses it when modifying CORS origins, adding a stack that needs CORS, or debugging CORS errors in deployed environments. It also documents the exact steps to add CORS to a new stack.

  • Configures CORS across CDK stacks, GitHub Actions workflows, and Python backends
  • Uses a shared buildCorsOrigins helper deriving origins from CDK_DOMAIN_NAME and CDK_CORS_ORIGINS
  • Lists common mistakes like workflow-level vars.* resolving to empty strings

Cors Deployment by the numbers

  • 3 all-time installs (skills.sh)
  • Ranked #1,119 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
At a glance

cors-deployment capabilities & compatibility

Capabilities
configure cors · debug cors errors · manage workflow env
Works with
aws · github
Use cases
devops · ci cd
Runs
Runs locally
Pricing
Free
From the docs

What cors-deployment says it does

CORS configuration across all CDK stacks, GitHub Actions workflows, and Python backends.
SKILL.md
localhost is NEVER auto-included. Use `CDK_CORS_ORIGINS=http://localhost:4200` for local dev.
SKILL.md
Putting `vars.*` in workflow-level `env:` → resolves to empty string
SKILL.md
npx skills add https://github.com/boise-state-development/agentcore-public-stack --skill cors-deployment

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs3
repo stars15
Last updatedAugust 3, 2026
Repositoryboise-state-development/agentcore-public-stack

What it does

Configure and debug CORS origins across CDK stacks, workflows, and Python backends.

Who is it for?

Developers modifying CORS origins or adding CORS to new CDK stacks in this monorepo

Skip if: Hardcoding localhost origins or setting corsOrigins in cdk.context.json, both of which the skill warns against

When should I use this skill?

modifying CORS origins, adding a stack that needs CORS, or debugging CORS errors in a deployed environment

What you get

New and existing stacks resolve a correct, deduplicated CORS origin list from CDK_DOMAIN_NAME and CDK_CORS_ORIGINS.

  • CORS-configured CDK stacks
  • correct workflow env blocks
  • CORS test coverage

By the numbers

  • 7 config sections with additionalCorsOrigins
  • 6-step process to add CORS to a new stack

Files

SKILL.mdMarkdownGitHub ↗

CORS Deployment Configuration

Architecture

CORS is configured via a two-layer model applied identically to every stack:

1. CDK_DOMAIN_NAME → auto-applied as https://{value} (always) 2. CDK_CORS_ORIGINS → additional global origins (optional, comma-separated) 3. Per-section CDK_*_CORS_ORIGINS → stack-specific extras (optional)

localhost is NEVER auto-included. Use CDK_CORS_ORIGINS=http://localhost:4200 for local dev.

The Helper

Every stack uses buildCorsOrigins(config, additionalOrigins?) from infrastructure/lib/config.ts. This returns a deduplicated string[].

// Container env var (Fargate / AgentCore Runtime)
CORS_ORIGINS: buildCorsOrigins(config, config.appApi.additionalCorsOrigins).join(','),

// S3 bucket CORS rule
cors: [{ allowedOrigins: buildCorsOrigins(config, config.fileUpload?.additionalCorsOrigins) }]

Config Derivation (config.ts)

CDK_DOMAIN_NAME → domainName → "https://{domainName}"  (always first)
CDK_CORS_ORIGINS → extraCorsOrigins                     (appended)
Result: config.corsOrigins = "https://{domainName},{extras}"

Both are joined into config.corsOrigins. The helper then splits, deduplicates, and optionally appends section extras.

Python Backend

Both app_api/main.py and inference_api/main.py read CORS_ORIGINS env var:

_cors_origins = os.environ.get("CORS_ORIGINS", "").split(",")

No hardcoded fallback. If CORS_ORIGINS is empty, no origins are allowed.

Workflow Requirements

CDK_DOMAIN_NAME and CDK_CORS_ORIGINS MUST be in the job-level env: block (not workflow-level) because they use vars.* which requires environment: on the job.

Every workflow that runs synth or deploy must include:

env:
  CDK_DOMAIN_NAME: ${{ vars.CDK_DOMAIN_NAME }}
  CDK_CORS_ORIGINS: ${{ vars.CDK_CORS_ORIGINS }}

Per-Section Config Interfaces

Every config section that consumes CORS has additionalCorsOrigins?: string:

  • AppApiConfig.additionalCorsOrigins
  • InferenceApiConfig.additionalCorsOrigins
  • FrontendConfig.additionalCorsOrigins
  • FileUploadConfig.additionalCorsOrigins
  • RagIngestionConfig.additionalCorsOrigins
  • AssistantsConfig.additionalCorsOrigins
  • FineTuningConfig.additionalCorsOrigins

Adding CORS to a New Stack

1. Import buildCorsOrigins from ./config 2. Call buildCorsOrigins(config, config.mySection.additionalCorsOrigins) 3. Add additionalCorsOrigins?: string to the section's config interface 4. Load it in loadConfig(): additionalCorsOrigins: process.env.CDK_MY_SECTION_CORS_ORIGINS || ... 5. Add CDK_DOMAIN_NAME and CDK_CORS_ORIGINS to the workflow job env 6. Add a test in infrastructure/test/cors.test.ts

Common Mistakes

  • Putting vars.* in workflow-level env: → resolves to empty string
  • Hardcoding http://localhost:4200 in buildCorsOrigins or Python fallback
  • Forgetting to add CDK_DOMAIN_NAME to a new workflow's synth/deploy jobs
  • Using config.domainName directly instead of buildCorsOrigins()
  • Setting corsOrigins in cdk.context.json (overrides domain derivation)

Related skills

FAQ

Why must CDK_DOMAIN_NAME be in the job-level env block?

Because it uses vars.* which requires environment: on the job; putting it at workflow level resolves to an empty string.

Is localhost included by default?

No, localhost is never auto-included; set CDK_CORS_ORIGINS=http://localhost:4200 for local dev.

DevOps & CI/CDdeployinfra

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.