Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 6e669cc

Browse files
committed
feat: add to library cloudfront invalidation panel
1 parent fbda554 commit 6e669cc

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { extend, extract } from '../../../src/index.js'
2+
3+
export default [extend('presets/base/typescript-cdk'), extract()]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<p align="center">
2+
<a href="https://buttonize.io">
3+
<img width="350" alt="Buttonize.io" src="https://user-images.githubusercontent.com/6282843/212024942-9fd50774-ea26-48ba-b2cf-ca2584498c9a.png">
4+
</a>
5+
</p>
6+
7+
---
8+
9+
## CloudFront Invalidation Panel
10+
11+
[![CloudFront Invalidation Panel](https://github.com/buttonize/create-buttonize/assets/6282843/aeb73d4a-e502-4d3b-b1b6-d3ee5538349d)](https://buttonize.io/library/cloudfront-invalidation-panel)
12+
13+
Learn more about CloudFront Invalidation Panel Construct [here](https://buttonize.io/library/cloudfront-invalidation-panel).
14+
15+
## CDK
16+
17+
The `cdk.json` file tells the CDK Toolkit how to execute your app.
18+
19+
### Useful commands
20+
21+
* `npm run build` compile typescript to js
22+
* `npm run watch` watch for changes and compile
23+
* `npx cdk deploy` deploy this stack to your default AWS account/region
24+
* `npx cdk diff` compare deployed stack with current state
25+
* `npx cdk synth` emits the synthesized CloudFormation template
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import * as cdk from 'aws-cdk-lib'
2+
import { Distribution } from 'aws-cdk-lib/aws-cloudfront'
3+
import { HttpOrigin } from 'aws-cdk-lib/aws-cloudfront-origins'
4+
import { Buttonize } from 'buttonize/cdk'
5+
import { CloudFrontInvalidationPanel } from 'buttonize/library'
6+
import { Construct } from 'constructs'
7+
8+
export class ExampleStack extends cdk.Stack {
9+
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
10+
super(scope, id, props)
11+
12+
Buttonize.init(this, {
13+
apiKey: '@@apiKey'
14+
})
15+
16+
const yourDistribution = new Distribution(this, 'YourDistribution', {
17+
defaultBehavior: {
18+
origin: new HttpOrigin('google.com')
19+
}
20+
})
21+
22+
new CloudFrontInvalidationPanel(this, 'CloudFrontPanel', {
23+
distribution: yourDistribution,
24+
paths: {
25+
All: '/*',
26+
Users: '/users',
27+
'Landing page': '/en/lp/mega-campaign'
28+
}
29+
})
30+
}
31+
}

0 commit comments

Comments
 (0)