Skip to content

Commit 8ab2606

Browse files
authored
fix(amplify-alpha): example code for adding a custom rule is wrong (#34353)
Closes #34351 ### Reason for this change User reported an issue with the example code in the README. ### Description of changes Fix the example. ### Describe any new or updated permissions being added None ### Description of how you validated changes No code changes. Existing rossetta test are sufficient. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7092b7d commit 8ab2606

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/@aws-cdk/aws-amplify-alpha/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ Auto build and pull request preview are enabled by default.
102102
Add custom rules for redirection:
103103

104104
```ts
105+
import { CustomRule } from '@aws-cdk/aws-amplify-alpha';
106+
105107
declare const amplifyApp: amplify.App;
106-
amplifyApp.addCustomRule({
108+
amplifyApp.addCustomRule(new CustomRule({
107109
source: '/docs/specific-filename.html',
108110
target: '/documents/different-filename.html',
109111
status: amplify.RedirectStatus.TEMPORARY_REDIRECT,
110-
});
112+
}));
111113
```
112114

113115
When working with a single page application (SPA), use the

0 commit comments

Comments
 (0)