aws-amplify / aws-amplify/amplify-cli

Custom Resources + Serverless Containers Don't Work

Open
#7,049 11 comments 3 reactions 0 assignees View on GitHub
containers extensibility feature-request p4
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### How did you install the Amplify CLI?

npm i -g @aws-amplify/cli

### If applicable, what version of Node.js are you using?

v14.7.0

### Amplify CLI Version

4.45.2

### What operating system are you using?

Mac

### Amplify Categories

api, Not applicable

### Amplify Commands

push

### Describe the bug

Referencing Custom Resources in Serverless Containers get overwritten during `amplify push`

I followed [this guide](https://docs.amplify.aws/cli/usage/customcf#n2-modify-folder-structure-for-custom-resource) to create a custom resource and reference it in the cloudformation for my serverless container but every time I add new things and run `amplify push` the file gets overwritten with my changes no longer there. This makes it impossible to reference custom references in serverless containers

### Expected behavior

Adding custom resource references to Serverless Container using [this guide](https://docs.amplify.aws/cli/usage/customcf#n2-modify-folder-structure-for-custom-resource) should work and not overwrite the cloudformation file.

### Reproduction steps

1. enable and create a serverless container using this guide: https://docs.amplify.aws/cli/usage/containers#getting-started
2. create a custom resource using this guide: https://docs.amplify.aws/cli/usage/customcf#n2-modify-folder-structure-for-custom-resource
3. referencing the custom resource, give serverless container permission to access custom resource by following this guide: https://docs.amplify.aws/cli/usage/customcf#n2-modify-folder-structure-for-custom-resource
4. run `amplify push`
5. see that references to custom resource have been over written in serverless container cloudformation

### GraphQL schema(s)

N/A

### Log output

```
# Put your logs below this line

```

```graphql
# Put schemas below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.