Adds CDK deployment instructions and updates region

Enhances the README with CDK deployment commands.
This commit is contained in:
Ammar Qaffaf
2025-07-07 09:38:09 +03:00
parent 337e79b770
commit 99b13ee062
4 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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'),
});

View File

@ -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."
}
}

View File

@ -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',