File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,26 @@ local:
6464 VITE_BUILD_HASH=$(GIT_HASH ) yarn run dev
6565
6666deploy_prod : check_account_prod build
67+ @echo " Deploying CloudFormation stack..."
6768 sam deploy $(common_params ) --parameter-overrides $(run_env ) =prod $(set_application_prefix ) =$(application_key ) $(set_application_name ) =" $( application_name) " S3BucketPrefix=" $( s3_bucket_prefix) "
69+ @echo " Syncing S3 bucket..."
6870 aws s3 sync $(dist_ui_directory_root ) s3://$(ui_s3_bucket ) / --delete
71+ make invalidate_cloudfront
6972
7073deploy_dev : check_account_dev build
74+ @echo " Deploying CloudFormation stack..."
7175 sam deploy $(common_params ) --parameter-overrides $(run_env ) =dev $(set_application_prefix ) =$(application_key ) $(set_application_name ) =" $( application_name) " S3BucketPrefix=" $( s3_bucket_prefix) "
76+ @echo " Syncing S3 bucket..."
7277 aws s3 sync $(dist_ui_directory_root ) s3://$(ui_s3_bucket ) / --delete
78+ make invalidate_cloudfront
79+
80+ invalidate_cloudfront :
81+ @echo " Creating CloudFront invalidation..."
82+ $(eval DISTRIBUTION_ID := $(shell aws cloudformation describe-stacks --stack-name $(application_key ) --query "Stacks[0].Outputs[?OutputKey=='CloudfrontDistributionId'].OutputValue" --output text) )
83+ $(eval INVALIDATION_ID := $(shell aws cloudfront create-invalidation --distribution-id $(DISTRIBUTION_ID ) --paths "/* " --query 'Invalidation.Id' --output text --no-cli-page) )
84+ @echo " Waiting on job $( INVALIDATION_ID) ..."
85+ aws cloudfront wait invalidation-completed --distribution-id $(DISTRIBUTION_ID ) --id $(INVALIDATION_ID )
86+ @echo " CloudFront invalidation completed!"
7387
7488install :
7589 yarn -D
Original file line number Diff line number Diff line change @@ -571,11 +571,7 @@ Resources:
571571 QueryString : false
572572 Cookies :
573573 Forward : none
574- CachePolicyId : !If [
575- IsProd,
576- " 658327ea-f89d-4fab-a63d-7e88639e58f6" , # Caching-optimized in prod
577- " 4135ea2d-6df8-44a3-9df3-4b5a84be39ad" , # caching disabled in dev
578- ]
574+ CachePolicyId : 658327ea-f89d-4fab-a63d-7e88639e58f6 # caching-optimized
579575 CacheBehaviors :
580576 - PathPattern : " /api/*"
581577 TargetOriginId : ApiGatewayOrigin
You can’t perform that action at this time.
0 commit comments