The goal of this project is to make it easy to deploy a static website, generated by Wordpress as simple and cost-effective as possible.
It's largely inspired by TechToSpeech/terraform-aws-serverless-static-wordpress, but uses AWS CDK instead of Terraform.
It creates the infrastructure to launch a temporary, transient Wordpress container. You then log in and customize it like any Wordpress site, and finally publish it as a static site fronted by a global CloudFront CDN and S3 Origin. When you’re done you shut down the Wordpress container and it costs you almost nothing.
WP2Static is used to generate the static site from the Wordpress container.
This was a fun side project, but recent external changes have made it challenging to run Wordpress in a cost-efficient manner.
-
The deprecation of AWS RDS Serverless v1 means that AWS no longer offers a managed MySQL database instance that can scale to 0 when not in use. I considered a few ideas to work around this, but ultimately I decided that the workarounds wouldn't match my personal use case.
-
WP2Static is quite slow, and many issues go unaddressed. It seems like they're actively pushing their hosted / paid solution, which is fine, but it means that the OSS version doesn't much attention.
-
I couldn't find a good solution to store images and other media files in a cost-effective manner. Wordpress stores uploads in EFS, which is quite expensive for this use case. My primary use case was to host a travel blog with lots of high-quality images, so this was also an annoyance.
-
Wordpress is a pain, in general. It's really a beast to maintain. I broke the image several times trying to keep the dependencies up-to-date. I'm not a Wordpress expert, so I found it challenging to debug.
For these reasons, I've decided to no longer maintain this package. If anyone would like to pick up the torch and continue maintaining this project, please feel free to fork it!
-
If you like the idea of this package, you could keep an eye on TechToSpeech/terraform-aws-serverless-static-wordpress. That project was the original inspiration for this CDK rewrite. However, that repository still uses Aurora Serverless V1 and hasn't received much attention lately (at time of writing - May 2024, it hasn't been updated in > 2 years).
-
Consider a tool designed specifically for static site generation. For me, I migrated my project to use Astro. I used lonekorean/wordpress-export-to-markdown to export my content from Wordpress to Markdown, and then I manually copied the exported files into my Astro project. It required a bit of manual translation, but it worked great for my use case. Astro is very fast compared to WP2Static (for my use case > 100x faster) and is designed for this use case. You can also use Astro with many other CMS tools if you don't want to write Markdown.
-
I've been keeping my eyes on Webiny, a truly serverless CMS tool. This didn't quite work for my use case, but it might work for you.
If you'd like to take a final backup, you can use a tool like Updraft Plus. This will create a portable backup you can use to restore your Wordpress instance somewhere else (e.g., Lightsail, a hosted Wordpress provider, etc.).
Then, destroy the resources created CDK Static Wordpress by running cdk destroy
. This will remove all the resources
associated with the project.
-
Install the construct:
yarn add @blimmer/cdk-static-wordpress # or npm i --save @blimmer/cdk-static-wordpress
-
Instantiate a
StaticWordpress
instance aStack
:import { StaticWordpress } from "@blimmer/cdk-static-wordpress"; import { Stack, StackProps } from "aws-cdk-lib"; import { HostedZone } from "aws-cdk-lib/aws-route53"; import { Construct } from "constructs"; export class StaticWordpressStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); // You can create or import a hosted zone // See https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53.HostedZone.html const exampleHostedZone = new HostedZone(this, "ExampleHostedZone", { zoneName: "example.com", }); new StaticWordpress(this, "StaticWordpress", { fullyQualifiedSiteName: "blog.example.com", hostedZone: exampleHostedZone, wordpressAdminProps: { email: "me@example.com", }, }); } }
-
Deploy with the
cdk deploy
command -
Once the deployment completes, visit the Wordpress console at
admin-<fullyQualifiedSiteName>
. E.g., if your static site isblog.example.com
, visitadmin-blog.example.com/wp-admin
. The default password for the wordpress user ischangeme
(please change it 😄). -
Customize Wordpress as you see fit, create posts, etc.
-
When you're ready to deploy your static site, trigger WP2Static.
-
Visit your static site (e.g.,
blog.example.com
) once WP2Static completes. -
(optional) Shut down the Wordpress container to save money.
new StaticWordpress(this, "StaticWordpress", { fullyQualifiedSiteName: "blog.example.com", hostedZone: exampleHostedZone, wordpressAdminProps: { email: "me@example.com", run: false, // <-- Shut down the container after deployment }, });
TODO
This construct provides escape hatches, to allow you to customize the underlying infrastructure if you need to. This is a big benefit of using CDK over Terraform (where every customizable property must be manually exposed as a variable).
Look for *Overrides
in the API docs for customization options. But, be warned, we allow overriding almost
everything, so you can easily produce invalid infrastructure if you don't know what you're doing.
import { EcsTask } from '@blimmer/cdk-static-wordpress'
new EcsTask(scope: Construct, id: string, props: EcsTaskProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
EcsTaskProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: EcsTaskProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { EcsTask } from '@blimmer/cdk-static-wordpress'
EcsTask.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
databaseCluster |
aws-cdk-lib.aws_rds.ServerlessCluster |
No description. |
fargateService |
aws-cdk-lib.aws_ecs.FargateService |
No description. |
fileSystem |
aws-cdk-lib.aws_efs.FileSystem |
No description. |
taskDefinition |
aws-cdk-lib.aws_ecs.FargateTaskDefinition |
No description. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly databaseCluster: ServerlessCluster;
- Type: aws-cdk-lib.aws_rds.ServerlessCluster
public readonly fargateService: FargateService;
- Type: aws-cdk-lib.aws_ecs.FargateService
public readonly fileSystem: FileSystem;
- Type: aws-cdk-lib.aws_efs.FileSystem
public readonly taskDefinition: FargateTaskDefinition;
- Type: aws-cdk-lib.aws_ecs.FargateTaskDefinition
import { StaticHosting } from '@blimmer/cdk-static-wordpress'
new StaticHosting(scope: Construct, id: string, props: StaticHostingProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
StaticHostingProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: StaticHostingProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { StaticHosting } from '@blimmer/cdk-static-wordpress'
StaticHosting.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
bucket |
aws-cdk-lib.aws_s3.Bucket |
No description. |
distribution |
aws-cdk-lib.aws_cloudfront.Distribution |
No description. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly bucket: Bucket;
- Type: aws-cdk-lib.aws_s3.Bucket
public readonly distribution: Distribution;
- Type: aws-cdk-lib.aws_cloudfront.Distribution
import { StaticWordpress } from '@blimmer/cdk-static-wordpress'
new StaticWordpress(scope: Construct, id: string, props: StaticWordpressProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
StaticWordpressProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: StaticWordpressProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { StaticWordpress } from '@blimmer/cdk-static-wordpress'
StaticWordpress.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
ecsTask |
EcsTask |
No description. |
staticHosting |
StaticHosting |
No description. |
wordpressDockerImage |
WordpressDockerImage |
No description. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly ecsTask: EcsTask;
- Type: EcsTask
public readonly staticHosting: StaticHosting;
- Type: StaticHosting
public readonly wordpressDockerImage: WordpressDockerImage;
- Type: WordpressDockerImage
import { WordpressDockerImage } from '@blimmer/cdk-static-wordpress'
new WordpressDockerImage(scope: Construct, id: string, props?: WordpressDockerImageProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
WordpressDockerImageProps |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { WordpressDockerImage } from '@blimmer/cdk-static-wordpress'
WordpressDockerImage.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
containerCpu |
number |
No description. |
containerMemory |
number |
No description. |
dockerImageAsset |
aws-cdk-lib.aws_ecr_assets.DockerImageAsset |
No description. |
wordpressMemoryLimit |
string |
No description. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly containerCpu: number;
- Type: number
public readonly containerMemory: number;
- Type: number
public readonly dockerImageAsset: DockerImageAsset;
- Type: aws-cdk-lib.aws_ecr_assets.DockerImageAsset
public readonly wordpressMemoryLimit: string;
- Type: string
BehaviorOverrides.
import { BehaviorOverrides } from '@blimmer/cdk-static-wordpress'
const behaviorOverrides: BehaviorOverrides = { ... }
Name | Type | Description |
---|---|---|
allowedMethods |
aws-cdk-lib.aws_cloudfront.AllowedMethods |
HTTP methods to allow for this behavior. |
cachedMethods |
aws-cdk-lib.aws_cloudfront.CachedMethods |
HTTP methods to cache for this behavior. |
cachePolicy |
aws-cdk-lib.aws_cloudfront.ICachePolicy |
The cache policy for this behavior. |
compress |
boolean |
Whether you want CloudFront to automatically compress certain files for this cache behavior. |
edgeLambdas |
aws-cdk-lib.aws_cloudfront.EdgeLambda[] |
The Lambda@Edge functions to invoke before serving the contents. |
functionAssociations |
aws-cdk-lib.aws_cloudfront.FunctionAssociation[] |
The CloudFront functions to invoke before serving the contents. |
originRequestPolicy |
aws-cdk-lib.aws_cloudfront.IOriginRequestPolicy |
The origin request policy for this behavior. |
responseHeadersPolicy |
aws-cdk-lib.aws_cloudfront.IResponseHeadersPolicy |
The response headers policy for this behavior. |
smoothStreaming |
boolean |
Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior. |
trustedKeyGroups |
aws-cdk-lib.aws_cloudfront.IKeyGroup[] |
A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies. |
viewerProtocolPolicy |
aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy |
The protocol that viewers can use to access the files controlled by this behavior. |
public readonly allowedMethods: AllowedMethods;
- Type: aws-cdk-lib.aws_cloudfront.AllowedMethods
- Default: AllowedMethods.ALLOW_GET_HEAD
HTTP methods to allow for this behavior.
public readonly cachedMethods: CachedMethods;
- Type: aws-cdk-lib.aws_cloudfront.CachedMethods
- Default: CachedMethods.CACHE_GET_HEAD
HTTP methods to cache for this behavior.
public readonly cachePolicy: ICachePolicy;
- Type: aws-cdk-lib.aws_cloudfront.ICachePolicy
- Default: CachePolicy.CACHING_OPTIMIZED
The cache policy for this behavior.
The cache policy determines what values are included in the cache key, and the time-to-live (TTL) values for the cache.
public readonly compress: boolean;
- Type: boolean
- Default: true
Whether you want CloudFront to automatically compress certain files for this cache behavior.
See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types for file types CloudFront will compress.
public readonly edgeLambdas: EdgeLambda[];
- Type: aws-cdk-lib.aws_cloudfront.EdgeLambda[]
- Default: no Lambda functions will be invoked
The Lambda@Edge functions to invoke before serving the contents.
public readonly functionAssociations: FunctionAssociation[];
- Type: aws-cdk-lib.aws_cloudfront.FunctionAssociation[]
- Default: no functions will be invoked
The CloudFront functions to invoke before serving the contents.
public readonly originRequestPolicy: IOriginRequestPolicy;
- Type: aws-cdk-lib.aws_cloudfront.IOriginRequestPolicy
- Default: none
The origin request policy for this behavior.
The origin request policy determines which values (e.g., headers, cookies) are included in requests that CloudFront sends to the origin.
public readonly responseHeadersPolicy: IResponseHeadersPolicy;
- Type: aws-cdk-lib.aws_cloudfront.IResponseHeadersPolicy
- Default: none
The response headers policy for this behavior.
The response headers policy determines which headers are included in responses
public readonly smoothStreaming: boolean;
- Type: boolean
- Default: false
Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.
public readonly trustedKeyGroups: IKeyGroup[];
- Type: aws-cdk-lib.aws_cloudfront.IKeyGroup[]
- Default: no KeyGroups are associated with cache behavior
A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
public readonly viewerProtocolPolicy: ViewerProtocolPolicy;
- Type: aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy
- Default: ViewerProtocolPolicy.ALLOW_ALL
The protocol that viewers can use to access the files controlled by this behavior.
import { CloudFrontDistributionConfig } from '@blimmer/cdk-static-wordpress'
const cloudFrontDistributionConfig: CloudFrontDistributionConfig = { ... }
Name | Type | Description |
---|---|---|
behaviorOverrides |
BehaviorOverrides |
[ADVANCED] Override the S3 origin behaviors. |
distributionOverrides |
DistributionOverrides |
[ADVANCED] Override properties on the CloudFront distribution (e.g., add a WAF). |
public readonly behaviorOverrides: BehaviorOverrides;
- Type: BehaviorOverrides
[ADVANCED] Override the S3 origin behaviors.
public readonly distributionOverrides: DistributionOverrides;
- Type: DistributionOverrides
[ADVANCED] Override properties on the CloudFront distribution (e.g., add a WAF).
ContainerOverrides.
import { ContainerOverrides } from '@blimmer/cdk-static-wordpress'
const containerOverrides: ContainerOverrides = { ... }
Name | Type | Description |
---|---|---|
command |
string[] |
The command that is passed to the container. |
containerName |
string |
The name of the container. |
cpu |
number |
The minimum number of CPU units to reserve for the container. |
disableNetworking |
boolean |
Specifies whether networking is disabled within the container. |
dnsSearchDomains |
string[] |
A list of DNS search domains that are presented to the container. |
dnsServers |
string[] |
A list of DNS servers that are presented to the container. |
dockerLabels |
{[ key: string ]: string} |
A key/value map of labels to add to the container. |
dockerSecurityOptions |
string[] |
A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. |
entryPoint |
string[] |
The ENTRYPOINT value to pass to the container. |
environment |
{[ key: string ]: string} |
The environment variables to pass to the container. |
environmentFiles |
aws-cdk-lib.aws_ecs.EnvironmentFile[] |
The environment files to pass to the container. |
essential |
boolean |
Specifies whether the container is marked essential. |
extraHosts |
{[ key: string ]: string} |
A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. |
gpuCount |
number |
The number of GPUs assigned to the container. |
healthCheck |
aws-cdk-lib.aws_ecs.HealthCheck |
The health check command and associated configuration parameters for the container. |
hostname |
string |
The hostname to use for your container. |
image |
aws-cdk-lib.aws_ecs.ContainerImage |
The image used to start a container. |
inferenceAcceleratorResources |
string[] |
The inference accelerators referenced by the container. |
linuxParameters |
aws-cdk-lib.aws_ecs.LinuxParameters |
Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. |
logging |
aws-cdk-lib.aws_ecs.LogDriver |
The log configuration specification for the container. |
memoryLimitMiB |
number |
The amount (in MiB) of memory to present to the container. |
memoryReservationMiB |
number |
The soft limit (in MiB) of memory to reserve for the container. |
portMappings |
aws-cdk-lib.aws_ecs.PortMapping[] |
The port mappings to add to the container definition. |
privileged |
boolean |
Specifies whether the container is marked as privileged. |
readonlyRootFilesystem |
boolean |
When this parameter is true, the container is given read-only access to its root file system. |
secrets |
{[ key: string ]: aws-cdk-lib.aws_ecs.Secret} |
The secret environment variables to pass to the container. |
startTimeout |
aws-cdk-lib.Duration |
Time duration (in seconds) to wait before giving up on resolving dependencies for a container. |
stopTimeout |
aws-cdk-lib.Duration |
Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. |
systemControls |
aws-cdk-lib.aws_ecs.SystemControl[] |
A list of namespaced kernel parameters to set in the container. |
user |
string |
The user name to use inside the container. |
workingDirectory |
string |
The working directory in which to run commands inside the container. |
public readonly command: string[];
- Type: string[]
- Default: CMD value built into container image.
The command that is passed to the container.
If you provide a shell command as a single string, you have to quote command-line arguments.
public readonly containerName: string;
- Type: string
- Default: id of node associated with ContainerDefinition.
The name of the container.
public readonly cpu: number;
- Type: number
- Default: No minimum CPU units reserved.
The minimum number of CPU units to reserve for the container.
public readonly disableNetworking: boolean;
- Type: boolean
- Default: false
Specifies whether networking is disabled within the container.
When this parameter is true, networking is disabled within the container.
public readonly dnsSearchDomains: string[];
- Type: string[]
- Default: No search domains.
A list of DNS search domains that are presented to the container.
public readonly dnsServers: string[];
- Type: string[]
- Default: Default DNS servers.
A list of DNS servers that are presented to the container.
public readonly dockerLabels: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: No labels.
A key/value map of labels to add to the container.
public readonly dockerSecurityOptions: string[];
- Type: string[]
- Default: No security labels.
A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.
public readonly entryPoint: string[];
- Type: string[]
- Default: Entry point configured in container.
The ENTRYPOINT value to pass to the container.
public readonly environment: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: No environment variables.
The environment variables to pass to the container.
public readonly environmentFiles: EnvironmentFile[];
- Type: aws-cdk-lib.aws_ecs.EnvironmentFile[]
- Default: No environment files.
The environment files to pass to the container.
public readonly essential: boolean;
- Type: boolean
- Default: true
Specifies whether the container is marked essential.
If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task. All tasks must have at least one essential container.
If this parameter is omitted, a container is assumed to be essential.
public readonly extraHosts: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: No extra hosts.
A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.
public readonly gpuCount: number;
- Type: number
- Default: No GPUs assigned.
The number of GPUs assigned to the container.
public readonly healthCheck: HealthCheck;
- Type: aws-cdk-lib.aws_ecs.HealthCheck
- Default: Health check configuration from container.
The health check command and associated configuration parameters for the container.
public readonly hostname: string;
- Type: string
- Default: Automatic hostname.
The hostname to use for your container.
public readonly image: ContainerImage;
- Type: aws-cdk-lib.aws_ecs.ContainerImage
The image used to start a container.
This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. TODO: Update these to specify using classes of IContainerImage
public readonly inferenceAcceleratorResources: string[];
- Type: string[]
- Default: No inference accelerators assigned.
The inference accelerators referenced by the container.
public readonly linuxParameters: LinuxParameters;
- Type: aws-cdk-lib.aws_ecs.LinuxParameters
- Default: No Linux parameters.
Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.
For more information see KernelCapabilities.
public readonly logging: LogDriver;
- Type: aws-cdk-lib.aws_ecs.LogDriver
- Default: Containers use the same logging driver that the Docker daemon uses.
The log configuration specification for the container.
public readonly memoryLimitMiB: number;
- Type: number
- Default: No memory limit.
The amount (in MiB) of memory to present to the container.
If your container attempts to exceed the allocated memory, the container is terminated.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
public readonly memoryReservationMiB: number;
- Type: number
- Default: No memory reserved.
The soft limit (in MiB) of memory to reserve for the container.
When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
public readonly portMappings: PortMapping[];
- Type: aws-cdk-lib.aws_ecs.PortMapping[]
- Default: No ports are mapped.
The port mappings to add to the container definition.
public readonly privileged: boolean;
- Type: boolean
- Default: false
Specifies whether the container is marked as privileged.
When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).
public readonly readonlyRootFilesystem: boolean;
- Type: boolean
- Default: false
When this parameter is true, the container is given read-only access to its root file system.
public readonly secrets: {[ key: string ]: Secret};
- Type: {[ key: string ]: aws-cdk-lib.aws_ecs.Secret}
- Default: No secret environment variables.
The secret environment variables to pass to the container.
public readonly startTimeout: Duration;
- Type: aws-cdk-lib.Duration
- Default: none
Time duration (in seconds) to wait before giving up on resolving dependencies for a container.
public readonly stopTimeout: Duration;
- Type: aws-cdk-lib.Duration
- Default: none
Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.
public readonly systemControls: SystemControl[];
- Type: aws-cdk-lib.aws_ecs.SystemControl[]
- Default: No system controls are set.
A list of namespaced kernel parameters to set in the container.
public readonly user: string;
- Type: string
- Default: root
The user name to use inside the container.
public readonly workingDirectory: string;
- Type: string
- Default: /
The working directory in which to run commands inside the container.
DatabaseOverrides.
import { DatabaseOverrides } from '@blimmer/cdk-static-wordpress'
const databaseOverrides: DatabaseOverrides = { ... }
Name | Type | Description |
---|---|---|
backupRetention |
aws-cdk-lib.Duration |
The number of days during which automatic DB snapshots are retained. |
clusterIdentifier |
string |
An optional identifier for the cluster. |
copyTagsToSnapshot |
boolean |
Whether to copy tags to the snapshot when a snapshot is created. |
credentials |
aws-cdk-lib.aws_rds.Credentials |
Credentials for the administrative user. |
defaultDatabaseName |
string |
Name of a database which is automatically created inside the cluster. |
deletionProtection |
boolean |
Indicates whether the DB cluster should have deletion protection enabled. |
enableDataApi |
boolean |
Whether to enable the Data API. |
engine |
aws-cdk-lib.aws_rds.IClusterEngine |
What kind of database to start. |
parameterGroup |
aws-cdk-lib.aws_rds.IParameterGroup |
Additional parameters to pass to the database engine. |
removalPolicy |
aws-cdk-lib.RemovalPolicy |
The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. |
scaling |
aws-cdk-lib.aws_rds.ServerlessScalingOptions |
Scaling configuration of an Aurora Serverless database cluster. |
securityGroups |
aws-cdk-lib.aws_ec2.ISecurityGroup[] |
Security group. |
storageEncryptionKey |
aws-cdk-lib.aws_kms.IKey |
The KMS key for storage encryption. |
subnetGroup |
aws-cdk-lib.aws_rds.ISubnetGroup |
Existing subnet group for the cluster. |
vpc |
aws-cdk-lib.aws_ec2.IVpc |
The VPC that this Aurora Serverless cluster has been created in. |
vpcSubnets |
aws-cdk-lib.aws_ec2.SubnetSelection |
Where to place the instances within the VPC. |
public readonly backupRetention: Duration;
- Type: aws-cdk-lib.Duration
- Default: Duration.days(1)
The number of days during which automatic DB snapshots are retained.
Automatic backup retention cannot be disabled on serverless clusters. Must be a value from 1 day to 35 days.
public readonly clusterIdentifier: string;
- Type: string
- Default: A name is automatically generated.
An optional identifier for the cluster.
public readonly copyTagsToSnapshot: boolean;
- Type: boolean
- Default: true
Whether to copy tags to the snapshot when a snapshot is created.
public readonly credentials: Credentials;
- Type: aws-cdk-lib.aws_rds.Credentials
- Default: A username of 'admin' and SecretsManager-generated password
Credentials for the administrative user.
public readonly defaultDatabaseName: string;
- Type: string
- Default: Database is not created in cluster.
Name of a database which is automatically created inside the cluster.
public readonly deletionProtection: boolean;
- Type: boolean
- Default: true if removalPolicy is RETAIN, false otherwise
Indicates whether the DB cluster should have deletion protection enabled.
public readonly enableDataApi: boolean;
- Type: boolean
- Default: false
Whether to enable the Data API.
public readonly engine: IClusterEngine;
- Type: aws-cdk-lib.aws_rds.IClusterEngine
What kind of database to start.
public readonly parameterGroup: IParameterGroup;
- Type: aws-cdk-lib.aws_rds.IParameterGroup
- Default: no parameter group.
Additional parameters to pass to the database engine.
public readonly removalPolicy: RemovalPolicy;
- Type: aws-cdk-lib.RemovalPolicy
- Default: RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)
The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.
public readonly scaling: ServerlessScalingOptions;
- Type: aws-cdk-lib.aws_rds.ServerlessScalingOptions
- Default: Serverless cluster is automatically paused after 5 minutes of being idle. minimum capacity: 2 ACU maximum capacity: 16 ACU
Scaling configuration of an Aurora Serverless database cluster.
public readonly securityGroups: ISecurityGroup[];
- Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]
- Default: a new security group is created if
vpc
was provided. If thevpc
property was not provided, no VPC security groups will be associated with the DB cluster.
Security group.
public readonly storageEncryptionKey: IKey;
- Type: aws-cdk-lib.aws_kms.IKey
- Default: the default master key will be used for storage encryption
The KMS key for storage encryption.
public readonly subnetGroup: ISubnetGroup;
- Type: aws-cdk-lib.aws_rds.ISubnetGroup
- Default: a new subnet group is created if
vpc
was provided. If thevpc
property was not provided, no subnet group will be associated with the DB cluster
Existing subnet group for the cluster.
public readonly vpc: IVpc;
- Type: aws-cdk-lib.aws_ec2.IVpc
- Default: the default VPC in the account and region will be used
The VPC that this Aurora Serverless cluster has been created in.
public readonly vpcSubnets: SubnetSelection;
- Type: aws-cdk-lib.aws_ec2.SubnetSelection
- Default: the VPC default strategy if not specified.
Where to place the instances within the VPC.
If provided, the vpc
property must also be specified.
DistributionOverrides.
import { DistributionOverrides } from '@blimmer/cdk-static-wordpress'
const distributionOverrides: DistributionOverrides = { ... }
Name | Type | Description |
---|---|---|
additionalBehaviors |
{[ key: string ]: aws-cdk-lib.aws_cloudfront.BehaviorOptions} |
Additional behaviors for the distribution, mapped by the pathPattern that specifies which requests to apply the behavior to. |
certificate |
aws-cdk-lib.aws_certificatemanager.ICertificate |
A certificate to associate with the distribution. |
comment |
string |
Any comments you want to include about the distribution. |
defaultRootObject |
string |
The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution. If no default object is set, the request goes to the origin's root (e.g., example.com/). |
domainNames |
string[] |
Alternative domain names for this distribution. |
enabled |
boolean |
Enable or disable the distribution. |
enableIpv6 |
boolean |
Whether CloudFront will respond to IPv6 DNS requests with an IPv6 address. |
enableLogging |
boolean |
Enable access logging for the distribution. |
errorResponses |
aws-cdk-lib.aws_cloudfront.ErrorResponse[] |
How CloudFront should handle requests that are not successful (e.g., PageNotFound). |
geoRestriction |
aws-cdk-lib.aws_cloudfront.GeoRestriction |
Controls the countries in which your content is distributed. |
httpVersion |
aws-cdk-lib.aws_cloudfront.HttpVersion |
Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. |
logBucket |
aws-cdk-lib.aws_s3.IBucket |
The Amazon S3 bucket to store the access logs in. |
logFilePrefix |
string |
An optional string that you want CloudFront to prefix to the access log filenames for this distribution. |
logIncludesCookies |
boolean |
Specifies whether you want CloudFront to include cookies in access logs. |
minimumProtocolVersion |
aws-cdk-lib.aws_cloudfront.SecurityPolicyProtocol |
The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. |
priceClass |
aws-cdk-lib.aws_cloudfront.PriceClass |
The price class that corresponds with the maximum price that you want to pay for CloudFront service. |
sslSupportMethod |
aws-cdk-lib.aws_cloudfront.SSLMethod |
The SSL method CloudFront will use for your distribution. |
webAclId |
string |
Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution. |
public readonly additionalBehaviors: {[ key: string ]: BehaviorOptions};
- Type: {[ key: string ]: aws-cdk-lib.aws_cloudfront.BehaviorOptions}
- Default: no additional behaviors are added.
Additional behaviors for the distribution, mapped by the pathPattern that specifies which requests to apply the behavior to.
public readonly certificate: ICertificate;
- Type: aws-cdk-lib.aws_certificatemanager.ICertificate
- Default: the CloudFront wildcard certificate (*.cloudfront.net) will be used.
A certificate to associate with the distribution.
The certificate must be located in N. Virginia (us-east-1).
public readonly comment: string;
- Type: string
- Default: no comment
Any comments you want to include about the distribution.
public readonly defaultRootObject: string;
- Type: string
- Default: no default root object
The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution. If no default object is set, the request goes to the origin's root (e.g., example.com/).
public readonly domainNames: string[];
- Type: string[]
- Default: The distribution will only support the default generated name (e.g., d111111abcdef8.cloudfront.net)
Alternative domain names for this distribution.
If you want to use your own domain name, such as www.example.com, instead of the cloudfront.net domain name, you can add an alternate domain name to your distribution. If you attach a certificate to the distribution, you must add (at least one of) the domain names of the certificate to this list.
public readonly enabled: boolean;
- Type: boolean
- Default: true
Enable or disable the distribution.
public readonly enableIpv6: boolean;
- Type: boolean
- Default: true
Whether CloudFront will respond to IPv6 DNS requests with an IPv6 address.
If you specify false, CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution.
public readonly enableLogging: boolean;
- Type: boolean
- Default: false, unless
logBucket
is specified.
Enable access logging for the distribution.
public readonly errorResponses: ErrorResponse[];
- Type: aws-cdk-lib.aws_cloudfront.ErrorResponse[]
- Default: No custom error responses.
How CloudFront should handle requests that are not successful (e.g., PageNotFound).
public readonly geoRestriction: GeoRestriction;
- Type: aws-cdk-lib.aws_cloudfront.GeoRestriction
- Default: No geographic restrictions
Controls the countries in which your content is distributed.
public readonly httpVersion: HttpVersion;
- Type: aws-cdk-lib.aws_cloudfront.HttpVersion
- Default: HttpVersion.HTTP2
Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support server name identification (SNI).
public readonly logBucket: IBucket;
- Type: aws-cdk-lib.aws_s3.IBucket
- Default: A bucket is created if
enableLogging
is true
The Amazon S3 bucket to store the access logs in.
public readonly logFilePrefix: string;
- Type: string
- Default: no prefix
An optional string that you want CloudFront to prefix to the access log filenames for this distribution.
public readonly logIncludesCookies: boolean;
- Type: boolean
- Default: false
Specifies whether you want CloudFront to include cookies in access logs.
public readonly minimumProtocolVersion: SecurityPolicyProtocol;
- Type: aws-cdk-lib.aws_cloudfront.SecurityPolicyProtocol
- Default: SecurityPolicyProtocol.TLS_V1_2_2021 if the '
The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
CloudFront serves your objects only to browsers or devices that support at least the SSL version that you specify.
public readonly priceClass: PriceClass;
- Type: aws-cdk-lib.aws_cloudfront.PriceClass
- Default: PriceClass.PRICE_CLASS_ALL
The price class that corresponds with the maximum price that you want to pay for CloudFront service.
If you specify PriceClass_All, CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All, CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class.
public readonly sslSupportMethod: SSLMethod;
- Type: aws-cdk-lib.aws_cloudfront.SSLMethod
- Default: SSLMethod.SNI
The SSL method CloudFront will use for your distribution.
Server Name Indication (SNI) - is an extension to the TLS computer networking protocol by which a client indicates which hostname it is attempting to connect to at the start of the handshaking process. This allows a server to present multiple certificates on the same IP address and TCP port number and hence allows multiple secure (HTTPS) websites (or any other service over TLS) to be served by the same IP address without requiring all those sites to use the same certificate.
CloudFront can use SNI to host multiple distributions on the same IP - which a large majority of clients will support.
If your clients cannot support SNI however - CloudFront can use dedicated IPs for your distribution - but there is a prorated monthly charge for using this feature. By default, we use SNI - but you can optionally enable dedicated IPs (VIP).
See the CloudFront SSL for more details about pricing : https://aws.amazon.com/cloudfront/custom-ssl-domains/
public readonly webAclId: string;
- Type: string
- Default: No AWS Web Application Firewall web access control list (web ACL).
Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.
To specify a web ACL created using the latest version of AWS WAF, use the ACL ARN, for example
arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a
.
To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example 473e64fd-f30b-4765-81a0-62ad96dd167a
.
import { EcsOverrides } from '@blimmer/cdk-static-wordpress'
const ecsOverrides: EcsOverrides = { ... }
Name | Type | Description |
---|---|---|
containerOverrides |
aws-cdk-lib.aws_stepfunctions_tasks.ContainerOverrides |
[ADVANCED] Override properties on the Fargate Container. |
serviceOverrides |
ServiceOverrides |
[ADVANCED] Override properties on the Fargate Service. |
taskDefinitionOverrides |
TaskDefinitionOverrides |
[ADVANCED] Override properties on the Fargate Task Definition. |
public readonly containerOverrides: ContainerOverrides;
- Type: aws-cdk-lib.aws_stepfunctions_tasks.ContainerOverrides
[ADVANCED] Override properties on the Fargate Container.
public readonly serviceOverrides: ServiceOverrides;
- Type: ServiceOverrides
[ADVANCED] Override properties on the Fargate Service.
public readonly taskDefinitionOverrides: TaskDefinitionOverrides;
- Type: TaskDefinitionOverrides
[ADVANCED] Override properties on the Fargate Task Definition.
import { EcsTaskProps } from '@blimmer/cdk-static-wordpress'
const ecsTaskProps: EcsTaskProps = { ... }
Name | Type | Description |
---|---|---|
fullyQualifiedSiteName |
string |
No description. |
hostedZone |
aws-cdk-lib.aws_route53.IHostedZone |
No description. |
siteId |
string |
No description. |
staticHosting |
StaticHosting |
No description. |
wordpressAdminProps |
WordpressAdminProps |
No description. |
wordpressDockerImage |
WordpressDockerImage |
No description. |
ecsCluster |
aws-cdk-lib.aws_ecs.ICluster |
No description. |
vpc |
aws-cdk-lib.aws_ec2.IVpc |
No description. |
wordpressDatabaseProps |
WordpressDatabaseProps |
No description. |
public readonly fullyQualifiedSiteName: string;
- Type: string
public readonly hostedZone: IHostedZone;
- Type: aws-cdk-lib.aws_route53.IHostedZone
public readonly siteId: string;
- Type: string
public readonly staticHosting: StaticHosting;
- Type: StaticHosting
public readonly wordpressAdminProps: WordpressAdminProps;
- Type: WordpressAdminProps
public readonly wordpressDockerImage: WordpressDockerImage;
- Type: WordpressDockerImage
public readonly ecsCluster: ICluster;
- Type: aws-cdk-lib.aws_ecs.ICluster
public readonly vpc: IVpc;
- Type: aws-cdk-lib.aws_ec2.IVpc
public readonly wordpressDatabaseProps: WordpressDatabaseProps;
- Type: WordpressDatabaseProps
ServiceOverrides.
import { ServiceOverrides } from '@blimmer/cdk-static-wordpress'
const serviceOverrides: ServiceOverrides = { ... }
Name | Type | Description |
---|---|---|
assignPublicIp |
boolean |
Specifies whether the task's elastic network interface receives a public IP address. |
capacityProviderStrategies |
aws-cdk-lib.aws_ecs.CapacityProviderStrategy[] |
A list of Capacity Provider strategies used to place a service. |
circuitBreaker |
aws-cdk-lib.aws_ecs.DeploymentCircuitBreaker |
Whether to enable the deployment circuit breaker. |
cloudMapOptions |
aws-cdk-lib.aws_ecs.CloudMapOptions |
The options for configuring an Amazon ECS service to use service discovery. |
cluster |
aws-cdk-lib.aws_ecs.ICluster |
The name of the cluster that hosts the service. |
deploymentController |
aws-cdk-lib.aws_ecs.DeploymentController |
Specifies which deployment controller to use for the service. |
desiredCount |
number |
The desired number of instantiations of the task definition to keep running on the service. |
enableECSManagedTags |
boolean |
Specifies whether to enable Amazon ECS managed tags for the tasks within the service. |
enableExecuteCommand |
boolean |
Whether to enable the ability to execute into a container. |
healthCheckGracePeriod |
aws-cdk-lib.Duration |
The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. |
maxHealthyPercent |
number |
The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. |
minHealthyPercent |
number |
The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. |
platformVersion |
aws-cdk-lib.aws_ecs.FargatePlatformVersion |
The platform version on which to run your service. |
propagateTags |
aws-cdk-lib.aws_ecs.PropagatedTagSource |
Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. |
securityGroups |
aws-cdk-lib.aws_ec2.ISecurityGroup[] |
The security groups to associate with the service. |
serviceConnectConfiguration |
aws-cdk-lib.aws_ecs.ServiceConnectProps |
Configuration for Service Connect. |
serviceName |
string |
The name of the service. |
taskDefinition |
aws-cdk-lib.aws_ecs.TaskDefinition |
The task definition to use for tasks in the service. |
vpcSubnets |
aws-cdk-lib.aws_ec2.SubnetSelection |
The subnets to associate with the service. |
public readonly assignPublicIp: boolean;
- Type: boolean
- Default: false
Specifies whether the task's elastic network interface receives a public IP address.
If true, each task will receive a public IP address.
public readonly capacityProviderStrategies: CapacityProviderStrategy[];
- Type: aws-cdk-lib.aws_ecs.CapacityProviderStrategy[]
- Default: undefined
A list of Capacity Provider strategies used to place a service.
public readonly circuitBreaker: DeploymentCircuitBreaker;
- Type: aws-cdk-lib.aws_ecs.DeploymentCircuitBreaker
- Default: disabled
Whether to enable the deployment circuit breaker.
If this property is defined, circuit breaker will be implicitly enabled.
public readonly cloudMapOptions: CloudMapOptions;
- Type: aws-cdk-lib.aws_ecs.CloudMapOptions
- Default: AWS Cloud Map service discovery is not enabled.
The options for configuring an Amazon ECS service to use service discovery.
public readonly cluster: ICluster;
- Type: aws-cdk-lib.aws_ecs.ICluster
The name of the cluster that hosts the service.
public readonly deploymentController: DeploymentController;
- Type: aws-cdk-lib.aws_ecs.DeploymentController
- Default: Rolling update (ECS)
Specifies which deployment controller to use for the service.
For more information, see Amazon ECS Deployment Types
public readonly desiredCount: number;
- Type: number
- Default: When creating the service, default is 1; when updating the service, default uses the current task number.
The desired number of instantiations of the task definition to keep running on the service.
public readonly enableECSManagedTags: boolean;
- Type: boolean
- Default: false
Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
For more information, see Tagging Your Amazon ECS Resources
public readonly enableExecuteCommand: boolean;
- Type: boolean
- Default: undefined
Whether to enable the ability to execute into a container.
public readonly healthCheckGracePeriod: Duration;
- Type: aws-cdk-lib.Duration
- Default: defaults to 60 seconds if at least one load balancer is in-use and it is not already set
The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
public readonly maxHealthyPercent: number;
- Type: number
- Default: 100 if daemon, otherwise 200
The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
public readonly minHealthyPercent: number;
- Type: number
- Default: 0 if daemon, otherwise 50
The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.
public readonly platformVersion: FargatePlatformVersion;
- Type: aws-cdk-lib.aws_ecs.FargatePlatformVersion
- Default: Latest
The platform version on which to run your service.
If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
public readonly propagateTags: PropagatedTagSource;
- Type: aws-cdk-lib.aws_ecs.PropagatedTagSource
- Default: PropagatedTagSource.NONE
Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE
public readonly securityGroups: ISecurityGroup[];
- Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]
- Default: A new security group is created.
The security groups to associate with the service.
If you do not specify a security group, a new security group is created.
public readonly serviceConnectConfiguration: ServiceConnectProps;
- Type: aws-cdk-lib.aws_ecs.ServiceConnectProps
- Default: No ports are advertised via Service Connect on this service, and the service cannot make requests to other services via Service Connect.
Configuration for Service Connect.
public readonly serviceName: string;
- Type: string
- Default: CloudFormation-generated name.
The name of the service.
public readonly taskDefinition: TaskDefinition;
- Type: aws-cdk-lib.aws_ecs.TaskDefinition
The task definition to use for tasks in the service.
[disable-awslint:ref-via-interface]
public readonly vpcSubnets: SubnetSelection;
- Type: aws-cdk-lib.aws_ec2.SubnetSelection
- Default: Public subnets if
assignPublicIp
is set, otherwise the first available one of Private, Isolated, Public, in that order.
The subnets to associate with the service.
import { StaticHostingProps } from '@blimmer/cdk-static-wordpress'
const staticHostingProps: StaticHostingProps = { ... }
Name | Type | Description |
---|---|---|
fullyQualifiedSiteName |
string |
No description. |
hostedZone |
aws-cdk-lib.aws_route53.IHostedZone |
No description. |
siteId |
string |
No description. |
cloudFrontDistributionConfig |
CloudFrontDistributionConfig |
No description. |
redirects |
{[ key: string ]: string} |
No description. |
public readonly fullyQualifiedSiteName: string;
- Type: string
public readonly hostedZone: IHostedZone;
- Type: aws-cdk-lib.aws_route53.IHostedZone
public readonly siteId: string;
- Type: string
public readonly cloudFrontDistributionConfig: CloudFrontDistributionConfig;
public readonly redirects: {[ key: string ]: string};
- Type: {[ key: string ]: string}
import { StaticWordpressProps } from '@blimmer/cdk-static-wordpress'
const staticWordpressProps: StaticWordpressProps = { ... }
Name | Type | Description |
---|---|---|
fullyQualifiedSiteName |
string |
The fully qualified site name (e.g., myblog.com or subdomain.myblog.com). |
hostedZone |
aws-cdk-lib.aws_route53.IHostedZone |
The HostedZone to use to create DNS entries for the site. |
wordpressAdminProps |
WordpressAdminProps |
No description. |
cloudFrontDistributionConfig |
CloudFrontDistributionConfig |
No description. |
ecsCluster |
aws-cdk-lib.aws_ecs.ICluster |
The ECS cluster for the Wordpress admin site. |
siteId |
string |
An ID to use throughout this construct to identify resources. Any non-word characters will be replaced with dashes. |
vpc |
aws-cdk-lib.aws_ec2.IVpc |
The VPC assigned to the ecsCluster . |
wordpressDatabaseProps |
WordpressDatabaseProps |
No description. |
wordpressDockerImageProps |
WordpressDockerImageProps |
No description. |
public readonly fullyQualifiedSiteName: string;
- Type: string
The fully qualified site name (e.g., myblog.com or subdomain.myblog.com).
public readonly hostedZone: IHostedZone;
- Type: aws-cdk-lib.aws_route53.IHostedZone
The HostedZone to use to create DNS entries for the site.
public readonly wordpressAdminProps: WordpressAdminProps;
- Type: WordpressAdminProps
public readonly cloudFrontDistributionConfig: CloudFrontDistributionConfig;
public readonly ecsCluster: ICluster;
- Type: aws-cdk-lib.aws_ecs.ICluster
- Default: a new ECS cluster will be created
The ECS cluster for the Wordpress admin site.
public readonly siteId: string;
- Type: string
- Default: the
fullyQualifiedSiteName
will be sanitized and used
An ID to use throughout this construct to identify resources. Any non-word characters will be replaced with dashes.
NOTE: if you intend to change the domain name (via fullyQualifiedSiteName
), you should set this siteId
to
a static value. Otherwise, the siteId
will change when you change the site name.
public readonly vpc: IVpc;
- Type: aws-cdk-lib.aws_ec2.IVpc
- Default: a new VPC will be created
The VPC assigned to the ecsCluster
.
public readonly wordpressDatabaseProps: WordpressDatabaseProps;
- Type: WordpressDatabaseProps
public readonly wordpressDockerImageProps: WordpressDockerImageProps;
TaskDefinitionOverrides.
import { TaskDefinitionOverrides } from '@blimmer/cdk-static-wordpress'
const taskDefinitionOverrides: TaskDefinitionOverrides = { ... }
Name | Type | Description |
---|---|---|
cpu |
number |
The number of cpu units used by the task. |
ephemeralStorageGiB |
number |
The amount (in GiB) of ephemeral storage to be allocated to the task. The maximum supported value is 200 GiB. |
executionRole |
aws-cdk-lib.aws_iam.IRole |
The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. |
family |
string |
The name of a family that this task definition is registered to. |
memoryLimitMiB |
number |
The amount (in MiB) of memory used by the task. |
proxyConfiguration |
aws-cdk-lib.aws_ecs.ProxyConfiguration |
The configuration details for the App Mesh proxy. |
runtimePlatform |
aws-cdk-lib.aws_ecs.RuntimePlatform |
The operating system that your task definitions are running on. |
taskRole |
aws-cdk-lib.aws_iam.IRole |
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. |
volumes |
aws-cdk-lib.aws_ecs.Volume[] |
The list of volume definitions for the task. |
public readonly cpu: number;
- Type: number
- Default: 256
The number of cpu units used by the task.
For tasks using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the memory parameter:
256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB)
512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB)
1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB)
2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB)
4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB)
8192 (8 vCPU) - Available memory values: Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB)
16384 (16 vCPU) - Available memory values: Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB)
public readonly ephemeralStorageGiB: number;
- Type: number
- Default: 20
The amount (in GiB) of ephemeral storage to be allocated to the task. The maximum supported value is 200 GiB.
NOTE: This parameter is only supported for tasks hosted on AWS Fargate using platform version 1.4.0 or later.
public readonly executionRole: IRole;
- Type: aws-cdk-lib.aws_iam.IRole
- Default: An execution role will be automatically created if you use ECR images in your task definition.
The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
The role will be used to retrieve container images from ECR and create CloudWatch log groups.
public readonly family: string;
- Type: string
- Default: Automatically generated name.
The name of a family that this task definition is registered to.
A family groups multiple versions of a task definition.
public readonly memoryLimitMiB: number;
- Type: number
- Default: 512
The amount (in MiB) of memory used by the task.
For tasks using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter:
512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)
1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)
2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)
Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)
Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU)
Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU)
public readonly proxyConfiguration: ProxyConfiguration;
- Type: aws-cdk-lib.aws_ecs.ProxyConfiguration
- Default: No proxy configuration.
The configuration details for the App Mesh proxy.
public readonly runtimePlatform: RuntimePlatform;
- Type: aws-cdk-lib.aws_ecs.RuntimePlatform
- Default: Undefined.
The operating system that your task definitions are running on.
A runtimePlatform is supported only for tasks using the Fargate launch type.
public readonly taskRole: IRole;
- Type: aws-cdk-lib.aws_iam.IRole
- Default: A task role is automatically created for you.
The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf.
public readonly volumes: Volume[];
- Type: aws-cdk-lib.aws_ecs.Volume[]
- Default: No volumes are passed to the Docker daemon on a container instance.
The list of volume definitions for the task.
For more information, see Task Definition Parameter Volumes.
import { WordpressAdminProps } from '@blimmer/cdk-static-wordpress'
const wordpressAdminProps: WordpressAdminProps = { ... }
Name | Type | Description |
---|---|---|
email |
string |
No description. |
domainPrefix |
string |
The prefix to use for the non-static admin site. |
ecsOverrides |
EcsOverrides |
[ADVANCED] Override various aspects of the ECS infrastructure. |
password |
string |
The password to use for the admin user. |
run |
boolean |
Should we run the Wordpress admin console? |
username |
string |
No description. |
public readonly email: string;
- Type: string
public readonly domainPrefix: string;
- Type: string
- Default: "admin-"
The prefix to use for the non-static admin site.
For example, if your static site is
foo.example.com and you pass -admin
here, the admin site will be served at admin-foo.example.com.
public readonly ecsOverrides: EcsOverrides;
- Type: EcsOverrides
[ADVANCED] Override various aspects of the ECS infrastructure.
public readonly password: string;
- Type: string
- Default: changeme
The password to use for the admin user.
public readonly run: boolean;
- Type: boolean
- Default: true
Should we run the Wordpress admin console?
Set this to false
to save money when you're not actively editing
the site.
public readonly username: string;
- Type: string
import { WordpressDatabaseProps } from '@blimmer/cdk-static-wordpress'
const wordpressDatabaseProps: WordpressDatabaseProps = { ... }
Name | Type | Description |
---|---|---|
databaseOverrides |
DatabaseOverrides |
[ADVANCED] Override properties on the Serverless Database Cluster. |
password |
string |
No description. |
username |
string |
No description. |
public readonly databaseOverrides: DatabaseOverrides;
- Type: DatabaseOverrides
[ADVANCED] Override properties on the Serverless Database Cluster.
public readonly password: string;
- Type: string
public readonly username: string;
- Type: string
import { WordpressDockerImageProps } from '@blimmer/cdk-static-wordpress'
const wordpressDockerImageProps: WordpressDockerImageProps = { ... }
Name | Type | Description |
---|---|---|
containerCpu |
number |
The number of vCPU units to give the ECS container at runtime. |
containerMemory |
number |
Memory to give the ECS container at runtime. |
wordpressDockerImageBase |
string |
No description. |
wordpressMemoryLimit |
string |
This configures how much memory is given to Wordpress. |
wp2StaticS3AddonVersion |
string |
No description. |
wp2StaticVersion |
string |
The version of wp2static to install. |
public readonly containerCpu: number;
- Type: number
- Default: 256 (0.25 vCPU)
The number of vCPU units to give the ECS container at runtime.
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-cpu for details on available configurations
public readonly containerMemory: number;
- Type: number
- Default: 512 (MB)
Memory to give the ECS container at runtime.
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-memory for details on available configurations
public readonly wordpressDockerImageBase: string;
- Type: string
- Default: wordpress:php8.0-apache
public readonly wordpressMemoryLimit: string;
- Type: string
- Default: 256M
This configures how much memory is given to Wordpress.
It's different than container memory,
which is configured by containerMemory
. See
https://developer.wordpress.org/apis/wp-config-php/#increasing-memory-allocated-to-php
for details on this setting.
public readonly wp2StaticS3AddonVersion: string;
- Type: string
- Default: 1.0
public readonly wp2StaticVersion: string;
- Type: string
- Default: 7.2
The version of wp2static to install.
See https://github.com/WP2Static/wp2static/releases for available version