本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)8.1k · #12613

webiny-infrastructure-extensions

できること

Pulumiのハンドラーと特別な設定のコンポーネントを使い、Webinyプロジェクトの AWSのインフラをカスタマイズする方法を説明します。クラウドのリソース、リージョン、デプロイのモードを変える必要がある開発者向けです。

使う場面

  • ✓Webinyプロジェクトに、追加のストレージのバケットやアラームなど、カスタムのAWSのリソースを加えたい開発者がいるとき。
  • ✓Webinyプロジェクトのカスタムドメイン、VPC、リソースのタグを設定する必要があるとき。
  • ✓本番環境と開発環境で、異なるインフラの設定がほしいとき。

スキルのリンク

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/infrastructure-extensions/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/webiny/webiny-js/blob/next/skills/user-skills/infrastructure-extensions/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Webinyプロジェクトのクラウドのセットアップに、追加のS3バケットを加えるにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

開発者は、クラウドのセットアップを変える小さなコードのハンドラーを書き、それをプロジェクトの設定ファイルに登録します。スキルは、どの設定を使い、どこに置くかを説明します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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

OpenSearch, DynamoDB and the S3 bucket belong to the Core app, so they live under Infra.Core. The older top-level names (Infra.OpenSearch, Infra.DynamoDb, Infra.S3Bucket) still work and point at the same components.

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

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

Backups

Both are on by default for production environments and off for all others. Set enabled to override that in either direction.

{
  /* DynamoDB point-in-time recovery (primary, audit logs and, with OpenSearch, the ddb-os table) */
}
<Infra.Core.DynamoDb.Pitr enabled={false} />;

{
  /* S3 versioning on the File Manager bucket */
}
<Infra.Core.S3Bucket.Versioning 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.Core.OpenSearch enabled={true} />
</Infra.Env.Is>;

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

Project-Level Settings

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

{
  /* Auto-install for CI/CD (skip the installation wizard)
よくある質問

カスタムのコードはどこに置きますか?

ハンドラーのファイルに置き、特別なコンポーネントを使ってwebiny.config.tsxファイルに登録します。ファイルのパスには.tsの拡張子が必要です。

これでOpenSearchを設定できますか?

はい。スキルは、VPC、リージョン、タグと並んで、組み込みの設定の一つとしてOpenSearchを扱っています。

本番と開発の違いも扱いますか?

はい。本番と開発のモードで、異なるインフラの設定をする方法を説明しています。

詳細

作者による元の説明

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>.

repo: webiny/webiny-js

人気

GitHubのスター
8.1k
ランキング
#12613
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル