Skip to content

Conversation

amazon-q-developer[bot]
Copy link

This pull request enhances the invalid app ID error handling in the deployment client. It adds validation to check if an Amplify app ID exists in the configured region when using branch-based deployments. If the app ID is not found, it throws a more user-friendly error message that includes both the invalid app ID and the region, helping developers quickly identify and fix app ID configuration issues. The changes primarily impact the backend identifier resolution and error handling components of the deployment system.

…p IDs

Validates app IDs for branch deployments and provides clear error messaging when an invalid app ID is provided in the configured region.
Copy link
Author

Resolves #7

Copy link
Author

To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes.

Copy link
Author

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

Copy link
Author

✅ I finished the code review, and didn't find any security or code quality issues.

Comment on lines +26 to +46
resolveMainStackName = async (): Promise<string> => {
// If the backendId has a namespace (which is the appId for branch type), validate it exists
if (this.backendId.type === 'branch' && this.amplifyClient) {
try {
await this.amplifyClient.send(
new GetAppCommand({ appId: this.backendId.namespace })
);
} catch (error) {
if (error instanceof ResourceNotFoundException) {
const region = await this.amplifyClient.config.region();
throw new BackendOutputClientError(
BackendOutputClientErrorType.INVALID_APP_ID,
`App with ID '${this.backendId.namespace}' does not exist in region ${region}. Please check the App ID and region configuration.`
);
}
throw error;
}
}

return BackendIdentifierConversions.toStackName(this.backendId);
};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add unit tests for this.

Copy link
Author

amazon-q-developer bot commented May 16, 2025

✅ I updated this pull request based on the feedback. To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes.

Implements validation for Amplify app IDs and adds comprehensive backend identifier resolution with test coverage. Includes support for sandbox fallback and proper error handling for invalid app IDs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant