Skip to content

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

@PetroLiubynskyi

Description

@PetroLiubynskyi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-amplifyRelated to AWS AmplifybugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions