This repository was archived by the owner on Dec 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
presets/library/cloudfront-invalidation-panel Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ import { extend , extract } from '../../../src/index.js'
2+
3+ export default [ extend ( 'presets/base/typescript-cdk' ) , extract ( ) ]
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments