Skip to content

Commit 0d0fa2a

Browse files
committed
feat: Add wordpress
1 parent 0f5f055 commit 0d0fa2a

File tree

18 files changed

+1172
-22
lines changed

18 files changed

+1172
-22
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ This repository is a monorepo managed with [Lerna](https://github.com/lerna/lern
4040
| [cdk-secret-key](/packages/cdk-secret-key) | Provide secret keys to lambdas | ![npm](https://img.shields.io/npm/dm/@cloudcomponents/cdk-secret-key) |
4141
| [cdk-responsive-email-template](/packages/cdk-responsive-email-template) | Responsive email template for aws ses | ![npm](https://img.shields.io/npm/dm/@cloudcomponents/cdk-responsive-email-template) |
4242
| [cdk-s3-antivirus](/packages/cdk-s3-antivirus) | Antivirus for Amazon S3 | ![npm](https://img.shields.io/npm/dm/@cloudcomponents/cdk-s3-antivirus) |
43+
| [cdk-wordpress](/packages/cdk-wordpress) | CDK Construct to deploy wordpress | ![npm](https://img.shields.io/npm/dm/@cloudcomponents/cdk-wordpress) |
4344
## Contributing
4445

4546
We welcome community contributions and pull requests.

examples/wordpress-example/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Useful commands
2+
3+
* `npm run build` compile typescript to js
4+
* `npm run watch` watch for changes and compile
5+
* `cdk deploy` deploy this stack to your default AWS account/region
6+
* `cdk diff` compare deployed stack with current state
7+
* `cdk synth` emits the synthesized CloudFormation template

examples/wordpress-example/cdk.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"app": "cdkdx node src/wordpress-app.ts"
3+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "wordpress-example",
3+
"version": "0.1.0",
4+
"license": "MIT",
5+
"private": true,
6+
"scripts": {
7+
"build": "cdkdx build",
8+
"upgrade:cdk": "cdkdx upgrade-cdk",
9+
"cdk": "cdk"
10+
},
11+
"dependencies": {
12+
"@aws-cdk/aws-route53": "^1.121.0",
13+
"@aws-cdk/core": "^1.121.0",
14+
"@cloudcomponents/cdk-wordpress": "^1.0.0",
15+
"source-map-support": "^0.5.19"
16+
},
17+
"devDependencies": {
18+
"@types/source-map-support": "^0.5.4",
19+
"aws-cdk": "^1.121.0"
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env node
2+
3+
import 'source-map-support/register';
4+
import { App } from '@aws-cdk/core';
5+
6+
import { WordpressStack } from './wordpress-stack';
7+
8+
const app = new App();
9+
10+
new WordpressStack(app, 'WordpressStack', {
11+
env: {
12+
region: process.env.DEFAULT_REGION,
13+
account: process.env.CDK_DEFAULT_ACCOUNT,
14+
},
15+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { PublicHostedZone } from '@aws-cdk/aws-route53';
2+
import { Construct, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core';
3+
4+
import { Wordpress } from '@cloudcomponents/cdk-wordpress';
5+
6+
export class WordpressStack extends Stack {
7+
constructor(scope: Construct, id: string, props: StackProps) {
8+
super(scope, id, props);
9+
10+
const hostedZone = PublicHostedZone.fromLookup(this, 'HostedZone', {
11+
domainName: 'cloudcomponents.org',
12+
});
13+
14+
new Wordpress(this, 'Wordpress', {
15+
domainName: 'blog.cloudcomponents.org',
16+
domainZone: hostedZone,
17+
removalPolicy: RemovalPolicy.DESTROY,
18+
offloadStaticContent: true, // Support for plugin e.g. `WP Offload Media for Amazon S3`
19+
});
20+
}
21+
}

0 commit comments

Comments
 (0)