Skip to content

docs: add environment storage into v1.26.0 blog post#4511

Merged
mergify[bot] merged 15 commits intoaws:mainlinefrom
Lou1415926:blog/post/v1.26.0/env/storage/init
Feb 20, 2023
Merged

docs: add environment storage into v1.26.0 blog post#4511
mergify[bot] merged 15 commits intoaws:mainlinefrom
Lou1415926:blog/post/v1.26.0/env/storage/init

Conversation

@Lou1415926
Copy link
Copy Markdown
Contributor

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

@Lou1415926 Lou1415926 requested a review from a team as a code owner February 16, 2023 21:14
@Lou1415926 Lou1415926 requested review from KollaAdithya and removed request for a team February 16, 2023 21:14
@Lou1415926 Lou1415926 added the WIP Pull requests that are being modified now. label Feb 16, 2023
Comment thread site/content/blogs/release-v126.en.md Outdated

## `storage init` for environment addons

Previously, `copilot storage init` only supports storage addon that is attached to your workload:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can we take out the newline to match the "Now" section?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-02-16 at 4 59 56 PM

The newline isn't rendered as a new line! It takes two consecutive newline to render a real new line.

Comment thread site/content/blogs/release-v126.en.md Outdated
Comment thread site/content/blogs/release-v126.en.md Outdated
Comment thread site/content/blogs/release-v126.en.md Outdated
Comment thread site/content/blogs/release-v126.en.md Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 16, 2023

🍕 Here are the new binary sizes!

Name New size (kiB) size (kiB) Delta (%)
macOS (amd) 48984 48440 🥺 +1.12
macOS (arm) 49644 49108 🥺 +1.09
linux (amd) 43092 42608 🥺 +1.14
linux (arm) 42436 41924 🥺 +1.22
windows (amd) 39812 39368 🥺 +1.13

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 16, 2023

Codecov Report

Merging #4511 (cb4ade8) into mainline (c1187e7) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

@@             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              
Impacted Files Coverage Δ
internal/pkg/cli/storage_init.go 68.15% <50.00%> (-0.19%) ⬇️
...ternal/pkg/deploy/cloudformation/cloudformation.go 72.77% <0.00%> (-0.53%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment thread site/content/blogs/release-v126.en.md Outdated
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`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the "whole". I kept "isn't" though since it was suggested by #4511 (comment) and looks cleaner

Comment thread site/content/blogs/release-v126.en.md Outdated
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)!
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe consider removing it as we use "addons" everywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we can keep the link like "Now, you have the option to create environment-level storage addons: the storage..."

Copy link
Copy Markdown
Contributor Author

@Lou1415926 Lou1415926 Feb 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Screenshot 2023-02-17 at 1 20 34 PM

Comment thread site/content/blogs/release-v126.en.md Outdated
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to give a link for "best practice in the microservice world" 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

### [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.

Comment thread site/content/blogs/release-v126.en.md Outdated
Comment on lines +51 to +52
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the whole clause about "even when it shares the same lifecycle with the environment.". Figured it might help nothing but adding confusion

Comment thread site/content/blogs/release-v126.en.md Outdated

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

@Lou1415926 Lou1415926 removed the WIP Pull requests that are being modified now. label Feb 17, 2023
Comment thread site/content/blogs/release-v126.en.md Outdated
Comment thread site/content/blogs/release-v126.en.md Outdated
--name "movies" \
--lifecycle "environment"
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the prompts and flags explanation/demo!

Comment thread site/content/blogs/release-v126.en.md Outdated
Comment thread site/content/blogs/release-v126.en.md Outdated
Comment thread site/content/blogs/release-v126.en.md Outdated
```

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do we refer to Copilot as "it" elsewhere? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Lou1415926 and others added 4 commits February 17, 2023 16:27
Co-authored-by: Janice Huang <60631893+huanjani@users.noreply.github.com>
…15926/copilot-cli into blog/post/v1.26.0/env/storage/init
Copy link
Copy Markdown
Contributor

@efekarakus efekarakus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@mergify mergify Bot merged commit 3c212fb into aws:mainline Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants