diff --git a/README.md b/README.md index 91409775..b86df26e 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,13 @@ samples, guidance on mobile development, and a full API reference. - run command: `flutter run -d chrome --target=lib/main_dev.dart` +## CDK Deployment +• Bootstrap CDK (first time only): npx cdk bootstrap aws://482311766496/me-central-1 +• List available stacks: npx cdk list +• Deploy web: npx cdk deploy --require-approval never +• View changes before deploy: npx cdk diff +• Generate CloudFormation template: npx cdk synth +• Destroy infrastructure: npx cdk destroy +• Web infrastructure is configured in infrastructure/web-stack.ts +• After code changes: build Flutter web app and deploy to hosting service diff --git a/bin/web-stack.ts b/bin/web-stack.ts index 2c296b2a..e7e0c9a3 100644 --- a/bin/web-stack.ts +++ b/bin/web-stack.ts @@ -8,7 +8,7 @@ const app = new cdk.App(); new WebStack(app, 'SyncrowWebStack', { env: { account: process.env.CDK_DEFAULT_ACCOUNT, - region: process.env.CDK_DEFAULT_REGION || 'us-east-2', + region: 'me-central-1', }, certificateArn: app.node.tryGetContext('certificateArn'), }); diff --git a/cdk.context.json b/cdk.context.json index 05cc11a5..d7f0d5de 100644 --- a/cdk.context.json +++ b/cdk.context.json @@ -2,5 +2,9 @@ "hosted-zone:account=482311766496:domainName=syncrow.me:region=us-east-2": { "Id": "/hostedzone/Z02085662NLJECF4DGJV3", "Name": "syncrow.me." + }, + "hosted-zone:account=482311766496:domainName=syncrow.me:region=me-central-1": { + "Id": "/hostedzone/Z02085662NLJECF4DGJV3", + "Name": "syncrow.me." } } diff --git a/infrastructure/web-stack.ts b/infrastructure/web-stack.ts index 8ec6a7d8..5453ce5e 100644 --- a/infrastructure/web-stack.ts +++ b/infrastructure/web-stack.ts @@ -31,7 +31,7 @@ export class WebStack extends cdk.Stack { autoDeleteObjects: true, }); - // Use existing wildcard certificate in us-east-1 + // Use existing wildcard certificate in us-east-1 (required for CloudFront) const webCertificate = props?.certificateArn ? acm.Certificate.fromCertificateArn(this, 'WildcardCertificate', props.certificateArn) : acm.Certificate.fromCertificateArn(this, 'WildcardCertificate',