Our template.yaml file contains all the stack-building instructions for our AWS SAM deployments. Because it is a single file, it can get quite large as it scales with the product size. It is good-boy code protocol to look for ways to break down large file sizes and store the information in them into their own respective modules.
AWS SAM provides a way to do this in the form of application nesting, however, it has limited support for our application structure. Namely, it cannot have references to the same RestApi resource in multiple files, which means our Lambda instructions cannot be separated in different files. Lambda instructions make up the majority of the template, so the inability to separate these instructions makes application nesting pretty useless.
There are two workarounds we could investigate:
Create a script that builds a singular template.yaml file from a bunch of modules at runtime. Before running sam build, the script would have to be run to prebuild the instruction file.
Investigate AWS CDK, which provides a CI/CD framework with a much higher fidelity than AWS SAM, but takes more time to set learn/set up/maintain, and would take some time to translate our existing SAM work. Note - this is a lot of work but we should be trending to use CDK > SAM anyways.
The longer we wait to do this, the bigger our template.yaml gets, and the more work it is to change the file structure when it gets to be too much.
Acceptance Criteria:
investigate the pros/cons of each method
implement if feasible/appropriate at this time
Development Checklist:
[ ] investigate pros/cons of each method
[ ] if building manual script, build the script and document.
[ ] if investigating AWS CDK, provide thorough reasoning to pursue this method, and build proof of concept. create another ticket to do the full implementation
[ ] Make sure all aspects of CI/CD pipeline work (tests, GH actions, package.json scripts, etc) following any changes
Dependencies
Blocked by
Blocking
Relevant documentation as reference
Definition of Ready
[ ] Acceptance criteria are included
[ ] Wireframes are included (if applicable)
[ ] Design / Solution is accepted by Product Owner (if applicable)
[ ] Dependencies are identified (technical, business, regulatory/policy)
[ ] Story has been estimated (under 13 pts)
Definition of Done
In progress:
[ ] Acceptance criteria are tested (Functionality meets the acceptance criteria defined in the ticket)
[ ] UI meets accessibility requirements
[ ] Unit tests are written
[ ] Work is traceable in GitHub
[ ] PR linked to ticket number
[ ] If needed/required - Dev adds flag/label to highlight any migration steps necessary prior to PROD deployment
Code review:
[ ] Code is peer reviewed and has passed CI/CD tests
QA:
[ ] Acceptance criteria are tested (Functionality meets the acceptance criteria defined in the ticket)
[ ] Code is potentially shippable to the production environment
[ ] Functional features have been tested and passed by QA
[ ] UI components tested by designer
[ ] Code is deployed to PROD when moved to 'done' column (unless requested otherwise by PO)
PO Review:
[ ] Acceptance criteria are tested (Functionality meets the acceptance criteria defined in the ticket)
Our
template.yaml
file contains all the stack-building instructions for our AWS SAM deployments. Because it is a single file, it can get quite large as it scales with the product size. It is good-boy code protocol to look for ways to break down large file sizes and store the information in them into their own respective modules.AWS SAM provides a way to do this in the form of application nesting, however, it has limited support for our application structure. Namely, it cannot have references to the same
RestApi
resource in multiple files, which means our Lambda instructions cannot be separated in different files. Lambda instructions make up the majority of thetemplate
, so the inability to separate these instructions makes application nesting pretty useless.There are two workarounds we could investigate:
template.yaml
file from a bunch of modules at runtime. Before runningsam build
, the script would have to be run to prebuild the instruction file.The longer we wait to do this, the bigger our
template.yaml
gets, and the more work it is to change the file structure when it gets to be too much.Acceptance Criteria:
Development Checklist:
Dependencies
Relevant documentation as reference
Definition of Ready
Definition of Done
Notes: