

# Indicators for local development


Enhance developer experience by modernizing the local development workflow. This allows developers to work in production-like environments dedicated to development activities while reducing early-stage bugs and promoting higher-quality code.

**Topics**
+ [

# [DL.LD.1] Establish development environments for local development
](dl.ld.1-establish-development-environments-for-local-development.md)
+ [

# [DL.LD.2] Consistently provision local environments
](dl.ld.2-consistently-provision-local-environments.md)
+ [

# [DL.LD.3] Commit local changes early and often
](dl.ld.3-commit-local-changes-early-and-often.md)
+ [

# [DL.LD.4] Enforce security checks before commit
](dl.ld.4-enforce-security-checks-before-commit.md)
+ [

# [DL.LD.5] Enforce coding standards before commit
](dl.ld.5-enforce-coding-standards-before-commit.md)
+ [

# [DL.LD.6] Leverage extensible development tools
](dl.ld.6-leverage-extensible-development-tools.md)
+ [

# [DL.LD.7] Establish sandbox environments with spend limits
](dl.ld.7-establish-sandbox-environments-with-spend-limits.md)
+ [

# [DL.LD.8] Generate mock datasets for local development
](dl.ld.8-generate-mock-datasets-for-local-development.md)
+ [

# [DL.LD.9] Share tool configurations
](dl.ld.9-share-tool-configurations.md)
+ [

# [DL.LD.10] Manage unused development environments
](dl.ld.10-manage-unused-development-environments.md)
+ [

# [DL.LD.11] Implement smart code completion with machine-learning
](dl.ld.11-implement-smart-code-completion-with-machine-learning.md)

# [DL.LD.1] Establish development environments for local development


 **Category:** FOUNDATIONAL 

Create development environments that provide individual developers with a safe space to test changes and receive immediate feedback without impacting others on the team or shared environments. Development environments are small scale, production-like environments that provide a balance between providing developers with accurate feedback and being low cost and easy to manage. Development environments serve a [different purpose](https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/sandbox-ou.html#sandbox-and-development-environments) than sandbox environments and should be used for day-to-day development and experimentation that requires access to your software components and services. 

Development environments can take the form of dedicated cloud environments, local emulations of infrastructure, or be hosted on a local workstation. While most cloud providers, open-source tools, and third parties provide options for emulating infrastructure locally on development machines, these tools might not have full feature parity, leaving them to only be suitable for a subset of use cases. Using cloud-based development environments provides the most reliable, accurate, and complete coverage when working with cloud workloads. We recommend providing a cloud-based development environment to each developer, with each environment being in a separate AWS account. 

 Developers should be encouraged to use their own development environments for testing and debugging to reduce the chance of problems occurring in environments shared by the broader team. To keep the development environment as close to the production setup as possible, deployments to the development environment should be sourced from the main releasable branch, rather than from long-lived development branches. The development environment setup should be well-documented in an up-to-date playbook that is readily available to all members of the team. For this to be effective, the playbook must be updated as the needs of the team and environment change over time. Ideally, the full lifecycle of these environments, including provisioning, are managed through automated governance processes. 

**Related information:**
+  [AWS Well-Architected Sustainability Pillar: SUS02-BP05 Optimize team member resources for activities performed](https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/sus_sus_user_a6.html) 
+  [Setting Up Your AWS Environment](https://aws.amazon.com/getting-started/guides/setup-environment/) 
+  [Dev Environments in CodeCatalyst](https://docs.aws.amazon.com/codecatalyst/latest/userguide/devenvironment.html) 
+  [Best practices for testing serverless applications](https://docs.aws.amazon.com/prescriptive-guidance/latest/serverless-application-testing/best-practices.html) 
+  [Improving the development cycle - Testing in the cloud](https://docs.aws.amazon.com/prescriptive-guidance/latest/hexagonal-architectures/improve-dev-cycle.html) 
+  [Improving the development cycle - Testing locally](https://docs.aws.amazon.com/prescriptive-guidance/latest/hexagonal-architectures/improve-dev-cycle.html) 

# [DL.LD.2] Consistently provision local environments


 **Category:** FOUNDATIONAL 

 Standardize and automate the process for setting up local development environments using managed services, infrastructure as code (IaC), and scripted automation. This approach permits environments to be reliably replicated across different systems and teams, ensuring uniformity. Consistent local environments help to reduce issues that occur only on particular machines.

 Create a baseline configuration for your local development environment that mirrors the production setup as closely as possible. Use IaC tools to define this environment, and script the provisioning process. All IaC and scripts should be version-controlled, helping to ensure that any changes are tracked and can be rolled back if necessary. Educate developers on the importance of using the provisioned environments and provide documentation on how to set up and troubleshoot these environments. Regularly review and update the baseline configuration to keep it aligned with changes in the production environment. Consider allowing developers to request local environments on-demand through a self-service developer portal. 

# [DL.LD.3] Commit local changes early and often


 **Category:** FOUNDATIONAL 

 While developing locally, developers should begin to make small, frequent commits to save versions of their code changes as they develop. Unlike pushing code changes so that they are accessible to other team members, local commits deal specifically with a developer's individual progress as they develop locally. This practice makes local development safer, enabling developers to freely innovate without fear of losing completed work by capturing snapshots of iterative changes to the code base. 

 Use version control tools, like Git, local testing tools for fast feedback, and [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) messages that describe the nature and rationale behind the changes for. Strive to make it a habit to locally commit changes as soon as a logical unit of work is completed. This can be after fixing a bug, adding a new function, or refining an existing piece of code. 

 Placing emphasis on the significance of making frequent local commits adapts developers to the idea of breaking down work into smaller, more manageable batches of work. This translates into streamlined integration processes when working in a team and is critical for practicing [continuous integration](https://aws.amazon.com/devops/continuous-integration/) and [continuous delivery](https://aws.amazon.com/devops/continuous-delivery/) (CI/CD). 

**Related information:**
+  [Git Basics - Recording Changes to the Repository](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository) 
+  [Continuous Integration - Martin Fowler](https://martinfowler.com/articles/continuousIntegration.html) 

# [DL.LD.4] Enforce security checks before commit


 **Category:** FOUNDATIONAL 

 Pre-commit hooks can be an effective tool for maintaining security best practices. These hooks can help in the early detection of potential security risks, such as exposed sensitive data or publishing code to untrusted repositories. At a minimum, use pre-commit hooks to identify hidden secrets, like passwords and access keys, before code is published to a shared repository. When discovering secrets, the code push should fail immediately—effectively preventing a security incident from occurring. 

 Select security tools compatible with your chosen programming languages and customize them to uphold your specific governance and compliance requirements. It is best to integrate these security tools into pre-commit hooks, integrated development environments (IDEs), and continuous integration pipelines so that changes are continuously checked before code is committed into a shared repository. 

**Related information:**
+  [Security in every stage of CI/CD pipeline: Pre-commit hooks](https://docs.aws.amazon.com/whitepapers/latest/practicing-continuous-integration-continuous-delivery/security-in-every-stage-of-cicd-pipeline.html#pre-commit-hooks) 
+  [Security scans - CodeWhisperer](https://docs.aws.amazon.com/codewhisperer/latest/userguide/security-scans.html) 
+  [Pre-commit](https://pre-commit.com/) 
+  [Husky](https://typicode.github.io/husky/) 
+  [Gitleaks](https://github.com/gitleaks/gitleaks) 
+  [GitGuardian](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit) 
+  [AWS-IA opinionated pre-commit hooks](https://github.com/aws-ia/pre-commit-configs) 
+  [Blog: Extend your pre-commit hooks with AWS CloudFormation Guard](https://aws.amazon.com/blogs/security/extend-your-pre-commit-hooks-with-aws-cloudformation-guard/) 

# [DL.LD.5] Enforce coding standards before commit
[DL.LD.5] Enforce coding standards before commit

 **Category:** RECOMMENDED 

 Identify common style, formatting, and other flaws before they are published to a repository. Use static code scanning tools, such as linters, to improve code quality and consistency before pushing committed code. This process can be automated using pre-commit hooks. Upon discovery, pushing the commit should ideally fail and require immediate correction by the developer. Automatically and consistently enforcing coding standards during the local development process directly improves the code review process by removing common errors before manual review. 

 Select scanning tools compatible with your chosen programming language and customize them to uphold specific coding standards and styles. It is best to integrate these tools into pre-commit hooks, integrated development environments (IDEs), and continuous integration pipelines so that changes are consistently and continuously checked at all stages of the development lifecycle. 

**Related information:**
+  [Amazon CodeGuru Reviewer](https://aws.amazon.com/codeguru/) 
+  [AWS CloudFormation Linter](https://github.com/aws-cloudformation/cfn-lint) 
+  [Pre-commit](https://pre-commit.com/) 
+  [Husky](https://typicode.github.io/husky/) 
+  [Validate your AWS SAM applications with AWS CloudFormation Linter](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/validate-cfn-lint.html) 
+  [Workshop: AWS CloudFormation Workshop - Linting and-testing](https://catalog.workshops.aws/cfn101/en-US/basics/templates/linting-and-testing) 
+  [Blog: Use Git pre-commit hooks to avoid AWS CloudFormation errors](https://aws.amazon.com/blogs/infrastructure-and-automation/use-git-pre-commit-hooks-avoid-aws-cloudformation-errors/) 
+  [Blog: Automate code reviews with Amazon CodeGuru Reviewer](https://aws.amazon.com/blogs/devops/automate-code-reviews-with-amazon-codeguru-reviewer/) 

# [DL.LD.6] Leverage extensible development tools
[DL.LD.6] Leverage extensible development tools

 **Category:** RECOMMENDED 

 Extensible software development tools, primarily integrated development environments (IDEs) or text editors, can be augmented with plugins or extensions. These plugins enhance the functionalities of the software, allowing for improved and tailored developer experiences. 

 Choose development tools that work well with your primary programming languages and technologies in your stack. Choosing a widely adopted IDE or text editor enables leveraging support communities and extension ecosystems. Teams should be encouraged to experiment with and adopt plugins that enhance code quality, simplify integrations, or speed up routine tasks. Over time, curate a list of preferred, approved extensions that align with your DevOps objectives and security requirements. Verify that there is a process in place for regularly updating these tools and extensions to benefit from the latest improvements and security patches. 

**Related information:**
+  [Security in every stage of CI/CD pipeline: IDE tools and plugins](https://docs.aws.amazon.com/whitepapers/latest/practicing-continuous-integration-continuous-delivery/security-in-every-stage-of-cicd-pipeline.html#pre-commit-hooks#ide-tools-and-plugins) 
+  [Tools to Build on AWS](https://aws.amazon.com/developer/tools/) 
+  [Dev Environments in CodeCatalyst](https://docs.aws.amazon.com/codecatalyst/latest/userguide/devenvironment.html) 

# [DL.LD.7] Establish sandbox environments with spend limits
[DL.LD.7] Establish sandbox environments with spend limits

 **Category:** RECOMMENDED 

 Sandbox environments are dedicated spaces for developers to explore, experiment, and innovate with new technologies or ideas. Unlike development environments, which are meant for more structured day-to-day development, they allow more fewer controls, while ensuring no connectivity to internal networks or other environments. 

 Create a comprehensive sandbox usage policy. This policy must set clear boundaries on the kinds of data permissible with the sandbox, ensuring no leakage of sensitive information or code. Establish rules for access controls. Some environments might be tailored for individual developers, while others could serve small teams. Rules regarding network connectivity should ensure that the sandbox remains isolated, preventing any unintended interactions with other internal networks or environments. Set tagging strategies which can aid in managing automation and cost tracking. Overall, ensure that this policy makes a distinction between sandbox environments and development environments, and lays out the use cases best suited for each. 

 Educate developers on the sandbox usage policy, including responsible and cost-effective resource management techniques. Encourage shutting down or deleting unnecessary resources, especially when they're not in active use. Sandbox environments should be treated ephemerally, with automated governance processes managing the lifecycle to create, manage, clean up resources, and destroy sandbox environments as required. 

**Related information:**
+  [AWS Well-Architected Cost Optimization Pillar: COST02-BP05 Implement cost controls](https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/cost_govern_usage_controls.html) 
+  [Sandbox per builder or team with spend limits](https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/sandbox-ou.html#sandbox-per-builder-or-team-with-spend-limits) 
+  [AWS Innovation Sandbox](https://aws.amazon.com/solutions/implementations/aws-innovation-sandbox/) 
+  [Cloud Financial Management with AWS](https://aws.amazon.com/aws-cost-management/) 
+  [Sandbox Accounts for Events](https://github.com/awslabs/sandbox-accounts-for-events) 
+  [Best practices for creating and managing sandbox accounts in AWS](https://aws.amazon.com/blogs/mt/best-practices-creating-managing-sandbox-accounts-aws/) 

# [DL.LD.8] Generate mock datasets for local development
[DL.LD.8] Generate mock datasets for local development

 **Category:** OPTIONAL 

 Mock datasets are synthetic or modified datasets that developers can use during the development process, eliminating the need to interact with real, sensitive production data. Using mock datasets ensures tests are thorough and realistic, without compromising security. 

 Use data generating tools to create mock datasets. These tools can range from random data generators to more advanced methods like generative AI. Generative AI can be used to generate synthetic datasets that can be used to test applications and is especially useful for generating data that is not often included in testing datasets, such as defects or edge cases. 

 If using real-world data is necessary for local development, ensure it is obfuscated. Methods such as masking, encrypting, or tokenizing production datasets can transform real datasets into mock datasets that are safe for local development. It might be useful to store already prepared mock datasets that can be shared between teams or systems to perform testing with. This approach creates a realistic local testing environment without risking developers handling actual production data. 

**Related information:**
+  [Testing software and systems at Amazon: Developer environment](https://youtu.be/o1sc3cK9bMU?t=1017) 
+  [Generate test data using an AWS Glue job and Python](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/generate-test-data-using-an-aws-glue-job-and-python.html) 
+  [Foundation Model API Service - Amazon Bedrock](https://aws.amazon.com/bedrock/) 
+  [What is Generative AI?](https://aws.amazon.com/what-is/generative-ai/) 

# [DL.LD.9] Share tool configurations
[DL.LD.9] Share tool configurations

 **Category:** OPTIONAL 

 Sharing tool configuration among project or team members helps ensure a uniform set up of integrated development environment (IDE) settings, text editor preferences, and pre-commit hooks. Having these configurations tailored to each code base can reduce discrepancies in code styles and promote seamless collaboration and a predictable developer experience. This enables any developer working within that repository to begin working in the environment quickly while maintaining team norms. 

 Commit tool configuration files to a shared repository. Periodically review these shared configurations, ensuring they remain updated as tools and practices evolve. While the idea promotes consistency, be mindful of the need to occasionally tailor configurations for specific tasks and preferences. 

# [DL.LD.10] Manage unused development environments
[DL.LD.10] Manage unused development environments

 **Category:** OPTIONAL 

 Properly managing unused environments prevents unnecessary resource utilization and potential security threats. When development environments are not in use, the environment and associated resources should be disabled or deleted. 

 Managing unused development environments requires tracking, disabling, or removing development setups that are dormant or no longer in active use. Regularly audit the active and inactive development environments. Implement automated tools or scripts that monitor activity and provide notifications regarding dormant environments. 

 Once identified, these environments should be archived, disabled, or removed, depending on the future needs of the project. Treat development environments as ephemeral environments to reduces the risk of incurring unexpected cost and leaving potentially insecure resources running. 

**Related information:**
+  [AWS Well-Architected Sustainability Pillar: SUS02-BP03 Stop the creation and maintenance of unused assets](https://docs.aws.amazon.com/wellarchitected/latest/sustainability-pillar/sus_sus_user_a4.html) 
+  [AWS Well-Architected Cost Optimization Pillar: COST04-BP03 Decommission resources](https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/cost_decomissioning_resources_decommission.html) 

# [DL.LD.11] Implement smart code completion with machine-learning
[DL.LD.11] Implement smart code completion with machine-learning

 **Category:** OPTIONAL 

 Use machine learning (ML) algorithms within development tools to predict and suggest code as developers write, based on patterns and commonly used syntax. This can improve development experience, speed up the coding process, and reduce the potential for errors. 

 Incorporate ML-powered code generators into your developer tools, such as IDEs or text editors, for real-time, intelligent code recommendations. Train and refine these tools with regular feedback to ensure they align with your specific coding patterns and practices. 

**Related information:**
+  [Amazon CodeWhisperer](https://aws.amazon.com/codewhisperer/) 