From 849ddc7cf8058e19887e2f704404c17807159f8f Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Tue, 20 Apr 2021 16:49:03 -0400 Subject: [PATCH] fix: skip admin queries when consolidating REST APIs --- .../src/utils/consolidate-apigw-policies.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts b/packages/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts index b5c57b82a68..480b1067894 100644 --- a/packages/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts +++ b/packages/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts @@ -178,6 +178,10 @@ export function consolidateApiGatewayPolicies(context: $TSContext, stackName: st const apis = amplifyMeta?.api ?? {}; Object.keys(apis).forEach(resourceName => { + if (resourceName === 'AdminQueries') { + return; + } + const resource = apis[resourceName]; const apiParams = loadApiWithPrivacyParams(context, resourceName, resource); @@ -231,7 +235,7 @@ export function loadApiWithPrivacyParams(context: $TSContext, name: string, reso } function updateExistingApiCfn(context: $TSContext, api: $TSObject): void { - const { resourceName } = api.params; + const resourceName = api.resourceName || api.params.resourceName; const resourceDir = getResourceDirPath(context, 'api', resourceName); const cfnTemplate = path.join(resourceDir, `${resourceName}-cloudformation-template.json`); const paramsFile = path.join(resourceDir, 'parameters.json');