-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(amplify): Add missing Framework
and Platform
Cfn properties to Amplify
#23818
Changes from all commits
3fd6411
7e2511f
8f4f4c3
a358d8f
e285ac0
31a34df
f56a87a
7d12a5c
d641f28
fdfd551
d36ced6
02d703e
d196c85
82cccc2
307d514
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -442,3 +442,19 @@ test('with custom headers', () => { | |
}, | ||
}); | ||
}); | ||
|
||
test('create an amplify app with platform ', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This single test doesn't cover all the updates. Please increase the test coverage on your changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TheRealAmazonKendra Hi, Amplify PM here, I think this test might cover the change made to the This is the minimum test I had in my PR for the same functionality for this construct. |
||
// WHEN | ||
new amplify.App(stack, 'App', { | ||
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({ | ||
owner: 'aws', | ||
repository: 'aws-cdk', | ||
oauthToken: SecretValue.unsafePlainText('secret'), | ||
}), | ||
platform: amplify.Platform.WEB, | ||
}); | ||
// THEN | ||
Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { | ||
Platform: 'WEB', | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":"21.0.0"} | ||
{"version":"29.0.0"} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "21.0.0", | ||
"version": "29.0.0", | ||
"testCases": { | ||
"integ.app-asset-deployment": { | ||
"stacks": [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is any value here valid or are there specific frameworks that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review Kendra! This is a question I've also been struggling to find the answer to -- the CloudFormation documentation has no information on what the framework property actually is and whether or not there are specific values that work (same with the Amplify Docs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the integ test successfully deploy with
framework: TestFramework
? If so, I think we can say any value is valid.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaizencc Yes it did. Since I was able to successfully deploy with
test: TestFramework
it seems that this property can take in an arbitrary string, so there is not a list of specific frameworks that are valid; if this was the case, we would implement the property as anenum
instead of astring
@TheRealAmazonKendraThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploying with an arbitrary value doesn't always mean the service will work correctly once deployed. Give me a day or two to check with the service team on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaizencc @TheRealAmazonKendra After speaking with Amplify, we learned that the
framework
property is indeed meant to be an open text field where the user can enter any value (Amplify just ignores it if it does not recognize the framework).However, we will also have to add a
platform
property in theamplify.App
construct to solve the original problem from this issue - see the updated comments on the Github issue here for full context.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I've been doing a deep dive on this module because it's on our list to stabilize and it seems that the frameworks can't actually be any value. The template might deploy, but the branch won't deploy within the app. We should discover what the combinations of platforms and frameworks are valid and update the contract accordingly. This may require a much larger set of changes that you intended to take on here, though.
Feel free to hit me up and chat about this. If it does require sweeping and/or breaking changes, I might just accept this change for the moment so that we unblock customers on this, even if I will end up altering the contract.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, the testing comments stand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, PM here from the Amplify team. I can confirm that the
framework
property in that it is an open text field for any value. The detection around how to deploy the application happens based on theplatform
property.WEB
is for SPAs or HTML based applications andWEB_COMPUTE
is for Next.js SSR only, at the moment.Personally, I would approve this framework example test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be an open text but if we know that specific values work and only work in certain cases, we can make the contract reflect that so there's less room for error.