Comments (3)
Deploy successfully for first time using using SAM CLI (Option 2 in README) straight from this git repo witout any changes
Always great to hear that all works straight out of the box!
About your issue. I had to peak at the SAM template and I think I can explain what is going on and what you can do.
Looking at the ReactApp in the template, none of it's properties will change, if you update the React app code. Therefore, CloudFormation will not update this resource.
A trick to force update, is to add a dummy parameter, eg "Version". Even though that parameter is not used by the handler, CloudFormation does not know that, and will issue the update because it sees an input property has changed:
ReactApp:
Type: Custom::ReactApp
Condition: CreateCloudFrontDistributionSpaMode
Properties:
ServiceToken: !GetAtt ReactAppHandler.Arn
BucketName: !Ref S3Bucket
UserPoolArn: !If
- CreateUserPoolAndClient
- !GetAtt UserPool.Arn
- !Ref UserPoolArn
ClientId: !If
- CreateUserPoolAndClient
- !Ref UserPoolClient
- !Ref UserPoolClientId
CognitoAuthDomain: !Ref UserPoolDomainLookup
RedirectPathSignIn: !Ref RedirectPathSignIn
RedirectPathSignOut: !Ref RedirectPathSignOut
OAuthScopes: !Join
- ","
- !Ref OAuthScopes
SignOutUrl: !Ref SignOutUrl
Version: 1 # Dummy field, change this to force CloudFormation to deploy this resource if none of the other properties change
(There is a similar field for the Lambda functions already, where this same issue occurs during development.)
Let me know if that works for you.
Now to the question, how is this supposed to work? Well I guess we did not suppose people would use the provided React app deployment mechanism to deploy updates too. Instead we figured they would just upload to the S3 bucket directly (using a utility such as s3-spa-upload).
This could use some better instructions in the docs! (For which PR's are appreciated by the way)
from cloudfront-authorization-at-edge.
Both of those options definitely work for me. That was really my question - how should this work? I suspected that the change wasn't getting triggered in the CloudFormation template but wanted to make sure I wasn't missing something.
Thanks for the full working example here and fast response to my question. I submitted a PR to update the README.
from cloudfront-authorization-at-edge.
And just to confirm that it worked - adding the dummy parameter Version
to template.yaml ReactApp
resource works. Running build and deploy steps after updating the react-app code and updating the value of the Version
(subsequent deploys) did deploy the react-app code fully (to the s3 bucket).
Thanks again for your work and help.
from cloudfront-authorization-at-edge.
Related Issues (20)
- Unable to change the code and update deployment HOT 8
- Issues with the refresh endpoint endlessly redirecting after signin HOT 33
- CloudFormation did not receive a response from your Custom Resource HOT 19
- Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”) HOT 2
- Refresh issue after token expires HOT 8
- On signout Required String parameter 'redirect_uri' is not present HOT 5
- Possible Open Redirect (CWE-601) in sample code HOT 2
- nonce cookies are not expired HOT 1
- [Feature request] Support multiple Cognito user pool clients HOT 4
- custom domain is not redirecting to cognito hosted ui HOT 1
- Getting blocked by CORS policy but unable to figure out the source HOT 5
- Node version bump HOT 7
- Custom IDP with Amplify and Auth at Edge HOT 9
- Fail on delete of the stack HOT 3
- Function must be in an Active state error on deploying the solution HOT 7
- Errors from Lambda when destroiyng the stack HOT 2
- Cognito TAGS HOT 1
- How Do I add User Pool attributes to Cookies? HOT 1
- A potential risk in cloudfront-authorization-at-edge which can be used to upload malicious code. HOT 4
- Having the ability to tune logs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudfront-authorization-at-edge.