Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@aws-cdk\aws-amplify-alpha: branch #28289

Closed
PetroLiubynskyi opened this issue Dec 7, 2023 · 3 comments · Fixed by #28373
Closed

@aws-cdk\aws-amplify-alpha: branch #28289

PetroLiubynskyi opened this issue Dec 7, 2023 · 3 comments · Fixed by #28373
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@PetroLiubynskyi
Copy link

Describe the bug

When running stack with the following code (Python) it is not possible to deploy to AWS Amplify from asset as it is described in documentation

The code

amplify_app = amplify.App(
            self, 
            "Amplify",
            app_name="my-app",
            platform=amplify.Platform.WEB
        )

deployed_bundle = assets.Asset(
            self,
            "DeployedBundle",
            path=bundle_path)

amplify_app.add_branch(
            "AmplifyBranch",
            branch_name=env,
            asset=deployed_bundle,
            auto_build=False,
            pull_request_preview=False
        )

The reason is reference in branch.ts on line 236

entry: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-amplify-alpha', 'asset-deployment-handler', 'index.js'),

There is no dependency from @aws-cdk/custom-resource-handlers package inside @aws-cdk/aws-amplify-alpha

Expected Behavior

Amplify branch should be created from an asset

Current Behavior

Amplify branch is not created from an asset

The following error appears

image

Reproduction Steps

Execute the code

amplify_app = amplify.App(
            self, 
            "Amplify",
            app_name="my-app",
            platform=amplify.Platform.WEB
        )

deployed_bundle = assets.Asset(
            self,
            "DeployedBundle",
            path=bundle_path)

amplify_app.add_branch(
            "AmplifyBranch",
            branch_name=env,
            asset=deployed_bundle,
            auto_build=False,
            pull_request_preview=False
        )

Possible Solution

Add dependency to @aws-cdk/custom-resource-handlers package inside @aws-cdk/aws-amplify-alpha and publish @aws-cdk/custom-resource-handlers itself

Additional Information/Context

No response

CDK CLI Version

aws-cdk.aws-amplify-alpha==2.114.1a0

Framework Version

No response

Node.js Version

18.14.0

OS

Windows 11 Pro

Language

Python

Language Version

3.10.11

Other information

No response

@PetroLiubynskyi PetroLiubynskyi added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 7, 2023
@github-actions github-actions bot added the @aws-cdk/aws-amplify Related to AWS Amplify label Dec 7, 2023
@pahud pahud added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 12, 2023
@pahud
Copy link
Contributor

pahud commented Dec 12, 2023

Thanks for the report. Looks like we should add the dependency.

@mergify mergify bot closed this as completed in #28373 Dec 14, 2023
mergify bot pushed a commit that referenced this issue Dec 14, 2023
…ndlers (#28373)

Add dependency from from **@aws-cdk/custom-resource-handlers** to **@aws-cdk/aws-amplify-alpha** as part of effort to standardize custom resource creation and bundling of source code.


Verified addition with `yarn install` and `yarn test`. 


Closes #28289.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@PetroLiubynskyi
Copy link
Author

PetroLiubynskyi commented Jan 6, 2024

@pahud

The issue is not fixed in version 2.118.0a0

There is still an error when running "amplify_app.add_branch"

" Cannot find entry file at C:\Users\user1\AppData\Local\Temp\jsii-kernel-1N88ev\node_modules@aws-cdk\custom-resource-handlers\dist\aws-amplify-alpha\asset-deployment-handler\index.js"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants