WHAT YOU'LL LEARN
  • every Infra.* extension and the props it accepts

Overview
anchor

Infra.* extensions configure cloud infrastructure: AWS settings, encryption, networking, conditional rendering, and lifecycle hooks for each application (Admin, Api, Core).


Infra.Encryption
anchor

Configures AES-GCM encryption for the API’s EncryptionService, used for encrypting sensitive data stored in the database.

PropTypeRequiredDescription
passphrasestringYesPassphrase used to derive the AES key via scrypt
saltstringNoscrypt salt. Ensures different keys for the same passphrase across environments.
algorithm"aes-128-gcm" \| "aes-192-gcm" \| "aes-256-gcm"NoAES-GCM variant. Defaults to aes-256-gcm.

Infra.OpenSearch
anchor

Enables and configures Amazon OpenSearch for the project.

PropTypeRequiredDescription
enabledbooleanNoWhether to enable OpenSearch. Defaults to false.
domainNamestringNoExisting OpenSearch domain name. When set, Webiny uses that domain instead of deploying a new one.
indexPrefixstringNoPrefix added to all OpenSearch index names.
sharedIndexesbooleanNoWhen true, a single set of indexes is shared across all environments. Defaults to false.
endpointstringNoEndpoint of an existing OpenSearch cluster (useful when using a custom domain).
usernamestringNoUsername for OpenSearch authentication.
passwordstringNoPassword for OpenSearch authentication.

Infra.Vpc
anchor

Deploys Webiny Lambda functions and OpenSearch into a VPC, or connects them to an existing one.

PropTypeRequiredDescription
enabledbooleanYesWhether to enable VPC integration.
useVpcEndpointsbooleanNoWhether to create VPC endpoints for AWS services.
useExistingVpcobjectNoConnect to an existing VPC instead of creating one. See shape below.

useExistingVpc shape:

Infra.BlueGreenDeployments
anchor

Enables blue/green deployment support, routing traffic between two parallel environments via weighted CloudFront distributions.

PropTypeRequiredDescription
enabledbooleanYesWhether to enable blue/green deployments.
domainsobjectYesCustom domain and certificate configuration. See shape below.
deployments[deployment, deployment]YesExactly two deployment descriptors. See shape below.

domains shape:

Each deployment object:

Infra.PulumiResourceNamePrefix
anchor

Overrides the default wby- prefix applied to all Pulumi resource names.

PropTypeRequiredDescription
prefixstringYesCustom prefix for all Pulumi-managed resource names

Infra.ProductionEnvironments
anchor

Declares which environment names are treated as production. Affects Infra.Env.IsProd and Infra.Env.IsNotProd.

PropTypeRequiredDescription
environmentsstring[]YesEnvironment names to treat as production (letters, numbers, dashes, and underscores only)

Infra.EnvVar
anchor

Sets an environment variable available during builds and deployments.

PropTypeRequiredDescription
varNamestringYesEnvironment variable name
valuestringYesEnvironment variable value

Can be used multiple times.


Infra.Aws
anchor

Infra.Aws.DefaultRegion
anchor

Sets the default AWS region for all deployments.

PropTypeRequiredDescription
namestringYesAWS region name (e.g. "us-east-1")

Infra.Aws.Tags
anchor

Applies AWS resource tags to all Pulumi-managed resources. Can be used multiple times — tags from multiple instances are merged.

PropTypeRequiredDescription
tagsRecord<string, string>YesKey-value map of AWS tags to apply

Infra.Env
anchor

Conditionally renders child extensions based on the current environment, variant, or AWS region.

Infra.Env.Is / Infra.Env.IsNot
anchor

Infra.Env.Is renders children when conditions match; Infra.Env.IsNot renders when they do not. Multiple props are AND-ed.

PropTypeRequiredDescription
envstring \| string[]NoEnvironment name(s) to match
variantstring \| string[]NoVariant name(s) to match
regionstring \| string[]NoAWS region(s) to match
childrenReactNodeYesExtensions to render when the condition is met
webiny.config.tsx

Infra.Env.IsProd / Infra.Env.IsNotProd
anchor

Shorthand for Infra.Env.Is / Infra.Env.IsNot matched against the environments declared in Infra.ProductionEnvironments.

PropTypeRequiredDescription
childrenReactNodeYesExtensions to render

Infra.Ci
anchor

Conditionally renders child extensions based on whether the process is running in a CI environment.

Infra.Ci.Is / Infra.Ci.IsNot
anchor

PropTypeRequiredDescription
childrenReactNodeYesExtensions to render

Infra.Admin
anchor

Extensions that target the Admin application’s build, deployment, and cloud infrastructure.

Lifecycle Hooks
anchor

All six extensions accept a single src prop pointing to an implementation file. All can be used multiple times.

ExtensionTriggered
Infra.Admin.BeforeBuildBefore the Admin app is built
Infra.Admin.AfterBuildAfter the Admin app is built
Infra.Admin.BeforeDeployBefore the Admin app is deployed
Infra.Admin.AfterDeployAfter the Admin app is deployed
Infra.Admin.BeforeWatchBefore webiny watch starts for Admin
Infra.Admin.PulumiDuring Pulumi deployment — modify Admin cloud infrastructure
PropTypeRequiredDescription
srcstringYesPath to the implementation file

Infra.Admin.CustomDomains
anchor

Connects a custom domain to the Admin CloudFront distribution. See Connect Custom Domain for a full guide.

PropTypeRequiredDescription
domainsstring[]YesOne or more custom domain names
certificateArnstringYesARN of the ACM certificate (must be in us-east-1)
sslMethod"sni-only" \| "vip"NoSSL/TLS method. Defaults to "sni-only".

Infra.Admin.StackOutputValue
anchor

Adds a custom key-value entry to the Admin Pulumi stack outputs. Can be used multiple times.

PropTypeRequiredDescription
keystringYesOutput key name
valueanyYesOutput value

Infra.Api
anchor

Extensions that target the API application’s build, deployment, and cloud infrastructure.

Lifecycle Hooks
anchor

All six extensions accept a single src prop pointing to an implementation file. All can be used multiple times.

ExtensionTriggered
Infra.Api.BeforeBuildBefore the API app is built
Infra.Api.AfterBuildAfter the API app is built
Infra.Api.BeforeDeployBefore the API app is deployed
Infra.Api.AfterDeployAfter the API app is deployed
Infra.Api.BeforeWatchBefore webiny watch starts for API
Infra.Api.PulumiDuring Pulumi deployment — modify API cloud infrastructure
PropTypeRequiredDescription
srcstringYesPath to the implementation file

Infra.Api.CustomDomains
anchor

Connects a custom domain to the API CloudFront distribution. See Connect Custom Domain for a full guide.

PropTypeRequiredDescription
domainsstring[]YesOne or more custom domain names
certificateArnstringYesARN of the ACM certificate (must be in us-east-1)
sslMethod"sni-only" \| "vip"NoSSL/TLS method. Defaults to "sni-only".

Infra.Api.LambdaFunction
anchor

Adds a fully custom Lambda function to the API application, with both an application handler and Pulumi infrastructure code. Can be used multiple times.

PropTypeRequiredDescription
functionSrcstringYesPath to the Lambda handler source file
pulumiSrcstringYesPath to the Pulumi infrastructure file (must follow ApiPulumi abstraction)

Infra.Api.StackOutputValue
anchor

Adds a custom key-value entry to the API Pulumi stack outputs. Can be used multiple times.

PropTypeRequiredDescription
keystringYesOutput key name
valueanyYesOutput value

Infra.Core
anchor

Extensions that target the Core application — the shared infrastructure layer (DynamoDB tables, Cognito user pool, S3 buckets).

Lifecycle Hooks
anchor

All six extensions accept a single src prop pointing to an implementation file. All can be used multiple times.

ExtensionTriggered
Infra.Core.BeforeBuildBefore the Core app is built
Infra.Core.AfterBuildAfter the Core app is built
Infra.Core.BeforeDeployBefore the Core app is deployed
Infra.Core.AfterDeployAfter the Core app is deployed
Infra.Core.BeforeWatchBefore webiny watch starts for Core
Infra.Core.PulumiDuring Pulumi deployment — modify Core cloud infrastructure
PropTypeRequiredDescription
srcstringYesPath to the implementation file

Infra.Core.StackOutputValue
anchor

Adds a custom key-value entry to the Core Pulumi stack outputs. Can be used multiple times.

PropTypeRequiredDescription
keystringYesOutput key name
valueanyYesOutput value