Add cloud pods collaborative debugging tutorial#1126
Conversation
|
🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-1126.surge.sh 🎊 |
giograno
left a comment
There was a problem hiding this comment.
Kudos for the tutorial 💯
I have only one question (I don't have a strong opinion about this, but it just came to mind). Since this is a tutorial on collaborative debugging, do you think adding the s3 and ORAS remotes is a bit too much? It's definitively good content, but I am wondering if it makes sense to separate it.
| load Load the state of a Cloud Pod into the application runtime/ Users can import Cloud Pods from... | ||
| remote Manage cloud pod remotes | ||
| save Create a new Cloud Pod | ||
| versions List all available versions for a Cloud Pod |
There was a problem hiding this comment.
for is colored differently. Any idea why? Maybe we should use console or shell?
There was a problem hiding this comment.
Kudos for this tutorial @tinyg210 - great to see that we're adding some stories and explicit guidance for how users can address collaborative debugging with pods! 🎉
I have some comments and suggestions - high level thoughts/summary:
- I generally find the narrative writing style (painting a storyline for the scenario, being a bit witty in a few places, adding a "personal touch" to the text) quite refreshing, but at the same time it can be challenging to stay concise and specific, making it harder to follow. I guess adopting a slightly more neutral and factual writing style could help making the content a bit easier to consume (also, it is hard to make assumptions about the level of maturity/experience of the audience - some readers may understand the context of the more witty parts, others may not)
- To focus more on the collaboration part, would it make sense to include a small figure that illustrates the actual personas involved in the scenario? This would allow us to give them explicit names, and consistently refer to the specific person/persona throughout the document. (that could make it easier to follow, rather than referring to different colleagues, team members, etc)
- Maybe we could slightly expand the scenario with more usage of pods, for example the team member helping with debugging could create the fix, push the cloud pod with the same name (to create version 2), which the other team member can then check out to reproduce the fix (this could nicely illustrate the concept of versioning). Also, stretch goal - can we think of any third role/persona that could come into play here? (Don't have an explicit example in mind, but 3 is often a good number :) )
- Agree with @giograno regarding the sections about alternative cloud pod remotes. Maybe mentioning the S3 remote is helpful, but adding ORAS as well definitely seems like a bit of "overkill". This is generally good content (!) - but could we maybe move this somewhere else in our docs? This would allow us to keep the focus on the collaboration & debugging parts in this tutorial. (We can still mention in a paragraph that alternative storage options are available to enterprise customers, but maybe no need to dedicate entire sections to it in here.)
Hope that helps - please let me know if anything is unclear, also happy to discuss/brainstorm the points directly in more detail..!
| - Basic understanding of Terraform for provisioning AWS resources | ||
|
|
||
| So let’s say a new colleague joins, clones the application repository, and starts working on the Lambda code. They will add the necessary | ||
| resources in the Terraform configuration file and some IAM policies that the functions need to be allowed to access the database (after all, |
There was a problem hiding this comment.
after all, they’re following good practices
Not sure what the reference is here - what would be an alternative solution (not following good practice) for the Lambda to access a DynamoDB table? :) (Presumably we're referring to running LS without IAM enforcement (?), but not sure this is becoming clear from the context here..)
There was a problem hiding this comment.
My thought was to mention this to highlight the granularity of IAM policy enforcement. This is the opposite of Action = ["dynamodb: *"]. I'm sure there are apps out there that go to production with terrible security policies 😄
I guess it sounded better in my head and it needs some elaborating.
| } | ||
| ``` | ||
|
|
||
| The new teammate working on this has mistakenly used `dynamodb:Scan` and `dynamodb:Query` as a replacement. |
There was a problem hiding this comment.
| The new teammate working on this has mistakenly used `dynamodb:Scan` and `dynamodb:Query` as a replacement. | |
| The new teammate working on this application has mistakenly used `dynamodb:Scan` and `dynamodb:Query`, but missed adding the `dynamodb:GetItem` action to the policy document above. |
| An `Internal server error⏎` does not give out too much information. The new colleague doesn’t know for sure what could be | ||
| causing this. The Lambda code looks fine, the configurations also look ok. | ||
|
|
||
| # **Using Cloud Pods for fast collaborative debugging** |
There was a problem hiding this comment.
nit: maybe we could remove the term "fast" here? (we already have lots of other tutorials that are focusing on the speed/velocity aspect, whereas here the focus is really on debugging&collaboration..)
| Services: sts,iam,apigateway,dynamodb,lambda,s3,cloudwatch,logs | ||
| ``` | ||
|
|
||
| LocalStack provides a remote storage backend that can be used to store the state of your application and share it with your team members. |
There was a problem hiding this comment.
| LocalStack provides a remote storage backend that can be used to store the state of your application and share it with your team members. | |
| LocalStack provides a managed storage backend that can be used to store the state of your application and share it with your team members. |
| delete Delete a Cloud Pod | ||
| list List all available Cloud Pods | ||
| load Load the state of a Cloud Pod into the application runtime/ Users can import Cloud Pods from... | ||
| remote Manage cloud pod remotes |
There was a problem hiding this comment.
nit: I understand you simply copied the CLI output here, but maybe we can slightly adjust it here, for consistency: 👍
| remote Manage cloud pod remotes | |
| remote Manage Cloud Pod remotes |
| Commands: | ||
| delete Delete a Cloud Pod | ||
| list List all available Cloud Pods | ||
| load Load the state of a Cloud Pod into the application runtime/ Users can import Cloud Pods from... |
There was a problem hiding this comment.
| load Load the state of a Cloud Pod into the application runtime/ Users can import Cloud Pods from... | |
| load Load the state of a Cloud Pod into the application runtime |
| Now, in a fresh LocalStack instance, the helper colleague can immediately load the Cloud Pod, because they’re part of the | ||
| same organization, and their licences permit this: |
There was a problem hiding this comment.
Not sure if "helper colleague" is a very common term? How about something like:
| Now, in a fresh LocalStack instance, the helper colleague can immediately load the Cloud Pod, because they’re part of the | |
| same organization, and their licences permit this: | |
| Now, other team members can load this Cloud Pod into their own LocalStack instances - this sharing | |
| works by default, as they’re part of the same organization: |
Overall, I think when we speak about collaboration as a central concept, perhaps it would make sense to include a short diagram at the beginning of the post that illustrates the persons/roles involved, and how they are collaborating as part of this tutorial? 🤔
| Not only can someone else easily reproduce the bug now, but they also have access to the state and data of the services | ||
| involved, meaning that the Lambda logs are still in the CloudWatch log groups. |
There was a problem hiding this comment.
Related to the comment above - I think from the storyline it would make sense to explicitly introduce the persons involved (say, team member A and B, or Alice and Bob, or similar...), and then reference them here directly.
Something like:
After loading the Cloud Pod state, Bob can now easily reproduce the bug on their local machine, and also has access
to the state and data of the services involved, meaning that the Lambda logs are available in the CloudWatch log groups.
| At a first glance, this error points to a permissions issue related to accessing DynamoDB. The action **`dynamodb:GetItem`** is | ||
| not authorized for the role, preventing the retrieval of a product by its ID. This kind of error was not really foreseen as one |
There was a problem hiding this comment.
| At a first glance, this error points to a permissions issue related to accessing DynamoDB. The action **`dynamodb:GetItem`** is | |
| not authorized for the role, preventing the retrieval of a product by its ID. This kind of error was not really foreseen as one | |
| At a first glance, this error points to a permissions issue related to accessing DynamoDB. The action **`dynamodb:GetItem`** is | |
| not included in the policy of the Lambda execution role, preventing the retrieval of a product by its ID. This kind of error was not really foreseen as one |
|
Hey @whummer and @giograno, thanks for the feedback! This is definitely valuable input, and here's my plan to address your comments:
Btw, my initial thought was to have a bug related to bad configuration for the API-Lambda integration (using HTTP GET, instead of POST). At that time, this was not working as expected in LS, but it has since been fixed (localstack/localstack#10473) hehe. I still think the IAM policy enforcement is more important to highlight though. Please let me know if you'd like to add/remove anything from the new approach (or if I missed anything). Otherwise, I'll be back soon with some fixes. |
content/en/tutorials/cloud-pods-collaborative-debugging/index.md
Outdated
Show resolved
Hide resolved
| ### Nice to have | ||
|
|
||
| - Basic knowledge of AWS services (API Gateway, Lambda, DynamoDB, IAM) | ||
| - Basic understanding of Terraform for provisioning AWS resources |
There was a problem hiding this comment.
Can we add this to the previous section itself?
|
|
||
| ### Starting LocalStack | ||
|
|
||
| In the root directory, there is a `docker-compose.yml` file that will spin up version 3.3.0 of LocalStack, with an |
There was a problem hiding this comment.
Any reason for picking a specific version?
There was a problem hiding this comment.
it was the latest version at that time. if cloud pods change for future versions i won't go back to change this material
Co-authored-by: Harsh Mishra <erbeusgriffincasper@gmail.com>
…ugging_tutorial' into add_cloud_pods_collaborative_debugging_tutorial
Add tutorial for using cloud pods for collaborative development and debugging in teams