File tree Expand file tree Collapse file tree 3 files changed +42
-11
lines changed
Expand file tree Collapse file tree 3 files changed +42
-11
lines changed Original file line number Diff line number Diff line change 128128 "Resource" : " *"
129129 },
130130 {
131- "Sid" : " DynamoDBDescribePermissions " ,
131+ "Sid" : " CloudFrontListPermissions " ,
132132 "Effect" : " Allow" ,
133- "Action" : " dynamodb:DescribeTable" ,
133+ "Action" : " cloudfront:ListDistributions" ,
134+ "Resource" : " *"
135+ },
136+ {
137+ "Sid" : " CloudFrontInvalidationPermissions" ,
138+ "Effect" : " Allow" ,
139+ "Action" : " cloudfront:CreateInvalidation" ,
140+ "Resource" : [
141+ " arn:aws:cloudfront::715681304208:distribution/E1YKFKA6Y16FT0" ,
142+ " arn:aws:cloudfront::715681304208:distribution/E2PCMI0RQZI3B7"
143+ ]
144+ },
145+ {
146+ "Sid" : " DynamoDBPermissions" ,
147+ "Effect" : " Allow" ,
148+ "Action" : [
149+ " dynamodb:Scan" ,
150+ " dynamodb:Query" ,
151+ " dynamodb:GetItem" ,
152+ " dynamodb:PutItem" ,
153+ " dynamodb:UpdateItem" ,
154+ " dynamodb:DeleteItem"
155+ ],
134156 "Resource" : [
135- " arn:aws:dynamodb:*:*:table/gogen-api-prod-gogen " ,
157+ " arn:aws:dynamodb:*:*:table/gogen" ,
136158 " arn:aws:dynamodb:*:*:table/gogen-staging"
137159 ]
138160 }
Original file line number Diff line number Diff line change 6060echo " Deploying to s3://$BUCKET /"
6161aws s3 sync dist/ " s3://$BUCKET /" --delete
6262
63+ # Invalidate CloudFront cache
64+ echo " Looking up CloudFront distribution for $BUCKET ..."
65+ DISTRIBUTION_ID=$( aws cloudfront list-distributions \
66+ --query " DistributionList.Items[?Aliases.Items[?@=='${BUCKET} ']].Id | [0]" \
67+ --output text)
68+
69+ if [ -z " $DISTRIBUTION_ID " ] || [ " $DISTRIBUTION_ID " = " None" ]; then
70+ echo " Warning: No CloudFront distribution found for $BUCKET . Skipping cache invalidation."
71+ else
72+ echo " Invalidating CloudFront distribution $DISTRIBUTION_ID ..."
73+ aws cloudfront create-invalidation --distribution-id " $DISTRIBUTION_ID " --paths " /*"
74+ echo " CloudFront invalidation created."
75+ fi
76+
6377echo " Deployment completed successfully for $ENVIRONMENT environment!"
Original file line number Diff line number Diff line change @@ -5,13 +5,8 @@ interface Config {
55 githubRedirectUri : string ;
66}
77
8- function getEnvValue ( name : string ) : string {
9- const value = process . env [ name ] ;
10- return value ?? '' ;
11- }
12-
138export const config : Config = {
14- apiBaseUrl : getEnvValue ( ' VITE_API_URL' ) ,
15- githubClientId : getEnvValue ( ' VITE_GITHUB_CLIENT_ID' ) ,
16- githubRedirectUri : getEnvValue ( ' VITE_GITHUB_REDIRECT_URI' ) ,
9+ apiBaseUrl : process . env . VITE_API_URL ?? '' ,
10+ githubClientId : process . env . VITE_GITHUB_CLIENT_ID ?? '' ,
11+ githubRedirectUri : process . env . VITE_GITHUB_REDIRECT_URI ?? '' ,
1712} ;
You can’t perform that action at this time.
0 commit comments