Is this feature request related to a new or existing Amplify category?
No response
Is this related to another service?
No response
Describe the feature you'd like to request
In Gen1, customers can override the built-in project resources by running amplify override project. This creates an overrides.ts file where customers can override resource properties using the CDK. For example
import { AmplifyProjectInfo, AmplifyRootStackTemplate } from '@aws-amplify/cli-extensibility-helper';
export function override(resources: AmplifyRootStackTemplate, amplifyProjectInfo: AmplifyProjectInfo) {
resources.authRole.maxSessionDuration = 3600;
}
Our code-generation should take this override.ts file into account and produce the equivalent Gen2 code.
Describe the solution you'd like
Ideally, we would transform the override.ts to look like this:
export function override(backend: Backend<any>, amplifyProjectInfo: { envName: string, projectName: string }) {
(backend.auth.resources.authenticatedUserIamRole.node.defaultChild as CfnRole).maxSessionDuration = 3600;
}
And then invoke this function from backend.ts:
import { override as overrideProject } from './override.ts`
const branchName = process.env.AWS_BRANCH ?? 'sandbox';
const backend = defineBackend({
...
});
overrideProject(backend, { envName: branchName, projectName: '<hard-code-project-name>' });
Describe alternatives you've considered
None
Additional context
|
export interface AmplifyRootStackTemplate { |
|
authRole?: iam.CfnRole; |
|
unauthRole?: iam.CfnRole; |
|
|
|
addCfnParameter: (props: cdk.CfnParameterProps, logicalId: string) => void; |
|
addCfnOutput: (props: cdk.CfnOutputProps, logicalId: string) => void; |
|
addCfnMapping: (props: cdk.CfnMappingProps, logicalId: string) => void; |
|
addCfnCondition: (props: cdk.CfnConditionProps, logicalId: string) => void; |
|
addCfnResource: (props: cdk.CfnResourceProps, logicalId: string) => void; |
|
} |
Note that the auth and unauth role used to be part of the root stack in Gen1; In Gen2, they are part of the auth stack.
Is this something that you'd be interested in working on?
Would this feature include a breaking change?
Is this feature request related to a new or existing Amplify category?
No response
Is this related to another service?
No response
Describe the feature you'd like to request
In Gen1, customers can override the built-in project resources by running
amplify override project. This creates anoverrides.tsfile where customers can override resource properties using the CDK. For exampleOur code-generation should take this
override.tsfile into account and produce the equivalent Gen2 code.Describe the solution you'd like
Ideally, we would transform the
override.tsto look like this:And then invoke this function from
backend.ts:Describe alternatives you've considered
None
Additional context
amplify-cli/packages/amplify-cli-extensibility-helper/src/types/project/types.ts
Lines 7 to 16 in 664dabc
Note that the auth and unauth role used to be part of the root stack in Gen1; In Gen2, they are part of the auth stack.
Is this something that you'd be interested in working on?
Would this feature include a breaking change?