-
Notifications
You must be signed in to change notification settings - Fork 79
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
API Key was automatically and unintentionally replaced with migration from 6 to 7.6 #98
Comments
So, one way to resolve this, is to override the api as follows. I think that procedure exposes another bug regarding the naming of the
The type of
I'm not really sure what's going on here, it's probably not the best way to fix it, but for now it will hopefully do. |
Unfortunately, my fix doesn't work, since the Outputs still refer the other logicalId:
|
@josefaidt is there any feedback or even an update on this? |
Hey @AndreasEK 👋 apologies for the delay here! Taking a look at this now |
Hey @AndreasEK 👋 thanks for raising this, and again, apologies for the delay! Upon further investigation I was able to confirm your note:
Using the following override we can run import { AmplifyApiGraphQlResourceStackTemplate } from '@aws-amplify/cli-extensibility-helper'
export function override(resources: AmplifyApiGraphQlResourceStackTemplate) {
console.log(!!resources.api.GraphQLAPIDefaultApiKey)
console.log(!!resources['api' as any].GraphQLAPIDefaultApiKeyDefaultApiKey)
} For that issue, marking this as a bug. To override the logical ID of the GraphQL API Key, we can instead use import { AmplifyApiGraphQlResourceStackTemplate } from '@aws-amplify/cli-extensibility-helper'
export function override(resources: AmplifyApiGraphQlResourceStackTemplate) {
resources[
'api' as any
].GraphQLAPIDefaultApiKeyDefaultApiKey.overrideLogicalId(
'MyFancyGraphQLAPIKey'
)
} |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
7.6.21
What operating system are you using?
macos
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Amplify Categories
api
Amplify Commands
Not applicable
Describe the bug
Previously the statement to generate the api key had the identifier
GraphQLAPIKey
, after migrating the graphQL api, that changed toGraphQLAPIDefaultApiKey215A6DD7
. Obviously, this resulted in the deletion of the old api key, and creation of a new one. Since this happened in a dev environment, this is manageable, but how do I prevent this behaviour in production?previously generated api key:
new
cloudformation-template.json
Expected behavior
There should be a way to enforce the old naming pattern for the api key.
Reproduction steps
GraphQL schema(s)
# Put schemas below this line
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: