Skip to content

Commit

Permalink
fix: add uncomment instructions in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rjabhi committed Dec 18, 2024
1 parent a8e4bb9 commit b1ca1b1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/amplify-gen2-codegen/src/backend/synthesizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ts, {
ImportDeclaration,
Node,
NodeArray,
SyntaxKind,
VariableDeclaration,
VariableStatement,
} from 'typescript';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,23 @@ Describe stack refactor to check for execution status
`### STEP 2: REDEPLOY GEN2 APPLICATION
This step will remove the hardcoded references from the template and replace them with resource references (where applicable).
2.a) Only applicable to Storage category: Uncomment the following line in \`amplify/backend.ts\` file to instruct CDK to use the gen1 S3 bucket
2.a) Uncomment the following lines in \`amplify/backend.ts\` file to instruct CDK to use the gen1 S3 bucket (if storage is enabled) and apply retain removal policies for auth and/or storage resources
\`\`\`
s3Bucket.bucketName = YOUR_GEN1_BUCKET_NAME;
\`\`\`
\`\`\`
s3Bucket.applyRemovalPolicy(RemovalPolicy.RETAIN, { applyToUpdateReplacePolicy: true });
\`\`\`
\`\`\`
cfnUserPool.applyRemovalPolicy(RemovalPolicy.RETAIN, { applyToUpdateReplacePolicy: true });
\`\`\`
\`\`\`
cfnIdentityPool.applyRemovalPolicy(RemovalPolicy.RETAIN, { applyToUpdateReplacePolicy: true });
\`\`\`
2.b) Deploy sandbox using the below command or trigger a CI/CD build via hosting by committing this file to your Git repository
\`\`\`
npx ampx sandbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,23 @@ Describe stack refactor to check for execution status
`### STEP 2: REDEPLOY GEN2 APPLICATION
This step will remove the hardcoded references from the template and replace them with resource references (where applicable).
2.a) Only applicable to Storage category: Uncomment the following line in \`amplify/backend.ts\` file to instruct CDK to use the gen1 S3 bucket
2.a) Uncomment the following lines in \`amplify/backend.ts\` file to instruct CDK to use the gen1 S3 bucket (if storage is enabled) and apply retain removal policies for auth and/or storage resources
\`\`\`
s3Bucket.bucketName = YOUR_GEN1_BUCKET_NAME;
\`\`\`
\`\`\`
s3Bucket.applyRemovalPolicy(RemovalPolicy.RETAIN, { applyToUpdateReplacePolicy: true });
\`\`\`
\`\`\`
cfnUserPool.applyRemovalPolicy(RemovalPolicy.RETAIN, { applyToUpdateReplacePolicy: true });
\`\`\`
\`\`\`
cfnIdentityPool.applyRemovalPolicy(RemovalPolicy.RETAIN, { applyToUpdateReplacePolicy: true });
\`\`\`
2.b) Deploy sandbox using the below command or trigger a CI/CD build via hosting by committing this file to your Git repository
\`\`\`
npx ampx sandbox
Expand Down
9 changes: 7 additions & 2 deletions packages/amplify-migration/src/command-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const resolveAppId = (): string => {
const unsupportedCategories = (): Map<string, string> => {
const unsupportedCategories = new Map<string, string>();
const urlPrefix = 'https://docs.amplify.aws/react/build-a-backend/add-aws-services';
const restAPIKey = 'rest api';

unsupportedCategories.set('geo', `${urlPrefix}/geo/`);
unsupportedCategories.set('analytics', `${urlPrefix}/analytics/`);
Expand All @@ -179,13 +180,17 @@ const unsupportedCategories = (): Map<string, string> => {
Object.keys(apiList).forEach((api) => {
const apiObj = apiList[api];
if (apiObj.service == 'API Gateway') {
unsupportedCategoriesList.set('rest api', unsupportedCategories.get('rest api')!);
const restAPIDocsLink = unsupportedCategories.get(restAPIKey);
assert(restAPIDocsLink);
unsupportedCategoriesList.set(restAPIKey, restAPIDocsLink);
}
});
}
} else {
if (unsupportedCategories.has(category) && Object.entries(meta[category]).length > 0) {
unsupportedCategoriesList.set(category, unsupportedCategories.get(category)!);
const unsupportedCategoryDocLink = unsupportedCategories.get(category);
assert(unsupportedCategoryDocLink);
unsupportedCategoriesList.set(category, unsupportedCategoryDocLink);
}
}
});
Expand Down

0 comments on commit b1ca1b1

Please sign in to comment.