<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Charles Wan on Medium]]></title>
        <description><![CDATA[Stories by Charles Wan on Medium]]></description>
        <link>https://medium.com/@charleswan111?source=rss-86bb0f0c50a1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DX6yHs2gXqgHqO17k4T6YQ.jpeg</url>
            <title>Stories by Charles Wan on Medium</title>
            <link>https://medium.com/@charleswan111?source=rss-86bb0f0c50a1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 13:51:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@charleswan111/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[GitLab Quick Reference]]></title>
            <link>https://charleswan111.medium.com/gitlab-quick-reference-1e06ce793628?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e06ce793628</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[stage]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 15:16:03 GMT</pubDate>
            <atom:updated>2025-02-05T15:16:03.258Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1hQ5W-VdKew3SQ9v" /><figcaption>Photo by <a href="https://unsplash.com/@jordanfmcqueen?utm_source=medium&amp;utm_medium=referral">Jordan McQueen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>.gitlab-ci.yml example</strong></p><pre>before_script:<br>  - rm -rf /root/go/src/gitlab.jiagouyun.com/cloudcare-tools/datakit<br><br>variables:<br>  CI_VERSION: &quot;1.61.0&quot;<br><br>stages:<br>  - test<br>  - deploy_ebpf<br>  - deploy<br><br># run lint and unit test for most of the branches<br>ci_lint_and_ut: <br>  stage: deploy<br>  resource_group: production<br>  rules:<br>    # No pipeline when there is a MR whose title starts with Draft<br>    # Disable merge request to master/main branch<br>    - if: $CI_PIPELINE_SOURCE == &quot;merge_request_event&quot; &amp;&amp; $CI_MERGE_REQUEST_TITLE =~ /^(\[Draft\]|\(Draft\)|Draft:)/<br>      when: never<br><br>    # Trigger a pipeline in case of MR event, which means the MR is ready, since we did not go through the first case<br>    - if: $CI_PIPELINE_SOURCE == &quot;merge_request_event&quot;<br><br>  script:<br>    - nvm use v16.14.0<br><br>  tags:<br>    - cloudcare-ft<br><br>ut-datakit-production:<br>  stage: test<br>  resource_group: production<br>  only:<br>    - unstable<br>    - master<br>  script:<br>    - make clean<br>  tags:<br>    - cloudcare-ft<br><br>ut-datakit-testing:<br>  stage: test<br>  resource_group: production<br>  only:<br>    - testing<br>    - /^testing-.*$/<br>  script:<br>    - make testing_notify GIT_BRANCH=$CI_COMMIT_BRANCH VERSION=&quot;$CI_TESTING_VERSION&quot;<br>  tags:<br>    - cloudcare-ft<br><br>release-ebpf-amd64-testing:<br>  stage: deploy_ebpf<br>  resource_group: production<br>  needs: [ut-datakit-testing]<br>  image: pubrepo.jiagouyun.com/ebpf-dev/datakit-developer:1.9<br>  only:<br>    - testing<br>    - /^testing-.*$/<br>  script:<br>    - make pub_epbf_testing DATAKIT_EBPF_ARCHS=&quot;linux/amd64&quot; GIT_BRANCH=$CI_COMMIT_BRANCH VERSION=&quot;$CI_TESTING_VERSION&quot;<br>  tags:<br>    - cloudcare-ft-docker<br><br>release-ebpf-aarch64-testing:<br>  stage: deploy_ebpf<br>  resource_group: production<br>  needs: [ut-datakit-testing]<br>  image: pubrepo.jiagouyun.com/ebpf-dev/datakit-developer:1.9<br>  only:<br>    - testing<br>    - /^testing-.*$/<br>  script:<br>    - make pub_epbf_testing DATAKIT_EBPF_ARCHS=&quot;linux/arm64&quot; GIT_BRANCH=$CI_COMMIT_BRANCH VERSION=&quot;$CI_TESTING_VERSION&quot;<br>  tags:<br>    - dk-arm-docker-runner<br><br>release-ebpf-amd64-production:<br>  stage: deploy_ebpf<br>  resource_group: production<br>  needs: [ut-datakit-production]<br>  image: pubrepo.jiagouyun.com/ebpf-dev/datakit-developer:1.9<br>  only:<br>    - master<br>    - unstable<br>  script:<br>    - make pub_ebpf_production DATAKIT_EBPF_ARCHS=&quot;linux/amd64&quot; GIT_BRANCH=$CI_COMMIT_BRANCH VERSION=&quot;$CI_VERSION&quot;<br>  tags:<br>    - cloudcare-ft-docker<br><br>release-ebpf-aarch64-production:<br>  stage: deploy_ebpf<br>  resource_group: production<br>  needs: [ut-datakit-production]<br>  image: pubrepo.jiagouyun.com/ebpf-dev/datakit-developer:1.9<br>  only:<br>    - master<br>    - unstable<br>  script:<br>    - make pub_ebpf_production DATAKIT_EBPF_ARCHS=&quot;linux/arm64&quot; GIT_BRANCH=$CI_COMMIT_BRANCH VERSION=&quot;$CI_VERSION&quot;<br>  tags:<br>    - dk-arm-docker-runner<br><br>release-testing:<br>  stage: deploy<br>  resource_group: production<br>  needs:<br>    [<br>      ut-datakit-testing,<br>      release-ebpf-amd64-testing,<br>      release-ebpf-aarch64-testing,<br>    ]<br>  only:<br>    - testing<br>    - /^testing-.*$/<br>  script:<br>    - export AWS_ACCESS_KEY_ID=&quot;$TESTING_AWS_ACCESS_KEY_ID&quot;<br>  tags:<br>    - cloudcare-ft<br><br>release-stable:<br>  stage: deploy<br>  resource_group: production<br>  needs:<br>    [<br>      ut-datakit-production,<br>      release-ebpf-amd64-production,<br>      release-ebpf-aarch64-production,<br>    ]<br>  only:<br>    - master<br>  except: # disable CI on tag push<br>    - tags<br>  script:<br>    - make check_production_conf_compatible<br>  tags:<br>    - cloudcare-ft<br><br># for testing current issue, should delete after merge into master<br>current-testing:<br>  stage: deploy<br>  resource_group: production<br>  only:<br>    - /^xxx-.*$/<br>  script:<br>    - make testing_image VERSION=&quot;$CI_TESTING_VERSION&quot;<br>  tags:<br>    - cloudcare-ft<br><br><br>build-profiling-image:<br>  stage: deploy<br>  resource_group: production<br>  only:<br>    - /^k8s_profilers[-_].*$/<br>  script:<br>    - cd k8s-profilers &amp;&amp; make build<br>  tags:<br>    - cloudcare-ft</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e06ce793628" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD: Continuous Integration and Continuous Delivery/Deployment]]></title>
            <link>https://charleswan111.medium.com/ci-cd-continuous-integration-and-continuous-delivery-deployment-36a2b7e140e7?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/36a2b7e140e7</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 15:16:03 GMT</pubDate>
            <atom:updated>2025-02-05T15:16:03.240Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oyS6iLfGVsfbpZzD" /><figcaption>Photo by <a href="https://unsplash.com/@nathananderson?utm_source=medium&amp;utm_medium=referral">Nathan Anderson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>CI/CD stands for <strong>Continuous Integration</strong> and <strong>Continuous Delivery/Continuous Deployment</strong>, key practices in modern software development that streamline the software creation and delivery process.</p><p><strong>1. Understanding CI/CD</strong></p><h4><strong>Continuous Integration (CI)</strong></h4><ul><li>CI is the practice of frequently integrating code changes into a shared repository, often multiple times a day.</li><li>Developers commit their code to version control (e.g., Git), and each integration is automatically verified by running automated tests to detect issues early.</li><li>CI helps catch bugs quickly, maintain code quality, and reduce integration problems.</li></ul><h4><strong>Continuous Delivery (CD)</strong></h4><ul><li>Continuous Delivery extends CI by automating the process of delivering code to production-like environments.</li><li>Once CI builds and tests pass, the application is automatically deployed to staging or testing environments for further validation.</li><li>Ensures that code is always in a deployable state, allowing releases to production at any time, usually with the push of a button.</li></ul><h4><strong>Continuous Deployment (CD)</strong></h4><ul><li>A step beyond Continuous Delivery, where code changes that pass automated tests are automatically deployed to production without human intervention.</li><li>Enables faster and more frequent releases but requires rigorous automated testing to ensure stability in production.</li></ul><p>By implementing CI/CD, development teams achieve faster releases, higher quality, and more efficient collaboration.</p><p><strong>2. Building a CI/CD Pipeline with GitHub Actions</strong></p><p>A CI/CD pipeline automates integration, testing, and deployment of code changes. Below is a step-by-step guide to setting up a basic CI/CD pipeline using <strong>GitHub Actions</strong> for a <strong>Node.js application</strong>.</p><h4><strong>Prerequisites:</strong></h4><ul><li>A GitHub repository with your code (e.g., a Node.js app).</li><li>Basic knowledge of YAML syntax for configuration files.</li></ul><h4><strong>Step 1: Set Up a GitHub Repository</strong></h4><p>Create a GitHub repository and add your application code (e.g., a simple Node.js app with server.js and package.json).</p><h4><strong>Step 2: Create a GitHub Actions Workflow</strong></h4><ul><li>Create a .github/workflows directory in your repository if it doesn’t exist.</li><li>Inside this directory, create a workflow configuration file (e.g., ci-cd-pipeline.yml).</li></ul><h4><strong>Step 3: Define the CI Workflow</strong></h4><p>Below is an example of a basic CI workflow for a Node.js app. This configuration runs on every push or pull request to the main branch.</p><pre>name: CI/CD Pipeline<br><br>on:<br>  push:<br>    branches:<br>      - main<br>  pull_request:<br>    branches:<br>      - main<br><br>jobs:<br>  build:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>    - name: Checkout code<br>      uses: actions/checkout@v3<br><br>    - name: Set up Node.js<br>      uses: actions/setup-node@v3<br>      with:<br>        node-version: &#39;16&#39;<br><br>    - name: Install dependencies<br>      run: npm install<br><br>    - name: Run tests<br>      run: npm test</pre><h4><strong>Step 4: Add Continuous Delivery or Deployment</strong></h4><p>For Continuous Delivery, let’s deploy the application to <strong>Heroku</strong> after successful build and tests.</p><pre>jobs:<br>  deploy:<br>    runs-on: ubuntu-latest<br>    needs: build  # Ensures deployment only runs after build is successful<br><br>    steps:<br>    - name: Checkout code<br>      uses: actions/checkout@v3<br><br>    - name: Set up Node.js<br>      uses: actions/setup-node@v3<br>      with:<br>        node-version: &#39;16&#39;<br><br>    - name: Install dependencies<br>      run: npm install<br><br>    - name: Deploy to Heroku<br>      uses: akshnz/heroku-deploy@v1<br>      with:<br>        heroku_api_key: ${{ secrets.HEROKU_API_KEY }}<br>        heroku_app_name: &#39;your-heroku-app-name&#39;<br>        heroku_email: ${{ secrets.HEROKU_EMAIL }}</pre><h4><strong>Step 5: Configure GitHub Secrets for Deployment</strong></h4><p>To securely store Heroku credentials:</p><p>1. Navigate to <strong>GitHub Repository → Settings → Secrets and Variables → Actions</strong>.</p><p>2. Add the following secrets:</p><ul><li>HEROKU_API_KEY: Your Heroku API key.</li><li>HEROKU_EMAIL: The email associated with your Heroku account.</li></ul><h4><strong>Step 6: Push the Workflow File and Code Changes</strong></h4><p>Once your ci-cd-pipeline.yml file is ready, commit and push it to the main branch of your GitHub repository.</p><pre>git add .github/workflows/ci-cd-pipeline.yml<br>git commit -m &quot;Add CI/CD pipeline for Node.js app&quot;<br>git push origin main</pre><h4><strong>Step 7: Check the Workflow Status</strong></h4><ul><li>Go to your <strong>GitHub repository</strong> and navigate to the <strong>Actions</strong> tab.</li><li>The CI/CD pipeline will run, checking out the code, running tests, and deploying to Heroku if everything is set up correctly.</li></ul><p><strong>3. Conclusion</strong></p><p>This guide demonstrated how to build a simple CI/CD pipeline that:</p><p>1. Integrates and tests code on every push or pull request.</p><p>2. Deploys the app to a cloud service (e.g., Heroku) after successful build and testing.</p><p>You can customize this pipeline further based on your stack, such as using <strong>Docker, AWS, or Azure</strong>, depending on your project requirements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36a2b7e140e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Secure and Scalable Foundation: An Introduction to Cloud Landing Zones]]></title>
            <link>https://charleswan111.medium.com/building-a-secure-and-scalable-foundation-an-introduction-to-cloud-landing-zones-0125c6d2e4b0?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0125c6d2e4b0</guid>
            <category><![CDATA[governance]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[landingzone]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 15:16:02 GMT</pubDate>
            <atom:updated>2025-02-05T15:16:02.993Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VMVme7CnOMeTRkL3" /><figcaption>Photo by <a href="https://unsplash.com/@vivanebro?utm_source=medium&amp;utm_medium=referral">Aviv Ben Or</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A <strong>Landing Zone</strong> is a structured, secure, and scalable cloud environment that provides a foundation for deploying and managing cloud workloads. It acts as a blueprint or framework for organizations to set up and govern their cloud infrastructure efficiently while meeting best practices for security, compliance, and operational efficiency.</p><p><strong>Key Aspects of a Landing Zone</strong></p><p>1. <strong>Centralized Governance</strong>:</p><ul><li>Implements security controls, compliance policies, and monitoring to ensure adherence to organizational requirements.</li></ul><p>2. <strong>Networking Setup</strong>:</p><ul><li>Configures Virtual Private Clouds (VPCs) or Virtual Networks (VNets), subnets, routing tables, firewalls, and connectivity with on-premises networks.</li></ul><p>3. <strong>Identity and Access Management (IAM)</strong>:</p><ul><li>Establishes user roles, permissions, and identity policies for secure access to resources.</li></ul><p>4. <strong>Multi-Account or Multi-Subscription Strategy</strong>:</p><ul><li>Organizes resources across multiple accounts or subscriptions to isolate workloads, enforce billing separation, and manage access.</li></ul><p>5. <strong>Automation and Scalability</strong>:</p><ul><li>Uses Infrastructure as Code (IaC) tools, such as Terraform, AWS CloudFormation, or Azure Resource Manager templates, to automate the provisioning of resources.</li></ul><p>6. <strong>Cost Management</strong>:</p><ul><li>Provides tools and policies for tracking and optimizing cloud spending.</li></ul><p>7. <strong>Security and Compliance</strong>:</p><ul><li>Enforces encryption, logging, auditing, and compliance frameworks tailored to organizational needs (e.g., HIPAA, GDPR, or SOC 2).</li></ul><p><strong>Use Cases of a Landing Zone</strong></p><ul><li><strong>Cloud Migration</strong>: Provides a controlled environment to migrate workloads from on-premises to the cloud.</li><li><strong>Application Modernization</strong>: Offers a scalable infrastructure to modernize applications using cloud-native technologies.</li><li><strong>DevOps Implementation</strong>: Simplifies CI/CD pipelines by setting up a foundational environment aligned with DevOps practices.</li><li><strong>Multi-Cloud or Hybrid Cloud</strong>: Manages resources across different cloud providers or integrates on-premises systems with cloud environments.</li></ul><p><strong>Examples of Landing Zones by Cloud Providers</strong></p><p>1. <strong>AWS Landing Zone</strong>:</p><ul><li>AWS Control Tower offers a pre-configured landing zone to manage multi-account environments with governance and security.</li></ul><p>2. <strong>Azure Landing Zone</strong>:</p><ul><li>Microsoft Azure provides Azure Landing Zone blueprints as part of the Cloud Adoption Framework.</li></ul><p>3. <strong>Google Cloud Landing Zone</strong>:</p><ul><li>Google Cloud offers best practices and tools for creating secure, scalable environments tailored to specific needs.</li></ul><p>A landing zone is essential for ensuring consistency, security, and efficiency when scaling cloud operations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0125c6d2e4b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding CIDR Notation and Subnet Masks]]></title>
            <link>https://charleswan111.medium.com/understanding-cidr-notation-and-subnet-masks-1198fc032b5b?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1198fc032b5b</guid>
            <category><![CDATA[cidr-notation]]></category>
            <category><![CDATA[subnet-mask]]></category>
            <category><![CDATA[ip-address]]></category>
            <category><![CDATA[network-configuration]]></category>
            <category><![CDATA[network]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 15:16:02 GMT</pubDate>
            <atom:updated>2025-02-05T15:16:02.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mdYlYHVRcRgaj1Gr" /><figcaption>Photo by <a href="https://unsplash.com/@maring224?utm_source=medium&amp;utm_medium=referral">Molly McTater</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the world of networking, understanding CIDR (Classless Inter-Domain Routing) notation and subnet masks is crucial. This article will explore two common CIDR notations, /32 and /16, to help you gain a better understanding of how they work and their typical use cases.</p><p><strong>CIDR </strong><strong>/32: A Single IP Address</strong></p><p>In the IP address 192.168.1.23/32, the number 32 following the slash represents the subnet mask in CIDR notation. This notation is used to define the number of fixed bits in the subnet mask.</p><h4><strong>Key Characteristics of </strong><strong>/32</strong></h4><ul><li>The number 32 indicates that all 32 bits in the subnet mask are set to 1, which is equivalent to 255.255.255.255 in decimal notation.</li><li>This configuration defines a single IP address, specifically 192.168.1.23, without including any additional addresses.</li></ul><h4><strong>How It Works</strong></h4><p>A subnet mask is used to split an IP address into a network portion and a host portion. In the case of a /32 subnet, there is only one possible address in the network, making it the smallest possible subnet.</p><h4><strong>Common Use Cases for /32</strong></h4><p>This notation is often employed in networking for precise control:</p><ul><li><strong>Identifying a single host</strong>: For example, in firewall rules, where specific access needs to be defined for a particular device.</li><li><strong>Defining a specific address</strong>: Such as in VPN configurations or access control lists, to ensure that only a particular IP can access certain resources.</li></ul><p>In summary, 192.168.1.23/32 refers strictly to the IP 192.168.1.23 and does not cover any other addresses.</p><p><strong>CIDR </strong><strong>/16: A Large Subnet</strong></p><p>In the IP address 192.168.1.23/16, the number 16 after the slash means that the first 16 bits of the subnet mask are 1, while the remaining 16 bits are 0. This notation defines a larger subnet range.</p><h4><strong>Key Characteristics of </strong><strong>/16</strong></h4><p>1. <strong>Subnet Mask Representation</strong></p><ul><li>A /16 subnet corresponds to the subnet mask 255.255.0.0 in decimal notation.</li><li>In binary, it is represented as 11111111.11111111.00000000.00000000.</li></ul><p>2. <strong>Network and Address Range</strong></p><ul><li>The first 16 bits (192.168) represent the network portion, while the last 16 bits define the host addresses.</li><li>For the address 192.168.1.23/16, the full range of IPs in this subnet is from the starting IP 192.168.0.0 to the ending IP 192.168.255.255.</li></ul><p>3. <strong>Number of Available Hosts</strong></p><ul><li>The remaining 16 bits allow for 2¹⁶=65,536 total addresses.</li><li>After subtracting the network address (192.168.0.0) and the broadcast address (192.168.255.255), the actual number of usable hosts is 65,536–2=65,534.</li></ul><h4><strong>Common Use Cases for /16</strong></h4><p>A /16 subnet is typically used for large networks due to its ability to support thousands of devices. Some examples include:</p><ul><li><strong>Enterprise internal networks</strong>: These often have a large number of devices, such as computers, servers, and printers, and a /16 subnet can accommodate them all.</li><li><strong>Cloud infrastructure</strong>: Where multiple servers share the same network, a /16 subnet provides enough IP addresses for the various virtual machines and services.</li></ul><h4><strong>Summary</strong></h4><ul><li>192.168.1.23/16 defines a subnet where 192.168 is the network identifier.</li><li>The IP range extends from 192.168.0.0 to 192.168.255.255, allowing for 65,534 usable addresses.</li></ul><p>By understanding these two common CIDR notations, you can better manage and design network configurations to meet the needs of different scenarios, whether it’s a small, highly controlled environment or a large — scale enterprise or cloud — based network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1198fc032b5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Passing Values in Helm: A Guide to Configuring Your Helm Charts]]></title>
            <link>https://charleswan111.medium.com/passing-values-in-helm-a-guide-to-configuring-your-helm-charts-f6c5ca23310d?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6c5ca23310d</guid>
            <category><![CDATA[values]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[helm-commands]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[helm-chart]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 15:16:02 GMT</pubDate>
            <atom:updated>2025-02-05T15:16:02.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LY9POtQX7z9K8Dx3" /><figcaption>Photo by <a href="https://unsplash.com/@zshmo?utm_source=medium&amp;utm_medium=referral">Hoodh Ahmed</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In Helm, you can pass values to variables defined in your Helm chart using various methods. Below are the primary ways to achieve this:</p><p><strong>1. Using a </strong><strong>values.yaml File (Recommended)</strong></p><p>The default and most structured way to provide values to a Helm chart is through a values.yaml file:</p><pre>replicaCount: 3<br>image:<br>  repository: nginx<br>  tag: &quot;1.16&quot;</pre><p>Then install your chart with:</p><pre>helm install my-release my-chart -f values.yaml</pre><p>You can also use multiple values.yaml files:</p><pre>helm install my-release my-chart -f values1.yaml -f values2.yaml</pre><p><strong>2. Using the </strong><strong>--set Flag</strong></p><p>You can pass values directly from the command line using the <strong>--set</strong> flag:</p><pre>helm install my-release my-chart --set key=value</pre><p>For example:</p><pre>helm install my-release my-chart --set replicaCount=3,image.tag=1.16</pre><p><strong>3. Combining </strong><strong>--set with </strong><strong>values.yaml</strong></p><p>Helm allows you to combine --set and values.yaml. The --set values take precedence over the values in the values.yaml file:</p><pre>helm install my-release my-chart -f values.yaml --set replicaCount=5</pre><p><strong>4. Using Environment Variables with </strong><strong>--set</strong></p><p>You can use environment variables in combination with the --set flag:</p><pre>helm install my-release my-chart --set key=$ENV_VAR</pre><p><strong>5. Using a Helmfile (For Managing Multiple Charts)</strong></p><p>If you manage multiple Helm charts and values, you can use <a href="https://github.com/helmfile/helmfile">Helmfile</a> to pass values to variables:</p><pre>releases:<br>  - name: my-release<br>    chart: my-chart<br>    values:<br>      - values.yaml<br>      - additional-values.yaml<br>    set:<br>      - name: replicaCount<br>        value: 3</pre><p><strong>6. Using Values in Helm Templates</strong></p><p>In your Helm template files, access the variables using the Values object. For instance:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: {{ .Release.Name }}<br>spec:<br>  replicas: {{ .Values.replicaCount }}<br>  template:<br>    spec:<br>      containers:<br>        - name: app<br>          image: &quot;{{ .Values.image.repository }}:{{ .Values.image.tag }}&quot;</pre><p>This reorganization improves readability and provides a logical flow from the most commonly used methods to more advanced approaches.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6c5ca23310d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Quick Reference]]></title>
            <link>https://charleswan111.medium.com/python-quick-reference-68538c73f236?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/68538c73f236</guid>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[seaborn]]></category>
            <category><![CDATA[statsmodels]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pandas]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 15:16:02 GMT</pubDate>
            <atom:updated>2025-02-05T15:16:02.195Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0UTQ1UmRMzOT4BL6" /><figcaption>Photo by <a href="https://unsplash.com/@dancristianpaduret?utm_source=medium&amp;utm_medium=referral">Dan Cristian Pădureț</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Python Commonly Used Libraries</strong></p><ul><li><strong>NumPy</strong>: Efficient operations on large, multi-dimensional arrays and matrices with mathematical functions.</li><li><strong>Seaborn</strong>: High-level statistical data visualization built on Matplotlib.</li><li><strong>Pandas</strong>: Data manipulation and analysis with powerful DataFrame structures.</li><li><strong>StatsModels</strong>: Statistical modeling and testing with detailed outputs.</li><li><strong>Scikit-Learn**</strong>: Machine learning tools for classification, regression, clustering, and preprocessing.</li><li><strong>Matplotlib</strong>: Comprehensive library for creating static, interactive, and animated visualizations.</li><li><strong>Plotly</strong>: Interactive, web-based plots and dashboards.</li><li><strong>Bokeh</strong>: Interactive visualizations and dashboards for the web.</li><li><strong>Pydot</strong>: Graph and diagram generation using Graphviz.</li><li><strong>SciPy</strong>: Advanced scientific computing with optimization, integration, and signal processing.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68538c73f236" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pulumi Quick Reference]]></title>
            <link>https://charleswan111.medium.com/pulumi-quick-reference-64bcfd728883?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/64bcfd728883</guid>
            <category><![CDATA[pulumi]]></category>
            <category><![CDATA[credentials]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[config]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 15:16:02 GMT</pubDate>
            <atom:updated>2025-02-05T15:16:02.172Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*McYZ7k7QngyHEFJj" /><figcaption>Photo by <a href="https://unsplash.com/@nicolaslafargue?utm_source=medium&amp;utm_medium=referral">Nicolas Lafargue</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Why use Pulumi</strong></p><ul><li>Conditionals</li><li>Loops</li><li>Functions</li></ul><p><strong>Commands</strong></p><pre>brew install pulumi<br>pulumi new<br>pulumi stack output<br>pulumi up<br>pulumi destroy</pre><p><strong>AWS credentials</strong></p><pre>~/.aws/credentials</pre><pre>pulumi configure # Set credentials</pre><pre># Set as environment variables<br>export AWS_ACCESS_KEY_ID=&lt;YOUR_AWS_ACCESS_KEY_ID&gt;<br>export AWS_SECRET_ACCESS_KEY=&lt;YOUR_SECRET_ACCESS_KEY&gt;</pre><pre>pulumi config set aws:region us-east-1<br>pulumi config set instanceCount 5<br>pulumi config set dbPassword &lt;PASSWORD&gt; --secret<br>pulumi config </pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64bcfd728883" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Practices for Designing Terraform Modules: Maintainability, Reusability, and Security]]></title>
            <link>https://charleswan111.medium.com/best-practices-for-designing-terraform-modules-maintainability-reusability-and-security-2633ecd7b065?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2633ecd7b065</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[versioning]]></category>
            <category><![CDATA[terraform-modules]]></category>
            <category><![CDATA[state-management]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 15:16:52 GMT</pubDate>
            <atom:updated>2025-02-03T15:16:52.145Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1lv0QuwIa-95eBSp" /><figcaption>Photo by <a href="https://unsplash.com/@sevaltorun?utm_source=medium&amp;utm_medium=referral">Seval Torun</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When designing a Terraform module, to ensure maintainability, reusability, and security, the following key considerations should be kept in mind:</p><p><strong>1. Input Variables</strong></p><ul><li><strong>Clarity &amp; Documentation</strong>: Clearly define input variables and provide proper descriptions for each one. Document the expected types, default values, and allowed values.</li><li><strong>Sensitive Variables</strong>: Mark variables such as passwords as sensitive = true to prevent accidental exposure in logs or outputs.</li><li><strong>Use of Defaults</strong>: Provide sensible default values, while still allowing users the flexibility to override them when needed.</li></ul><p><strong>2. Output Variables</strong></p><ul><li><strong>Selective Exposure</strong>: Only output values that are necessary for the module’s consumers. Avoid exposing sensitive information unless it’s absolutely required.</li><li><strong>Sensitive Outputs</strong>: Mark outputs with sensitive data as sensitive = true.</li></ul><p><strong>3. Module Reusability</strong></p><ul><li><strong>Modular Design</strong>: Keep modules small and focused on a single responsibility. A module should typically perform a single task or represent a single resource/service.</li><li><strong>Avoid Hardcoding</strong>: Do not hardcode resource names, IDs, or other values that could limit the module’s reusability across different environments or accounts.</li><li><strong>Parameterization</strong>: Enable users to pass custom values for parameters that may vary, such as regions, names, or resource counts.</li></ul><p><strong>4. Versioning</strong></p><ul><li><strong>Module Versioning</strong>: Implement versioning for your modules, preferably using semantic versioning (e.g., v1.0.0), to help consumers track changes and upgrade with confidence.</li><li><strong>Backward Compatibility</strong>: When making breaking changes, provide clear documentation on the changes and how users can migrate to the new version.</li></ul><p><strong>5. State Management</strong></p><ul><li><strong>State Isolation</strong>: Design modules so that they do not rely on the global state. Use backend configurations like S3 or Terraform Cloud to manage state, especially for shared resources.</li><li><strong>Minimal Side Effects</strong>: Avoid using a module to modify existing infrastructure unless it is part of the intended module output, as this could unexpectedly affect other resources or systems.</li></ul><p><strong>6. Resource Dependencies</strong></p><ul><li><strong>Explicit Dependencies</strong>: Use depends_on when necessary to define explicit dependencies between resources, especially when they are not automatically inferred by Terraform.</li><li><strong>Avoid Implicit Dependencies</strong>: Minimize reliance on implicit dependencies, as they may cause issues when the module is reused in different contexts.</li></ul><p><strong>7. Security Considerations</strong></p><ul><li><strong>Sensitive Data Handling</strong>: Ensure proper handling of sensitive data (e.g., credentials) through environment variables, secret management systems, or encrypted storage.</li><li><strong>Least Privilege</strong>: If your module involves IAM policies, follow the principle of least privilege, granting only the necessary permissions.</li></ul><p><strong>8. Logging and Debugging</strong></p><ul><li><strong>Logging and Outputting Debug Information</strong>: Add useful debug messages or comments to explain the functionality of each part of the module, which can aid in debugging.</li><li><strong>Error Handling</strong>: Use clear error messages when something goes wrong with the module or when invalid input is provided.</li></ul><p><strong>9. Provider Compatibility</strong></p><ul><li><strong>Version Constraints</strong>: Ensure that your module is compatible with the correct version of the Terraform provider. Define version constraints on providers to prevent compatibility issues.</li><li><strong>Provider Aliasing</strong>: Use provider aliases if your module needs to interact with multiple instances of the same provider (e.g., for multi — region deployments).</li></ul><p><strong>10. Testing and Validation</strong></p><ul><li><strong>Unit Testing</strong>: Whenever possible, include tests for your modules. Tools like terraform validate, terraform plan, or terratest can be used to validate expected behavior.</li><li><strong>Static Analysis</strong>: Use Terraform linters such as tflint or terraform-docs to ensure the code is consistent, follows best practices, and is well — documented.</li></ul><p><strong>11. Documentation</strong></p><ul><li><strong>Clear Instructions</strong>: Provide clear documentation on how to use the module, including required input variables, expected outputs, and usage examples.</li><li><strong>Examples</strong>: Include examples of how to invoke the module in different environments or use cases.</li><li><strong>README</strong>: Maintain a comprehensive README file to explain the module’s purpose, configuration options, and any additional considerations for use.</li></ul><p><strong>12. Resource Lifecycle Management</strong></p><ul><li><strong>Create, Read, Update, Delete (CRUD)</strong>: Ensure that the module properly handles the full lifecycle of resources, including managing dependencies, updating existing resources, and cleanly removing them when they are no longer needed.</li><li><strong>Resource Drift</strong>: Be aware of any potential drift between Terraform’s state and actual resources. Regularly use terraform refresh and terraform plan.</li></ul><p>By considering these aspects, you can design Terraform modules that are modular, reusable, secure, and maintainable, providing a more seamless experience for your team or other consumers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2633ecd7b065" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential Best Practices for Effective Terraform Management]]></title>
            <link>https://charleswan111.medium.com/essential-best-practices-for-effective-terraform-management-44f889333959?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/44f889333959</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 15:16:51 GMT</pubDate>
            <atom:updated>2025-02-03T15:16:51.709Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MYvalru1uMMVBIGb" /><figcaption>Photo by <a href="https://unsplash.com/@dubizan73?utm_source=medium&amp;utm_medium=referral">Adrian Kusznirewicz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Terraform is a powerful tool for managing infrastructure as code (IaC). To use Terraform effectively, follow these best practices:</p><p><strong>1. Code Organization</strong></p><ul><li><strong>Use Modules:</strong> Break your configuration into reusable modules to simplify management, testing, and reusability.</li></ul><pre>/modules/<br>  /network/<br>  /compute/<br>/environments/<br>  /dev/<br>  /prod/</pre><ul><li><strong>Standard Directory Structure:</strong></li><li>Keep main.tf, variables.tf, outputs.tf, and providers.tf separate for better readability and maintainability.</li></ul><p><strong>2. Version Control</strong></p><ul><li><strong>Track Changes in Git:</strong> Store Terraform configurations in a version control system like Git.</li><li><strong>Pin Provider Versions:</strong> Ensure consistent behavior by pinning specific provider versions.</li></ul><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 5.0&quot;<br>    }<br>  }<br>}</pre><p><strong>3. Use Remote State</strong></p><ul><li>Store the Terraform state file (terraform.tfstate) remotely for shared access and locking.</li><li>Use backends like S3 (with DynamoDB for locking), Azure Blob Storage, or Terraform Cloud.</li><li>Example for AWS S3:</li></ul><pre>  terraform {<br>    backend &quot;s3&quot; {<br>      bucket         = &quot;my-terraform-state&quot;<br>      key            = &quot;path/to/statefile&quot;<br>      region         = &quot;us-east-1&quot;<br>      encrypt        = true<br>      dynamodb_table = &quot;terraform-lock-table&quot;<br>    }<br>  }</pre><p><strong>4. Security</strong></p><ul><li><strong>Protect Secrets:</strong> Avoid hardcoding sensitive values (e.g., passwords, API keys) in .tf files. Use:</li><li>Environment variables.</li><li>Secret managers (e.g., HashiCorp Vault, AWS Secrets Manager).</li><li>Sensitive variables.</li><li><strong>Encrypt State:</strong> Enable encryption for remote state storage to protect sensitive data.</li><li><strong>RBAC:</strong> Use role-based access control to restrict access to Terraform configurations and state files.</li></ul><p><strong>5. Variable Management</strong></p><ul><li><strong>Define Variables Clearly:</strong></li><li>Use variables.tf to declare inputs.</li><li>Use outputs.tf to expose required data.</li><li>Use descriptive names and provide defaults where applicable.</li></ul><pre>  variable &quot;instance_type&quot; {<br>    description = &quot;The type of instance to use&quot;<br>    type        = string<br>    default     = &quot;t2.micro&quot;<br>  }</pre><ul><li><strong>Use </strong><strong>sensitive for Sensitive Data:</strong></li></ul><pre>variable &quot;db_password&quot; {<br>  type        = string<br>  sensitive   = true<br>}</pre><p><strong>6. Plan Before Apply</strong></p><ul><li>Always run terraform plan to review changes before applying them.</li></ul><pre>terraform plan -out=tfplan<br>terraform apply tfplan</pre><p><strong>7. Use Terraform Workspaces</strong></p><ul><li>Use workspaces for managing multiple environments (e.g., dev, staging, prod) within the same codebase.</li></ul><pre>terraform workspace new dev<br>terraform workspace select dev</pre><p><strong>8. Enforce Formatting and Validation</strong></p><ul><li><strong>Format Code:</strong> Use terraform fmt to maintain consistent code style.</li><li><strong>Validate Configurations:</strong> Use terraform validate to catch syntax or logical errors early.</li></ul><p><strong>9. Avoid Manual Changes</strong></p><ul><li>Avoid making manual changes to resources managed by Terraform. Use terraform import if manual changes occur.</li></ul><p><strong>10. Manage State Carefully</strong></p><ul><li><strong>Lock State:</strong> Use remote backends that support state locking to avoid conflicts.</li><li><strong>Backup State:</strong> Regularly back up the Terraform state file.</li></ul><p><strong>11. Automation</strong></p><ul><li>Automate Terraform workflows using CI/CD pipelines.</li><li>Integrate tools like GitHub Actions, Jenkins, or GitLab CI for automated plans and applies.</li></ul><p><strong>12. Monitor and Audit</strong></p><ul><li><strong>Tag Resources:</strong> Add tags/labels for resource identification and cost tracking.</li><li><strong>Log Changes:</strong> Use tools like Terraform Cloud or Sentinel for policy enforcement and auditing.</li></ul><p><strong>13. State Separation</strong></p><ul><li>Separate state files for independent projects or environments to avoid coupling.</li></ul><pre>/prod/terraform.tfstate<br>/dev/terraform.tfstate</pre><p><strong>14. Static Code Analysis</strong></p><ul><li>Use tools like <strong>tflint</strong>, <strong>terraform-compliance</strong>, or <strong>checkov</strong> to enforce best practices and compliance checks.</li></ul><p><strong>15. Lock Terraform Version</strong></p><ul><li>Use a required_version block in your configuration to lock the Terraform version:</li></ul><pre>terraform {<br>  required_version = &quot;~&gt; 1.5.0&quot;<br>}</pre><p><strong>16. Documentation</strong></p><ul><li>Document your Terraform configurations, module usage, and workflows. Use Markdown files (README.md) alongside your code.</li></ul><p><strong>17. Clean Up Resources</strong></p><ul><li>Periodically clean up unused or outdated resources to avoid unnecessary costs:</li></ul><pre>terraform destroy</pre><p>By adhering to these best practices, you can ensure that your Terraform configurations are maintainable, secure, and efficient.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44f889333959" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Practices for Collaborative Terraform Configuration Management]]></title>
            <link>https://charleswan111.medium.com/best-practices-for-collaborative-terraform-configuration-management-18746806ada3?source=rss-86bb0f0c50a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/18746806ada3</guid>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[modularization]]></category>
            <dc:creator><![CDATA[Charles Wan]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 15:16:51 GMT</pubDate>
            <atom:updated>2025-02-03T15:16:51.592Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ngfkXv2ts5J_p6kr" /><figcaption>Photo by <a href="https://unsplash.com/@martvint?utm_source=medium&amp;utm_medium=referral">Martins Vinters</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Collaborating on Terraform configuration files involves teamwork, consistent practices, and tools to ensure the infrastructure as code (IaC) remains functional, organized, and conflict-free. Here are best practices for collaboration:</p><p><strong>1. Use Version Control Systems (VCS)</strong></p><ul><li><strong>Adopt Git or Similar Tools</strong>: Store your Terraform configuration files in a version control system like Git to track changes and enable collaboration.</li><li><strong>Branching Strategy</strong>: Use feature branches for individual changes, and merge them into the main branch only after review.</li><li><strong>Commit Messages</strong>: Write clear and concise commit messages that explain what changes are made and why.</li></ul><p><strong>2. Standardize Code Style</strong></p><ul><li><strong>Formatting</strong>: Use terraform fmt to ensure a consistent format across configuration files.</li><li><strong>Naming Conventions</strong>: Agree on naming standards for resources, variables, and modules to improve readability.</li><li><strong>Comments</strong>: Add meaningful comments where needed, but avoid excessive or redundant comments.</li></ul><p><strong>3. Enable Code Reviews</strong></p><ul><li><strong>Pull Requests (PRs)</strong>: Require PRs for changes to Terraform files. This allows teammates to review, discuss, and approve changes before merging.</li><li><strong>Review Tools</strong>: Use GitHub, GitLab, or similar platforms for inline code reviews and discussions.</li></ul><p><strong>4. Use Remote Backends</strong></p><ul><li><strong>State Management</strong>: Store Terraform state files remotely (e.g., in AWS S3, Azure Blob Storage, or Terraform Cloud) to avoid conflicts when multiple team members are working.</li><li><strong>State Locking</strong>: Enable state locking to prevent simultaneous state modifications by different users.</li></ul><p><strong>5. Modularize Code</strong></p><ul><li><strong>Use Modules</strong>: Break down configurations into reusable modules to simplify collaboration and avoid duplicating code.</li><li><strong>Publish Modules</strong>: Store shared modules in a central repository or Terraform Registry for easy access.</li></ul><p><strong>6. Establish a Workflow</strong></p><ul><li><strong>Plan Before Apply</strong>: Use terraform plan to preview changes and share the output during reviews.</li><li><strong>Environment Isolation</strong>: Use workspaces or separate state files for different environments (e.g., dev, staging, production).</li><li><strong>CI/CD Pipelines</strong>: Automate testing and application of Terraform changes through pipelines.</li></ul><p><strong>7. Document Processes and Code</strong></p><ul><li><strong>README Files</strong>: Include a README in your repository with clear instructions on usage, structure, and conventions.</li><li><strong>Variable Descriptions</strong>: Document inputs and outputs for better understanding.</li></ul><p><strong>8. Use Secrets Management</strong></p><ul><li><strong>Secure Variables</strong>: Avoid hardcoding sensitive data. Use environment variables, secrets managers, or Terraform’s sensitive flag to secure sensitive information.</li><li><strong>Review Access</strong>: Limit access to secrets and enforce best practices.</li></ul><p><strong>9. Test Changes</strong></p><ul><li><strong>Unit Tests</strong>: Use tools like Terratest to test your Terraform code.</li><li><strong>Validation</strong>: Run terraform validate to check for syntax or configuration errors before applying changes.</li></ul><p><strong>10. Communicate Regularly</strong></p><ul><li><strong>Sync Meetings</strong>: Regularly discuss ongoing changes, challenges, and improvements.</li><li><strong>Documentation Updates</strong>: Keep team documentation up-to-date with the latest practices and architectural decisions.</li></ul><p>By following these practices, your team can minimize conflicts, ensure a smooth collaboration process, and maintain a robust infrastructure as code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18746806ada3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>