docs: add environment storage into v1.26.0 blog post#4511
docs: add environment storage into v1.26.0 blog post#4511mergify[bot] merged 15 commits intoaws:mainlinefrom
Conversation
|
|
||
| ## `storage init` for environment addons | ||
|
|
||
| Previously, `copilot storage init` only supports storage addon that is attached to your workload: |
There was a problem hiding this comment.
| Previously, `copilot storage init` only supports storage addon that is attached to your workload: | |
| Previously, `copilot storage init` only supported storage addons attached to workloads: |
There was a problem hiding this comment.
Also, can we take out the newline to match the "Now" section?
|
🍕 Here are the new binary sizes!
|
Codecov Report
@@ Coverage Diff @@
## mainline #4511 +/- ##
============================================
- Coverage 69.94% 69.93% -0.01%
============================================
Files 266 266
Lines 38334 38338 +4
Branches 268 268
============================================
- Hits 26813 26812 -1
- Misses 10225 10230 +5
Partials 1296 1296
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
| when you run `copilot svc delete`. | ||
|
|
||
| Now, you have the option to create environment-level storage addons: the storage is deployed when you run `copilot env deploy`, | ||
| and isn't deleted until you delete the whole environment by running `copilot env delete`. |
There was a problem hiding this comment.
| and isn't deleted until you delete the whole environment by running `copilot env delete`. | |
| and won't be deleted until you delete the environment by running `copilot env delete`. |
There was a problem hiding this comment.
removed the "whole". I kept "isn't" though since it was suggested by #4511 (comment) and looks cleaner
| Now, you have the option to create environment-level storage addons: the storage is deployed when you run `copilot env deploy`, | ||
| and isn't deleted until you delete the whole environment by running `copilot env delete`. | ||
|
|
||
| Similar to the workload-level storage, the environment-level storage is, under the hood, just another [environment addon](../docs/developing/addons/environment.en.md)! |
There was a problem hiding this comment.
Maybe consider removing it as we use "addons" everywhere?
There was a problem hiding this comment.
Boss not sure I follow! Do you mean moving the link to other places or completely removing the link from the blog? It it's the latter, I'm not sure because I feel like a link to env addons would be helpful 🤔
There was a problem hiding this comment.
Yeah I think we can keep the link like "Now, you have the option to create environment-level storage addons: the storage..."
There was a problem hiding this comment.
I do feel like keeping the link in this place flows better 🤔 🤔 😓
"Now, you have the option to create environment-level storage addons: the storage..."
People would be disrupted to click into another link in the middle of a sentence.
Whereas
Similar to the workload storage, the environment storage is, under the hood, just another environment addon!
People will know to investigate what "environment addons" is after having a general/vague understanding of what "environment storage" is compared to "workload storage"
| Similar to the workload-level storage, the environment-level storage is, under the hood, just another [environment addon](../docs/developing/addons/environment.en.md)! | ||
|
|
||
| ### Best Practice By Default | ||
| Following the best practice in the microservice world, Copilot encourages you to set up storages that are each accessible |
There was a problem hiding this comment.
Would be great to give a link for "best practice in the microservice world" 🤔
There was a problem hiding this comment.
### [Database-Per-Service](https://docs.aws.amazon.com/prescriptive-guidance/latest/modernization-data-persistence/database-per-service.html) By Default
In the microservice world, it is generally recommended to set up data storages that are each private to a microservices,
instead of monolith storages that are shared by multiple services.
This pattern preserves the core characteristics of microservices - loose coupling.
Copilot encourages you to follow this database-per-service pattern. By default, a storage resource that Copilot generates
is assumed to be accessed by one service or job.
!!!note ""
However, each product has its own unique situation. If you do need your data storage to be shared by multiple service,
you can modify the CloudFormation template that Copilot generates for you to achieve your goal.
Changed it to ⬆️. I realized that saying it as "the" best practice may sound arrogant 😓 . Plus there might be legit situation where people do need to share the database.
| that your storage is designed to be accessed by one of your services or jobs, even when it is meant to live and die | ||
| with the environment. |
There was a problem hiding this comment.
| that your storage is designed to be accessed by one of your services or jobs, even when it is meant to live and die | |
| with the environment. | |
| that your storage is designed to be accessed by one of your services or jobs, even when it shares the same lifecycle with the environment. |
There was a problem hiding this comment.
I removed the whole clause about "even when it shares the same lifecycle with the environment.". Figured it might help nothing but adding confusion
|
|
||
| After you've answered all the prompts or skipped them by flags, Copilot will generate the CloudFormation template that defines the DynamoDB storage | ||
| under your "copilot/environments" directory. In addition, it will generate the necessary access policy; here, one that grants "api" service | ||
| access to the "movies" storage. The access policy is created as a workload-level addon that lives and dies with your service. |
There was a problem hiding this comment.
| access to the "movies" storage. The access policy is created as a workload-level addon that lives and dies with your service. | |
| access to the "movies" storage. The access policy is created as a workload-level addon. |
There was a problem hiding this comment.
Changed it to "The access policy is created as a workload addon, meaning that it is deployed and
deleted at the same time as the "api" service."
| --name "movies" \ | ||
| --lifecycle "environment" | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Love the prompts and flags explanation/demo!
| ``` | ||
|
|
||
| After you've answered all the prompts or skipped them by flags, Copilot will generate the CloudFormation template that defines the DynamoDB storage | ||
| under your "copilot/environments" directory. In addition, it will generate the necessary access policy; here, one that grants "api" service |
There was a problem hiding this comment.
| under your "copilot/environments" directory. In addition, it will generate the necessary access policy; here, one that grants "api" service | |
| under your "copilot/environments" directory. In addition, it will generate the necessary access policy; here is one that grants "api" service |
There was a problem hiding this comment.
Also, do we refer to Copilot as "it" elsewhere? 🤔
There was a problem hiding this comment.
This is the only place in this section where we do this. Hopefully from the sentence that precedes, it's clear that "it" means Copilot 🤔 ?
Or what do you think of
After you've answered all the prompts or skipped them by flags, Copilot will generate two CloudFormation template. One that defines the DynamoDB storage under your "copilot/environments" directory, the other that grants "api" service access to the "movies" storage. The access policy is created as a workload addon, meaning that it is deployed and deleted at the same time as the "api" service.
Co-authored-by: Janice Huang <60631893+huanjani@users.noreply.github.com>
…15926/copilot-cli into blog/post/v1.26.0/env/storage/init


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.