From 1de40f9acebabdd1b0e529bbc37ab2f9394dce82 Mon Sep 17 00:00:00 2001 From: zack hee Date: Tue, 23 Sep 2025 22:07:34 +0800 Subject: [PATCH 1/3] feat: landing page example for community day --- demos/community-day/.gitignore | 4 ++ demos/community-day/.prettierignore | 5 ++ demos/community-day/.prettierrc.json | 3 ++ demos/community-day/cdktf.json | 8 +++ demos/community-day/lambda/hello.js | 32 +++++++++++ demos/community-day/package.json | 32 +++++++++++ demos/community-day/src/index.ts | 42 +++++++++++++++ demos/community-day/src/stack.ts | 81 ++++++++++++++++++++++++++++ demos/community-day/tsconfig.json | 38 +++++++++++++ index.html | 24 ++++++--- plugins/precompute-demo-code.js | 6 +++ 11 files changed, 269 insertions(+), 6 deletions(-) create mode 100644 demos/community-day/.gitignore create mode 100644 demos/community-day/.prettierignore create mode 100644 demos/community-day/.prettierrc.json create mode 100644 demos/community-day/cdktf.json create mode 100644 demos/community-day/lambda/hello.js create mode 100644 demos/community-day/package.json create mode 100644 demos/community-day/src/index.ts create mode 100644 demos/community-day/src/stack.ts create mode 100644 demos/community-day/tsconfig.json diff --git a/demos/community-day/.gitignore b/demos/community-day/.gitignore new file mode 100644 index 0000000..c4f68a5 --- /dev/null +++ b/demos/community-day/.gitignore @@ -0,0 +1,4 @@ +cdk.tf.json +cdk.tf +assets/ +tcons-staging/ diff --git a/demos/community-day/.prettierignore b/demos/community-day/.prettierignore new file mode 100644 index 0000000..6cbd0c4 --- /dev/null +++ b/demos/community-day/.prettierignore @@ -0,0 +1,5 @@ +# ignore fogg managed files +.fogg-component.yaml +package.json +src/index.ts +src/.gen/**/* diff --git a/demos/community-day/.prettierrc.json b/demos/community-day/.prettierrc.json new file mode 100644 index 0000000..84c85a3 --- /dev/null +++ b/demos/community-day/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "overrides": [] +} diff --git a/demos/community-day/cdktf.json b/demos/community-day/cdktf.json new file mode 100644 index 0000000..6d7e21e --- /dev/null +++ b/demos/community-day/cdktf.json @@ -0,0 +1,8 @@ +{ + "language": "typescript", + "codeMakerOutput": "src/.gen", + "app": "pnpm ts-node --swc -P ./tsconfig.json src/index.ts", + "terraformProviders": [], + "terraformModules": [], + "projectId": "d1dd24b3-6056-4263-93ae-ec59454a47b5" +} \ No newline at end of file diff --git a/demos/community-day/lambda/hello.js b/demos/community-day/lambda/hello.js new file mode 100644 index 0000000..4798bcc --- /dev/null +++ b/demos/community-day/lambda/hello.js @@ -0,0 +1,32 @@ +const { SNSClient, PublishCommand } = require("@aws-sdk/client-sns"); + +const snsClient = new SNSClient({}); + +exports.handler = async function (event) { + console.log("request:", JSON.stringify(event, undefined, 2)); + + const params = { + Message: JSON.stringify({ + message: "Processing event from EventBridge", + eventDetail: event.detail, + }), + TopicArn: process.env.SNS_TOPIC_ARN, + }; + + try { + const command = new PublishCommand(params); + const data = await snsClient.send(command); + console.log(`Message sent to the topic ${params.TopicArn}`); + console.log("MessageID is " + data.MessageId); + return { + statusCode: 200, + body: JSON.stringify({ + message: "Message published successfully", + messageId: data.MessageId, + }), + }; + } catch (err) { + console.error("Error publishing to SNS:", err); + throw err; + } +}; diff --git a/demos/community-day/package.json b/demos/community-day/package.json new file mode 100644 index 0000000..cf38349 --- /dev/null +++ b/demos/community-day/package.json @@ -0,0 +1,32 @@ +{ + "name": "community-day", + "version": "1.0.0", + "main": "src/main.js", + "types": "src/main.ts", + "license": "MPL-2.0", + "private": true, + "scripts": { + "synth": "ts-node --swc -P ./tsconfig.json src/index.ts", + "prettier": "prettier --write ." + }, + "engines": { + "node": ">=20.9" + }, + "dependencies": { + "@cdktf/provider-cloudinit": "^11.0.0", + "@tcons/provider-tconsaws": "0.0.1", + "cdktf": "^0.21.0", + "constructs": "^10.4.2", + "terraconstructs": "^0.1.3" + }, + "devDependencies": { + "@swc/core": "^1.10.12", + "@types/jest": "^30.0.0", + "@types/node": "^24.0.14", + "jest": "^30.0.4", + "prettier": "^3.4.2", + "ts-jest": "^29.4.0", + "ts-node": "^10.9.2", + "typescript": "^5.8.3" + } +} \ No newline at end of file diff --git a/demos/community-day/src/index.ts b/demos/community-day/src/index.ts new file mode 100644 index 0000000..acebfad --- /dev/null +++ b/demos/community-day/src/index.ts @@ -0,0 +1,42 @@ +import * as fs from "node:fs"; +import * as path from "node:path"; +import { App,} from "cdktf/lib/app"; +import { CloudinitProvider } from "@cdktf/provider-cloudinit/lib/provider"; +import { provider } from "@tcons/provider-tconsaws"; +import { Testing } from "cdktf/lib/testing"; +import { CdkWorkshopStack } from "./stack"; +import { execSync } from "node:child_process"; + +const outdir = "cdktf.out"; +const app = Testing.app({ + outdir, +}); +const stack = new CdkWorkshopStack(app, "Default",{ + environmentName: "demo", + providerConfig: { + region: "us-east-1", + }, + gridUUID: "demo-uuid", +}); +new CloudinitProvider(stack, "CloudInit"); +new provider.TconsawsProvider(stack, "Tconsaws", { + region: stack.region, +}); + +const resultString = Testing.synth(stack); +fs.writeFileSync("cdk.tf.json", resultString); + + +const resultHclString = Testing.synthHcl(stack); +fs.writeFileSync("cdk.tf", resultHclString); +execSync("terraform fmt cdk.tf") + +// // Copy the generated Terraform code to the current directory to keep relative directory references +// app.synth(); +// const stackSynthDir = path.join(outdir, app.manifest.forStack(stack).workingDirectory); + +// fs.cpSync(stackSynthDir, ".", { recursive: true }); +// fs.rmSync(outdir, { recursive: true }); +// if (process.env.CI) { +// fs.renameSync("cdk.tf.json", "ci-cdk.tf.json"); +// } diff --git a/demos/community-day/src/stack.ts b/demos/community-day/src/stack.ts new file mode 100644 index 0000000..bfba023 --- /dev/null +++ b/demos/community-day/src/stack.ts @@ -0,0 +1,81 @@ +// https://github.com/TerraConstructs/base/blob/integ-feat-signal-poc/integ/aws/compute/apps/instance.ts +import { signal } from "@tcons/provider-tconsaws"; +import { Construct } from "constructs"; +import { AwsStack, AwsStackProps } from "terraconstructs/lib/aws"; +import { + Vpc, + Instance, + InstanceType, + InstanceClass, + InstanceSize, + AmazonLinuxImage, + AmazonLinuxGeneration, + InstanceInitiatedShutdownBehavior, + Port, + Code, + LambdaFunction, + Runtime, + SecurityGroup, + Schedule +} from "terraconstructs/lib/aws/compute"; +import { + Queue, +} from "terraconstructs/lib/aws/notify"; +import { SqsSubscription } from 'terraconstructs/lib/aws/notify/subscriptions'; +import { Rule, IRuleTarget, Topic } from 'terraconstructs/lib/aws/notify'; +import { Bucket, BucketEncryption } from 'terraconstructs/lib/aws/storage'; + +export class CdkWorkshopStack extends AwsStack { + constructor(scope: Construct, id: string, props: AwsStackProps) { + super(scope, id, props); + const vpc = new Vpc(this, "VPC"); + + const lambda = new LambdaFunction(this, "LambdaFunction", { + runtime: Runtime.NODEJS_22_X, + code: Code.fromAsset("lambda"), + handler: "hello.handler", + }); + + const lambdaTarget: IRuleTarget = { + bind: () => ({ + arn: lambda.functionArn, + targetResource: lambda, + }), + }; + + // Event bridge schedule and rule for SGX AR report processor lambda execution + new Rule(this, 'Rule', { + ruleName: `schedule-rule`, + schedule: Schedule.cron({ minute: '10/30', hour: '*', day: '*', month: '*', year: '*' }), + targets: [lambdaTarget], + }); + + const topic = new Topic(this, "Topic"); + const queue = new Queue(this, "Queue"); + topic.addSubscription(new SqsSubscription(queue)); + + const instance = new Instance(this, "Instance", { + vpc, + instanceType: InstanceType.of( + InstanceClass.T3, + InstanceSize.NANO, + ), + machineImage: new AmazonLinuxImage({ + generation: AmazonLinuxGeneration.AMAZON_LINUX_2, + }), + detailedMonitoring: true, + instanceInitiatedShutdownBehavior: + InstanceInitiatedShutdownBehavior.TERMINATE, + }); + queue.grantConsumeMessages(instance) + + const rdsDbSecurityGroupId = SecurityGroup.fromSecurityGroupId(this, 'RdsSecurityGroupId', "sg-0123456789abcdef0") + + rdsDbSecurityGroupId.connections.allowFrom(instance, Port.tcp(1433), 'Allow MySQL access from EC2 instance'); + + const bucket = new Bucket(this, "Bucket", { + encryption: BucketEncryption.S3_MANAGED, + }); + bucket.grantReadWrite(instance); + } +} diff --git a/demos/community-day/tsconfig.json b/demos/community-day/tsconfig.json new file mode 100644 index 0000000..c60f677 --- /dev/null +++ b/demos/community-day/tsconfig.json @@ -0,0 +1,38 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "outDir": "dist", + "declaration": true, + "declarationMap": true, + "experimentalDecorators": true, + "sourceMap": true, + "inlineSources": true, + "lib": ["es2023"], + "module": "node16", + "target": "es2022", + "moduleResolution": "node16", + "moduleDetection": "force", + "esModuleInterop": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "strict": true, + "alwaysStrict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "stripInternal": true, + "noEmitOnError": false, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "isolatedDeclarations": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true + }, + "include": ["src/**/*.ts"], + "exclude": ["dist", "node_modules", "cdktf.out"] +} diff --git a/index.html b/index.html index 42b2124..bc4db3d 100644 --- a/index.html +++ b/index.html @@ -699,6 +699,16 @@

EC2 Instance with CFN Signal +
  • + +
  • @@ -1331,7 +1341,7 @@

    - The + The terraform-provider-aws aria-controls="faq-10" > How does TerraConstructs compare to How does TerraConstructs compare to + cdktf-aws-cdk?cdktf-aws-cdk? API concepts inside a single resource, while Terraform models them as separate resources with distinct lifecycles and dependencies. The result can be incomplete - mappings, unstable plans, and missing features (such as the asset pipeline). - TerraConstructs re-implements the AWS CDK - L2 behaviors on top of + mappings, unstable plans, and missing features (such as the + asset pipeline). TerraConstructs re-implements the AWS CDK L2 + behaviors on top of provider-aws Date: Thu, 25 Sep 2025 11:33:36 +0800 Subject: [PATCH 2/3] feat: add tourConfig --- demos/community-day/.prettierrc.json | 16 ++- demos/community-day/cdktf.json | 2 +- demos/community-day/src/index.ts | 7 +- demos/community-day/src/stack.ts | 43 ++++++--- pnpm-lock.yaml | 43 +++++++++ src/tour-configs.js | 139 +++++++++++++++++++++++++++ 6 files changed, 231 insertions(+), 19 deletions(-) diff --git a/demos/community-day/.prettierrc.json b/demos/community-day/.prettierrc.json index 84c85a3..db834b5 100644 --- a/demos/community-day/.prettierrc.json +++ b/demos/community-day/.prettierrc.json @@ -1,3 +1,17 @@ { - "overrides": [] + "semi": true, + "singleQuote": false, + "trailingComma": "es5", + "tabWidth": 2, + "useTabs": false, + "printWidth": 70, + "endOfLine": "lf", + "arrowParens": "avoid", + "bracketSpacing": true, + "bracketSameLine": false, + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "requirePragma": false, + "proseWrap": "preserve", + "quoteProps": "as-needed" } diff --git a/demos/community-day/cdktf.json b/demos/community-day/cdktf.json index 6d7e21e..0601d90 100644 --- a/demos/community-day/cdktf.json +++ b/demos/community-day/cdktf.json @@ -5,4 +5,4 @@ "terraformProviders": [], "terraformModules": [], "projectId": "d1dd24b3-6056-4263-93ae-ec59454a47b5" -} \ No newline at end of file +} diff --git a/demos/community-day/src/index.ts b/demos/community-day/src/index.ts index acebfad..e9c83f9 100644 --- a/demos/community-day/src/index.ts +++ b/demos/community-day/src/index.ts @@ -1,6 +1,6 @@ import * as fs from "node:fs"; import * as path from "node:path"; -import { App,} from "cdktf/lib/app"; +import { App, } from "cdktf/lib/app"; import { CloudinitProvider } from "@cdktf/provider-cloudinit/lib/provider"; import { provider } from "@tcons/provider-tconsaws"; import { Testing } from "cdktf/lib/testing"; @@ -11,7 +11,7 @@ const outdir = "cdktf.out"; const app = Testing.app({ outdir, }); -const stack = new CdkWorkshopStack(app, "Default",{ +const stack = new CdkWorkshopStack(app, "Default", { environmentName: "demo", providerConfig: { region: "us-east-1", @@ -19,9 +19,6 @@ const stack = new CdkWorkshopStack(app, "Default",{ gridUUID: "demo-uuid", }); new CloudinitProvider(stack, "CloudInit"); -new provider.TconsawsProvider(stack, "Tconsaws", { - region: stack.region, -}); const resultString = Testing.synth(stack); fs.writeFileSync("cdk.tf.json", resultString); diff --git a/demos/community-day/src/stack.ts b/demos/community-day/src/stack.ts index bfba023..805afe4 100644 --- a/demos/community-day/src/stack.ts +++ b/demos/community-day/src/stack.ts @@ -16,18 +16,24 @@ import { LambdaFunction, Runtime, SecurityGroup, - Schedule + Schedule, } from "terraconstructs/lib/aws/compute"; +import { Queue } from "terraconstructs/lib/aws/notify"; +import { SqsSubscription } from "terraconstructs/lib/aws/notify/subscriptions"; import { - Queue, + Rule, + IRuleTarget, + Topic, } from "terraconstructs/lib/aws/notify"; -import { SqsSubscription } from 'terraconstructs/lib/aws/notify/subscriptions'; -import { Rule, IRuleTarget, Topic } from 'terraconstructs/lib/aws/notify'; -import { Bucket, BucketEncryption } from 'terraconstructs/lib/aws/storage'; +import { + Bucket, + BucketEncryption, +} from "terraconstructs/lib/aws/storage"; export class CdkWorkshopStack extends AwsStack { constructor(scope: Construct, id: string, props: AwsStackProps) { super(scope, id, props); + const vpc = new Vpc(this, "VPC"); const lambda = new LambdaFunction(this, "LambdaFunction", { @@ -44,9 +50,15 @@ export class CdkWorkshopStack extends AwsStack { }; // Event bridge schedule and rule for SGX AR report processor lambda execution - new Rule(this, 'Rule', { + new Rule(this, "Rule", { ruleName: `schedule-rule`, - schedule: Schedule.cron({ minute: '10/30', hour: '*', day: '*', month: '*', year: '*' }), + schedule: Schedule.cron({ + minute: "10/30", + hour: "*", + day: "*", + month: "*", + year: "*", + }), targets: [lambdaTarget], }); @@ -58,7 +70,7 @@ export class CdkWorkshopStack extends AwsStack { vpc, instanceType: InstanceType.of( InstanceClass.T3, - InstanceSize.NANO, + InstanceSize.NANO ), machineImage: new AmazonLinuxImage({ generation: AmazonLinuxGeneration.AMAZON_LINUX_2, @@ -67,11 +79,18 @@ export class CdkWorkshopStack extends AwsStack { instanceInitiatedShutdownBehavior: InstanceInitiatedShutdownBehavior.TERMINATE, }); - queue.grantConsumeMessages(instance) - - const rdsDbSecurityGroupId = SecurityGroup.fromSecurityGroupId(this, 'RdsSecurityGroupId', "sg-0123456789abcdef0") + queue.grantConsumeMessages(instance); - rdsDbSecurityGroupId.connections.allowFrom(instance, Port.tcp(1433), 'Allow MySQL access from EC2 instance'); + const rdsDbSecurityGroupId = SecurityGroup.fromSecurityGroupId( + this, + "RdsSecurityGroupId", + "sg-0123456789abcdef0" + ); + rdsDbSecurityGroupId.connections.allowFrom( + instance, + Port.MSSQL, + "Allow MySQL access from EC2 instance" + ); const bucket = new Bucket(this, "Bucket", { encryption: BucketEncryption.S3_MANAGED, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb93bd3..21c319d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,6 +64,49 @@ importers: specifier: ^5.0.0 version: 5.4.19(@types/node@22.18.3) + demos/community-day: + dependencies: + '@cdktf/provider-cloudinit': + specifier: ^11.0.0 + version: 11.0.0(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2) + '@tcons/provider-tconsaws': + specifier: 0.0.1 + version: 0.0.1(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2) + cdktf: + specifier: ^0.21.0 + version: 0.21.0(constructs@10.4.2) + constructs: + specifier: ^10.4.2 + version: 10.4.2 + terraconstructs: + specifier: ^0.1.3 + version: 0.1.3(@cdktf/provider-archive@11.0.0(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2))(@cdktf/provider-aws@20.1.0(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2))(@cdktf/provider-cloudinit@11.0.0(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2))(@cdktf/provider-docker@12.0.2(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2))(@cdktf/provider-time@11.0.0(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2))(@cdktf/provider-tls@11.0.0(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2))(cdktf@0.21.0(constructs@10.4.2))(constructs@10.4.2) + devDependencies: + '@swc/core': + specifier: ^1.10.12 + version: 1.13.5 + '@types/jest': + specifier: ^30.0.0 + version: 30.0.0 + '@types/node': + specifier: ^24.0.14 + version: 24.3.0 + jest: + specifier: ^30.0.4 + version: 30.1.1(@types/node@24.3.0)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@24.3.0)(typescript@5.9.2)) + prettier: + specifier: ^3.4.2 + version: 3.6.2 + ts-jest: + specifier: ^29.4.0 + version: 29.4.1(@babel/core@7.28.3)(@jest/transform@30.1.1)(@jest/types@30.0.5)(babel-jest@30.1.1(@babel/core@7.28.3))(jest-util@30.0.5)(jest@30.1.1(@types/node@24.3.0)(ts-node@10.9.2(@swc/core@1.13.5)(@types/node@24.3.0)(typescript@5.9.2)))(typescript@5.9.2) + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@swc/core@1.13.5)(@types/node@24.3.0)(typescript@5.9.2) + typescript: + specifier: ^5.8.3 + version: 5.9.2 + demos/function-url: dependencies: '@tcons/cdk-dynamo-table-viewer': diff --git a/src/tour-configs.js b/src/tour-configs.js index 1cf55a9..65b5c69 100644 --- a/src/tour-configs.js +++ b/src/tour-configs.js @@ -245,6 +245,145 @@ export const tourConfigs = { }, ], }, + "community-day": { + name: "Community Day Example using L2 Constructs", + description: + "Learn about L2 Constructs, IAM patterns, and deterministic synthesis", + inputSteps: [ + { + id: "imports", + type: "line-range", + startLine: 37, + endLine: 37, + title: "L2 Construct Imports", + content: + "Creating VPC at ease including multiple AZs subnets and route tables.", + highlight: "border", + }, + { + id: "lambda", + type: "line-range", + startLine: 39, + endLine: 43, + title: "Lambda Function", + content: + "LambdaFunction provides strong typing and sensible defaults. Code.fromAsset() uses the asset pipeline for bundling and deployment. We can skip the archive provider .. etc here.", + highlight: "border", + }, + { + id: "event-bridge", + type: "line-range", + startLine: 45, + endLine: 63, + title: "Event Bridge Rule", + content: + "L2 Construct for EventBridge provides a simple way to create rules and targets.", + highlight: "border", + }, + { + id: "sqs", + type: "line-range", + startLine: 65, + endLine: 67, + title: "Sqs Subscription", + content: + "Creates an SNS Topic, an SQS Queue, and subscribes the queue to the topic (SQS subscription).", + highlight: "border", + }, + { + id: "instance-create", + type: "line-range", + startLine: 69, + endLine: 81, + title: "EC2 Instance creation", + content: + "Instantiates an Instance L2 with explicit instanceType and machineImage (Amazon Linux).", + highlight: "border", + }, + { + id: "sqs-grant", + type: "line-range", + startLine: 82, + endLine: 82, + title: "SQS consume grant", + content: + "Grants the EC2 instance permission to consume messages from the SQS queue.", + highlight: "border", + }, + { + id: "rds-sg-from-id", + type: "line-range", + startLine: 84, + endLine: 88, + title: "Import existing Security Group by ID", + content: + "Loads an existing Security Group (`sg-0123456789abcdef0`) via `fromSecurityGroupId` for cross-resource connectivity checks.", + highlight: "border", + }, + { + id: "sg-allow-from", + type: "line-range", + startLine: 89, + endLine: 93, + title: "Allow DB access from Instance", + content: + "Adds a `connections.allowFrom` rule to permit the instance to reach the RDS security group on TCP 1433 (MSSQL port used here).", + highlight: "border", + }, + { + id: "bucket", + type: "line-range", + startLine: 95, + endLine: 98, + title: "Create bucket and allow read write from instance.", + content: + "Creates an S3 bucket and allows read/write access from the EC2 instance.", + highlight: "border", + }, + ], + outputSteps: [ + // { + // id: "iam-role-assume-policy", + // type: "line-range", + // startLine: 22, + // endLine: 32, + // title: "IAM Role Assume Policy", + // content: + // 'The "hello" Handler IAM policies ensures Lambda service principal access.', + // highlight: "background", + // }, + // { + // id: "asset-pipeline", + // type: "line-range", + // startLine: 109, + // endLine: 117, + // title: "Asset Pipeline", + // content: + // "The AwsStack asset pipeline handles checksums, packaging and uploads.", + // highlight: "border", + // }, + // { + // id: "api-gateway-dependencies", + // type: "line-range", + // startLine: 134, + // endLine: 149, + // title: "API Gateway Dependencies", + // content: + // "API Gateway resources are properly configured with deployment stage triggers and dependencies avoiding common race condition pitfalls.", + // highlight: "background", + // }, + // { + // id: "lambda-permissions", + // type: "line-range", + // startLine: 192, + // endLine: 197, + // title: "Lambda Permissions", + // content: + // "Deep IAM, Lambda and ApiGateway integrations ensure necessary permissions are created automatically.", + // highlight: "background", + // }, + ], + }, }; export function getTourConfig(demoKey) { From 0a968ec5ca97076fc7686e1e882cf0ef94603060 Mon Sep 17 00:00:00 2001 From: zack hee Date: Fri, 26 Sep 2025 22:09:43 +0800 Subject: [PATCH 3/3] feat: tour config --- demos/community-day/.prettierrc.json | 2 +- src/tour-configs.js | 97 ++++++++++++++++------------ 2 files changed, 57 insertions(+), 42 deletions(-) diff --git a/demos/community-day/.prettierrc.json b/demos/community-day/.prettierrc.json index db834b5..e3dc183 100644 --- a/demos/community-day/.prettierrc.json +++ b/demos/community-day/.prettierrc.json @@ -14,4 +14,4 @@ "requirePragma": false, "proseWrap": "preserve", "quoteProps": "as-needed" -} +} \ No newline at end of file diff --git a/src/tour-configs.js b/src/tour-configs.js index 65b5c69..27eeea3 100644 --- a/src/tour-configs.js +++ b/src/tour-configs.js @@ -283,7 +283,7 @@ export const tourConfigs = { { id: "sqs", type: "line-range", - startLine: 65, + startLine: 67, endLine: 67, title: "Sqs Subscription", content: @@ -342,46 +342,61 @@ export const tourConfigs = { }, ], outputSteps: [ - // { - // id: "iam-role-assume-policy", - // type: "line-range", - // startLine: 22, - // endLine: 32, - // title: "IAM Role Assume Policy", - // content: - // 'The "hello" Handler IAM policies ensures Lambda service principal access.', - // highlight: "background", - // }, - // { - // id: "asset-pipeline", - // type: "line-range", - // startLine: 109, - // endLine: 117, - // title: "Asset Pipeline", - // content: - // "The AwsStack asset pipeline handles checksums, packaging and uploads.", - // highlight: "border", - // }, - // { - // id: "api-gateway-dependencies", - // type: "line-range", - // startLine: 134, - // endLine: 149, - // title: "API Gateway Dependencies", - // content: - // "API Gateway resources are properly configured with deployment stage triggers and dependencies avoiding common race condition pitfalls.", - // highlight: "background", - // }, - // { - // id: "lambda-permissions", - // type: "line-range", - // startLine: 192, - // endLine: 197, - // title: "Lambda Permissions", - // content: - // "Deep IAM, Lambda and ApiGateway integrations ensure necessary permissions are created automatically.", - // highlight: "background", - // }, + { + id: "s3-object", + type: "line-range", + startLine: 403, + endLine: 408, + title: "Lambda S3 Object", + content: + "S3 Bucket object created for Lambda function code with code asset pipeline.", + highlight: "background", + }, + { + id: "sqs-subscription", + type: "line-range", + startLine: 476, + endLine: 486, + title: "SQS Subscription", + content: "One liner subscription.", + highlight: "background", + }, + { + id: "instance-creation", + type: "line-range", + startLine: 599, + endLine: 625, + title: "Instance Creation", + content: "Instance creation using Enum instead of magic number.", + highlight: "background", + }, + { + id: "sqs-grant-read", + type: "line-range", + startLine: 545, + endLine: 558, + title: "SQS Grant Read", + content: "One liner grant sqs read access for the instance.", + highlight: "background", + }, + { + id: "s3-read-write", + type: "line-range", + startLine: 559, + endLine: 578, + title: "S3 Read Write", + content: "One liner grant s3 read write access for the instance.", + highlight: "background", + }, + { + id: "rds-ingress", + type: "line-range", + startLine: 629, + endLine: 641, + title: "RDS Ingress", + content: "One liner grant rds mssql ingress access for the instance.", + highlight: "background", + }, ], }, };