Agent Skillswebiny/webiny-js › webiny-infrastructure-extensions

webiny-infrastructure-extensions

GitHub

用于通过Pulumi和声明式组件自定义AWS基础设施,支持配置VPC、OpenSearch、蓝绿部署及环境条件设置。

skills/user-skills/infrastructure-extensions/SKILL.md webiny/webiny-js

Trigger Scenarios

需要修改或扩展AWS云资源配置时 配置基础设施的声明式参数如区域、标签、域名时

Install

npx skills add webiny/webiny-js --skill webiny-infrastructure-extensions -g -y
More Options

Non-standard path

npx skills add https://github.com/webiny/webiny-js/tree/next/skills/user-skills/infrastructure-extensions -g -y

Use without installing

npx skills use webiny/webiny-js@webiny-infrastructure-extensions

指定 Agent (Claude Code)

npx skills add webiny/webiny-js --skill webiny-infrastructure-extensions -a claude-code -g -y

安装 repo 全部 skill

npx skills add webiny/webiny-js --all -g -y

预览 repo 内 skill

npx skills add webiny/webiny-js --list

SKILL.md

Frontmatter
{
    "name": "webiny-infrastructure-extensions",
    "description": "Modifying AWS infrastructure using Pulumi handlers and declarative Infra components. Use this skill when the developer wants to customize AWS infrastructure, add Pulumi handlers, configure OpenSearch, VPC, resource tags, regions, custom domains, blue-green deployments, environment-conditional config, or manage production vs development infrastructure modes. Covers CorePulumi.Interface, all <Infra.*> declarative components, and <Infra.Env.Is>."
}

Infrastructure Extensions

TL;DR

Infrastructure extensions modify your AWS infrastructure using Pulumi handlers and declarative <Infra.*> components in webiny.config.tsx. Pulumi handlers implement CorePulumi.Interface and are registered via <Infra.Core.Pulumi>. Declarative components configure OpenSearch, VPC, tags, regions, custom domains, blue-green deployments, and environment-specific settings.

Pulumi Handler Pattern

Write custom Pulumi code that runs during infrastructure deployment:

// extensions/MyCorePulumiHandler.ts
import { Ui } from "webiny/infra";
import { CorePulumi } from "webiny/infra/core";

class MyCorePulumiHandlerImpl implements CorePulumi.Interface {
  constructor(private ui: Ui.Interface) {}

  execute(app: any) {
    this.ui.info("Executing MyCorePulumiHandler with environment:", app.env);

    // Access and modify Pulumi resources here
    // app.resources gives you access to all provisioned resources
  }
}

export default CorePulumi.createImplementation({
  implementation: MyCorePulumiHandlerImpl,
  dependencies: [Ui]
});

Register (YOU MUST include the .ts file extension in the src prop — omitting it will cause a build failure):

<Infra.Core.Pulumi src={"/extensions/MyCorePulumiHandler.ts"} />

Use Cases for Pulumi Handlers

  • Add custom AWS resources (CloudWatch alarms, extra S3 buckets, Lambda functions)
  • Modify existing resource properties (Lambda memory, timeouts, environment variables)
  • Add conditional infrastructure based on environment
  • Integrate with third-party infrastructure providers

Declarative Infrastructure Components

These components go directly in webiny.config.tsx -- no separate extension file needed:

AWS Configuration

{/* Set the AWS region */}
<Infra.Aws.DefaultRegion name={"us-east-1"} />

{/* Apply tags to all AWS resources -- multiple calls are merged */}
<Infra.Aws.Tags tags={{ OWNER: "me", PROJECT: "my-project" }} />
<Infra.Aws.Tags tags={{ COST_CENTER: "engineering" }} />

Search & Networking

{
  /* Enable/disable OpenSearch */
}
<Infra.OpenSearch enabled={true} />;

{
  /* Enable/disable VPC deployment */
}
<Infra.Vpc enabled={false} />;

Resource Naming

{
  /* Prefix all Pulumi resource names */
}
<Infra.PulumiResourceNamePrefix prefix={"myproj-"} />;

{
  /* Define which environments use production-grade infrastructure */
}
<Infra.ProductionEnvironments environments={["prod", "staging"]} />;

Custom Domains

<Infra.Admin.CustomDomains
  domains={["admin.example.com"]}
  sslMethod="sni-only"
  certificateArn="arn:aws:acm:us-east-1:123456789:certificate/abc-123"
/>

Blue-Green Deployments

<Infra.BlueGreenDeployments
  enabled={true}
  domains={{
    acmCertificateArn: "arn:aws:acm:us-east-1:123456789:certificate/abc-123",
    sslSupportMethod: "sni-only",
    domains: {
      api: ["api.example.com"],
      admin: ["admin.example.com"],
      website: ["website.example.com"],
      preview: ["preview.example.com"]
    }
  }}
  deployments={[
    { name: "green", env: "dev", variant: "green" },
    { name: "blue", env: "dev", variant: "blue" }
  ]}
/>

Environment-Conditional Configuration

Use <Infra.Env.Is> to apply settings only in specific environments:

{
  /* Production only */
}
<Infra.Env.Is env="prod">
  <Infra.Aws.Tags tags={{ ENV: "production" }} />
  <Infra.OpenSearch enabled={true} />
</Infra.Env.Is>;

{
  /* Non-production (accepts array) */
}
<Infra.Env.Is env={["dev", "staging"]}>
  <Infra.Aws.Tags tags={{ ENV: "non-production" }} />
  <Infra.OpenSearch enabled={false} />
</Infra.Env.Is>;

Project-Level Settings

{
  /* Disable telemetry */
}
<Project.Telemetry enabled={false} />;

{
  /* Auto-install for CI/CD (skip the installation wizard) */
}
{
  process.env.WEBINY_CLI_AUTO_INSTALL && (
    <Project.AutoInstall
      adminUser={{
        firstName: "Ad",
        lastName: "Min",
        email: "admin@webiny.com",
        password: "12345678"
      }}
    />
  );
}

All Infrastructure Components Reference

Component Purpose
<Infra.Aws.DefaultRegion name="..." /> Set the AWS region
<Infra.Aws.Tags tags={{ ... }} /> Tag all AWS resources
<Infra.OpenSearch enabled={bool} /> Enable/disable OpenSearch cluster
<Infra.Vpc enabled={bool} /> Enable/disable VPC deployment
<Infra.PulumiResourceNamePrefix prefix="..." /> Prefix Pulumi resource names
<Infra.ProductionEnvironments environments={[...]} /> Define production-grade environments
<Infra.Admin.CustomDomains ... /> Custom domains for Admin app
<Infra.BlueGreenDeployments ... /> Blue-green deployment configuration
<Infra.Env.Is env="..." /> Conditional config per environment
<Infra.Core.Pulumi src="..." /> Register a custom Pulumi handler
<Project.Telemetry enabled={bool} /> Enable/disable telemetry
<Project.AutoInstall adminUser={{ ... }} /> Auto-install for CI/CD

Quick Reference

Pulumi import:   import { CorePulumi } from "webiny/infra/core";
Ui import:       import { Ui } from "webiny/infra";
Interface:       CorePulumi.Interface
Export:          CorePulumi.createImplementation({ implementation, dependencies })
Register:        <Infra.Core.Pulumi src={"/extensions/MyHandler.ts"} />
Deploy:          yarn webiny deploy core  (infrastructure changes)

Related Skills

  • webiny-project-structure -- Full webiny.config.tsx anatomy
  • webiny-local-development -- Deployment commands and environment management
  • webiny-full-stack-architect -- Full-stack extensions that may require custom infrastructure

Version History

  • 80eb1c5 Current 2026-08-20 10:09

Same Skill Collection

.claude/skills/grill-me/SKILL.md
.claude/skills/prd-to-plan/SKILL.md
.claude/skills/preflight/SKILL.md
.claude/skills/tester/SKILL.md
.claude/skills/write-a-prd/SKILL.md
skills/repo-skills/add-feature-flag/SKILL.md
skills/user-skills/admin/admin-architect/SKILL.md
skills/user-skills/admin/admin-permissions/SKILL.md
skills/user-skills/admin/form-model/SKILL.md
skills/user-skills/admin/new-entry-wizard/SKILL.md
skills/user-skills/admin/website-builder/page-settings/SKILL.md
skills/user-skills/admin/website-builder/wb-preview-url-modifier/SKILL.md
skills/user-skills/api-bundle-size-limit/SKILL.md
skills/user-skills/api/api-architect/SKILL.md
skills/user-skills/api/cms-bulk-actions/SKILL.md
skills/user-skills/api/custom-field-type/SKILL.md
skills/user-skills/api/event-handler-pattern/SKILL.md
skills/user-skills/api/graphql-api/SKILL.md
skills/user-skills/api/http-route/SKILL.md
skills/user-skills/api/permissions/SKILL.md
skills/user-skills/api/use-case-pattern/SKILL.md
skills/user-skills/api/v5-to-v6-migration/SKILL.md
skills/user-skills/api/websocket-notifications/SKILL.md
skills/user-skills/cli-extensions/SKILL.md
skills/user-skills/configure-auth0/SKILL.md
skills/user-skills/configure-entraid/SKILL.md
skills/user-skills/configure-okta/SKILL.md
skills/user-skills/dependency-injection/SKILL.md
skills/user-skills/full-stack-architect/SKILL.md
skills/user-skills/generated/api/aco/SKILL.md
skills/user-skills/generated/api/cms/SKILL.md
skills/user-skills/generated/api/file-manager/SKILL.md
skills/user-skills/generated/api/scheduler/SKILL.md
skills/user-skills/generated/api/security/SKILL.md
skills/user-skills/generated/api/system/SKILL.md
skills/user-skills/generated/api/tenancy/SKILL.md
skills/user-skills/generated/api/tenant-manager/SKILL.md
skills/user-skills/generated/api/website-builder/SKILL.md
skills/user-skills/generated/infra/SKILL.md
skills/user-skills/local-development/SKILL.md
skills/user-skills/mailer-smtp/SKILL.md
skills/user-skills/project-structure/SKILL.md
.claude/skills/webiny-skill-creator/SKILL.md
skills/user-skills/admin/ui-extensions/SKILL.md
skills/user-skills/api/ai-powerups-content/SKILL.md
skills/user-skills/cognito-federation/SKILL.md
skills/user-skills/content-models/SKILL.md
skills/user-skills/generated/admin/aco/SKILL.md
skills/user-skills/generated/admin/ai-powerups/SKILL.md

Metadata

Files
0
Version
80eb1c5
Hash
69e746a6
Indexed
2026-08-20 10:09

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-22 06:18
浙ICP备14020137号-1 $mapa de visitantes$