<?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[Byte of Knowledge - Medium]]></title>
        <description><![CDATA[Byte of Knowledge is a publication dedicated to exploring the ever-evolving world of technology, Life and innovation. - Medium]]></description>
        <link>https://medium.com/byte-of-knowledge?source=rss----f501865d582a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Byte of Knowledge - Medium</title>
            <link>https://medium.com/byte-of-knowledge?source=rss----f501865d582a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:14:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/byte-of-knowledge" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Terraform State Management — Advanced, Example-Driven Guide]]></title>
            <link>https://medium.com/byte-of-knowledge/terraform-state-management-advanced-example-driven-guide-ec0a681485e9?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/ec0a681485e9</guid>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[ab1sh3k]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 05:54:36 GMT</pubDate>
            <atom:updated>2025-05-27T00:07:33.592Z</atom:updated>
            <content:encoded><![CDATA[<h3>Terraform State Management — Advanced, Example-Driven Guide</h3><h3>1️⃣ Why Does Terraform Need State?</h3><ul><li><strong>State</strong> is Terraform’s “memory” — the authoritative record mapping resource blocks in your code to actual, live cloud resources (e.g., which aws_instance.web is actually yours).</li><li>Without state, every run would need to guess what’s real, re-scan clouds, and lose track of relationships, dependencies, and outputs.</li><li>State enables safe refactoring, collaboration, and modular, cross-project deployments.</li></ul><h3>2️⃣ State File Structure — What’s in There?</h3><p><strong>State files</strong> are always JSON. You rarely edit them directly, but understanding their structure is key for debugging and advanced manipulation.</p><h3>Minimal Example (AWS VPC &amp; subnet):</h3><pre>{<br>  &quot;version&quot;: 4,<br>  &quot;terraform_version&quot;: &quot;1.7.3&quot;,<br>  &quot;serial&quot;: 13,<br>  &quot;lineage&quot;: &quot;1e6b9e24-b4cf-44ab-9af3-2be5dbf80c4d&quot;,<br>  &quot;resources&quot;: [<br>    {<br>      &quot;type&quot;: &quot;aws_vpc&quot;,<br>      &quot;name&quot;: &quot;main&quot;,<br>      &quot;instances&quot;: [<br>        {<br>          &quot;attributes&quot;: {<br>            &quot;id&quot;: &quot;vpc-0123456789abcdef0&quot;,<br>            &quot;cidr_block&quot;: &quot;10.1.0.0/16&quot;,<br>            &quot;tags&quot;: { &quot;Environment&quot;: &quot;prod&quot; }<br>          }<br>        }<br>      ]<br>    }<br>  ],<br>  &quot;outputs&quot;: {<br>    &quot;vpc_id&quot;: { &quot;value&quot;: &quot;vpc-0123456789abcdef0&quot;, &quot;type&quot;: &quot;string&quot; }<br>  }<br>}</pre><ul><li>resources: Every tracked infra object.</li><li>outputs: Root module outputs for other stacks or systems to consume.</li><li>lineage: Unique state lineage to protect against accidental cross-project overwrites.</li></ul><h3>3️⃣ State Storage: Backends, Locking, and Cloud/Enterprise</h3><h4>a) Local Backend (for dev only)</h4><pre>terraform {<br>  backend &quot;local&quot; {<br>    path = &quot;terraform.tfstate&quot;<br>  }<br>}</pre><p><strong>Warning:</strong> No locking, not HA. Don’t use in production!</p><p><strong>b) S3 + DynamoDB Locking (recommended for AWS)</strong></p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    bucket         = &quot;company-terraform-state&quot;<br>    key            = &quot;envs/prod/main.tfstate&quot;<br>    region         = &quot;ap-southeast-2&quot;<br>    encrypt        = true<br>    dynamodb_table = &quot;tfstate-locks&quot;<br>    kms_key_id     = &quot;arn:aws:kms:ap-southeast-2:123456789012:key/abcd-...&quot;<br>  }<br>}</pre><p><strong>What this gives you:</strong></p><ul><li><strong>Locking</strong> (via DynamoDB): Prevents two people from running terraform apply at the same time and corrupting state.</li><li><strong>Encryption at rest:</strong> Native S3 + optional KMS.</li><li><strong>Versioning:</strong> Enable on the bucket for rollback.</li></ul><p><strong>DynamoDB Table Example (CLI):</strong></p><pre>aws dynamodb create-table \<br>  --table-name tfstate-locks \<br>  --attribute-definitions AttributeName=LockID,AttributeType=S \<br>  --key-schema AttributeName=LockID,KeyType=HASH \<br>  --billing-mode PAY_PER_REQUEST</pre><p><strong>Enable S3 bucket encryption (CLI):</strong></p><pre>aws s3api put-bucket-encryption \<br>  --bucket company-terraform-state \<br>  --server-side-encryption-configuration \<br>    &#39;{&quot;Rules&quot;:[{&quot;ApplyServerSideEncryptionByDefault&quot;:{&quot;SSEAlgorithm&quot;:&quot;aws:kms&quot;}}]}&#39;</pre><h4><strong>c) Azure Blob with State Locking</strong></h4><pre>terraform {<br>  backend &quot;azurerm&quot; {<br>    resource_group_name   = &quot;rg-tfstate&quot;<br>    storage_account_name  = &quot;tfstateprod&quot;<br>    container_name        = &quot;tfstate&quot;<br>    key                   = &quot;dev/web.tfstate&quot;<br>  }<br>}</pre><p><strong>Azure Blob</strong> supports locking and encryption by default.</p><h4><strong>d) GCS Backend (Google Cloud Storage)</strong></h4><pre>terraform {<br>  backend &quot;gcs&quot; {<br>    bucket  = &quot;company-gcp-tfstate&quot;<br>    prefix  = &quot;prod/&quot;<br>  }<br>}</pre><p><strong>GCS</strong>: Use IAM for security; enable Object Versioning for rollback.</p><h4><strong>e) Terraform Cloud / Enterprise (HashiCorp’s Managed Backend)</strong></h4><pre>terraform {<br>  cloud {<br>    organization = &quot;acme-corp&quot;<br>    workspaces {<br>      name = &quot;prod-app&quot;<br>    }<br>  }<br>}</pre><ul><li><strong>State stored and versioned in Terraform Cloud.</strong></li><li><strong>Automatic locking</strong> on every plan/apply.</li><li><strong>No S3/DynamoDB setup needed.</strong></li><li><strong>Team RBAC, policy enforcement, audit logs, and seamless collaboration.</strong></li></ul><p><strong>How to authenticate:</strong></p><pre>terraform login</pre><p>Saves a token to ~/.terraform.d/credentials.tfrc.json.</p><h3>4️⃣ State Locking — Deeper Scenarios</h3><ul><li><strong>S3 + DynamoDB:</strong> Handles multi-region teams and CI/CD runs. If someone runs terraform apply while another run is in progress, the second run will wait for the lock or fail after timeout.</li><li><strong>Terraform Cloud/Enterprise:</strong> All locking is handled for you (no DynamoDB needed).</li><li><strong>Azure Blob/GCS/Consul:</strong> Native locking — no additional infra required.</li></ul><p><strong>What if locking fails?</strong></p><ul><li>Use terraform force-unlock &lt;LOCK_ID&gt; if a lock is “stuck” after a failed or interrupted run.</li></ul><p><strong>Example:</strong></p><pre>terraform force-unlock 77c04ff2-1234-42c6-b015-b6c4ea6e2e63</pre><h3>5️⃣ Security: Encryption, Access Control, and Audit</h3><h4>a) Encryption at Rest</h4><ul><li><strong>S3:</strong> Enable <strong>SSE-KMS</strong> or <strong>SSE-S3</strong> (see CLI example above).</li><li><strong>Azure Blob:</strong> Enabled by default; supports customer-managed keys.</li><li><strong>GCS:</strong> Enabled by default, can use CMEK.</li><li><strong>Terraform Cloud/Enterprise:</strong> All state is encrypted at rest (AES-256).</li></ul><h4>b) Access Control</h4><ul><li>Use minimal IAM roles (read/write only for CI/CD, read-only for auditors).</li><li>Use MFA for console/cloud provider access.</li><li>Avoid local state files; use remote state for teams.</li></ul><h4>c) Secret Management</h4><ul><li>Store secrets in external secret managers (Vault, AWS Secrets Manager, Azure Key Vault) and reference them in Terraform, rather than keeping them in state whenever possible.</li><li>Mark sensitive outputs:</li></ul><pre>output &quot;db_password&quot; {<br>  value     = random_password.db.result<br>  sensitive = true<br>}</pre><p>Avoid outputs with secrets unless strictly required.</p><h4>d) Auditing</h4><ul><li><strong>S3:</strong> Enable CloudTrail for all S3 actions.</li><li><strong>Azure/GCP:</strong> Use Monitor or Audit Log.</li><li><strong>Terraform Cloud/Enterprise:</strong> Built-in audit logs.</li></ul><h3>6️⃣ Manipulating State — Code &amp; CLI with Full Context</h3><h4>a) Backup and Restore</h4><pre>terraform state pull &gt; backup-prod-20240527.tfstate<br>terraform state push backup-prod-20240527.tfstate</pre><p><strong>Pro tip:</strong> Download S3/GCS object version directly for rollback.</p><h4>b) Importing External Resources</h4><p>Import an AWS IAM role:</p><pre>terraform import aws_iam_role.existing_role existing-role-name</pre><h4><strong>c) Remove a Resource from State Without Destroying Infra</strong></h4><pre>terraform state rm aws_security_group.temp</pre><h4><strong>d) Rename/Move Resources (Zero Downtime Refactoring)</strong></h4><pre>moved {<br>  from = aws_lb.old<br>  to   = aws_lb.main<br>}<br>moved {<br>  from = module.legacy.aws_db_instance.db<br>  to   = module.database.aws_db_instance.main<br>}</pre><h4><strong>e) Workspace Isolation for Multi-Environment</strong></h4><pre>terraform workspace new dev<br>terraform workspace select dev<br>terraform apply<br>terraform workspace select prod<br>terraform apply</pre><p>Dynamic state file per workspace:</p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    bucket = &quot;company-tfstate&quot;<br>    key    = &quot;envs/${terraform.workspace}/main.tfstate&quot;<br>    region = &quot;us-west-2&quot;<br>  }<br>}</pre><h3>7️⃣ Cross-Project State Sharing: terraform_remote_state</h3><h4>a) Sharing VPC info with App Module</h4><p><strong>VPC stack:</strong></p><pre>output &quot;vpc_id&quot; {<br>  value = aws_vpc.main.id<br>}<br>output &quot;private_subnet_ids&quot; {<br>  value = aws_subnet.private[*].id<br>}</pre><p>App stack:</p><pre>data &quot;terraform_remote_state&quot; &quot;network&quot; {<br>  backend = &quot;s3&quot;<br>  config = {<br>    bucket = &quot;company-tfstate&quot;<br>    key    = &quot;envs/prod/vpc.tfstate&quot;<br>    region = &quot;us-west-2&quot;<br>  }<br>}<br>resource &quot;aws_instance&quot; &quot;web&quot; {<br>  subnet_id = data.terraform_remote_state.network.outputs.private_subnet_ids[0]<br>}</pre><h4><strong>b) Using </strong><strong>defaults for Resilience</strong></h4><pre>data &quot;terraform_remote_state&quot; &quot;network&quot; {<br>  backend = &quot;gcs&quot;<br>  config = {<br>    bucket = &quot;my-bucket&quot;<br>    prefix = &quot;dev/&quot;<br>  }<br>  defaults = {<br>    vpc_id = &quot;vpc-placeholder&quot;<br>  }<br>}</pre><h3>8️⃣ Advanced State-Only Resources — Practical Use Cases</h3><h4>a) random_id for unique bucket names</h4><pre>resource &quot;random_id&quot; &quot;suffix&quot; {<br>  byte_length = 6<br>}<br>resource &quot;aws_s3_bucket&quot; &quot;logs&quot; {<br>  bucket = &quot;company-logs-${random_id.suffix.hex}&quot;<br>}</pre><h4>b) time_rotating for periodic resource replacement (e.g., rotating keys)</h4><pre>resource &quot;time_rotating&quot; &quot;rotate_monthly&quot; {<br>  rotation_days = 30<br>}<br>resource &quot;aws_kms_key&quot; &quot;ephemeral&quot; {<br>  deletion_window_in_days = 7<br>  lifecycle {<br>    replace_triggered_by = [time_rotating.rotate_monthly]<br>  }<br>}</pre><h4>c) terraform_data as a stateful trigger for re-deployment</h4><pre>variable &quot;manual_force_redeploy&quot; { default = false }<br>resource &quot;terraform_data&quot; &quot;deploy_trigger&quot; {<br>  triggers_replace = {<br>    force = var.manual_force_redeploy ? timestamp() : &quot;&quot;<br>  }<br>}<br>resource &quot;aws_lambda_function&quot; &quot;main&quot; {<br>  lifecycle {<br>    replace_triggered_by = [terraform_data.deploy_trigger]<br>  }<br>}</pre><h3>9️⃣ Drift Management — Detection and Recovery</h3><p><strong>Ignore changes that are “safe” to drift:</strong></p><pre>resource &quot;aws_instance&quot; &quot;db&quot; {<br>  lifecycle {<br>    ignore_changes = [user_data, tags]<br>  }<br>}</pre><p><strong>Manually correct drift (e.g., if an RDS instance was recreated outside Terraform)</strong>:</p><pre>terraform import aws_db_instance.db new-instance-id</pre><p><strong>Plan with refresh only for safety:</strong></p><pre>terraform plan -refresh-only</pre><h3>🔟 Disaster Recovery &amp; Versioning</h3><ul><li><strong>Always enable S3/GCS/Azure blob versioning for rollback:</strong></li><li>S3: aws s3api put-bucket-versioning --bucket company-tfstate --versioning-configuration Status=Enabled</li><li>GCS: Enable via Console or gsutil versioning set on gs://my-bucket</li><li><strong>Regularly backup state (</strong><strong>terraform state pull or direct copy from backend).</strong></li><li><strong>Restore by </strong><strong>terraform state push &lt;backup.tfstate&gt;</strong></li></ul><h3>🔒 Final Security Checklist</h3><ul><li><strong>Encrypt state at rest and in transit.</strong></li><li><strong>Limit state file access — don’t email, share, or upload unencrypted state.</strong></li><li><strong>Regularly audit backend IAM policies and logs.</strong></li><li><strong>Never output secrets unnecessarily.</strong></li><li><strong>Use managed services (Terraform Cloud/Enterprise) where possible for the best RBAC, logging, and backup story.</strong></li></ul><h3>💡 Key Takeaways</h3><ul><li><strong>Always</strong> use a remote, encrypted, versioned backend with locking.</li><li><strong>Treat state like a production database</strong>: secure, auditable, and backed up.</li><li>Use <strong>Terraform Cloud/Enterprise</strong> for “hands-off” state management, collaboration, RBAC, and audit trail.</li><li>Automate backups, practice disaster recovery, and minimize manual state edits.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec0a681485e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/byte-of-knowledge/terraform-state-management-advanced-example-driven-guide-ec0a681485e9">Terraform State Management — Advanced, Example-Driven Guide</a> was originally published in <a href="https://medium.com/byte-of-knowledge">Byte of Knowledge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ugreen vs Synology: What First-Time NAS Buyers Actually Care About (And What They Don’t)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/ugreen-vs-synology-what-first-time-nas-buyers-actually-care-about-and-what-they-dont-ee08c840b735?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/1630/1*ahQFgaahNwLQjhKJJO25Dg.png" width="1630"></a></p><p class="medium-feed-snippet">There&#x2019;s a very specific moment that pushes people toward buying their first NAS. It usually starts with a cloud storage notification&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/ugreen-vs-synology-what-first-time-nas-buyers-actually-care-about-and-what-they-dont-ee08c840b735?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/ugreen-vs-synology-what-first-time-nas-buyers-actually-care-about-and-what-they-dont-ee08c840b735?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/ee08c840b735</guid>
            <category><![CDATA[ugreen]]></category>
            <category><![CDATA[synology]]></category>
            <category><![CDATA[ugreen-nas]]></category>
            <category><![CDATA[nas]]></category>
            <dc:creator><![CDATA[Mr.PlanB]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 05:54:31 GMT</pubDate>
            <atom:updated>2026-02-08T09:55:18.683Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Create a Custom Symfony Bundle in Symfony]]></title>
            <link>https://medium.com/byte-of-knowledge/how-to-create-a-custom-symfony-bundle-in-symfony-d9311add252a?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/d9311add252a</guid>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[symfony-bundle]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[symfony]]></category>
            <dc:creator><![CDATA[Mayur Koshti]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 05:54:24 GMT</pubDate>
            <atom:updated>2024-10-02T08:48:54.802Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Udq7KkT9wPAXRfw0IQ9k0w.jpeg" /></figure><blockquote>Symfony is a popular <a href="https://mycodebook.online/blogs/top-5-php-frameworks-boost-web-development/">PHP framework</a> that promotes best practices in web development, and one of its standout features is the ability to create reusable code in the form of bundles.</blockquote><p>Bundles are essentially packages of functionality that can be distributed and reused across different Symfony projects.</p><p>Creating a custom Symfony bundle allows you to group related functionality, making your application more modular and easier to maintain.</p><p>In this guide, I’ll walk you through the steps to create your own custom Symfony bundle.</p><h3>Table of Contents</h3><p>· <a href="#ee06">What Is a Symfony Bundle?</a><br>· <a href="#be19">Why Create a Custom Bundle?</a><br>· <a href="#85b4">Prerequisites</a><br>· <a href="#b412">Step 1: Setting Up the Symfony Project</a><br>· <a href="#be62">Step 2: Creating the Bundle Structure</a><br>· <a href="#c6a5">Step 3: Defining the Bundle Class</a><br>· <a href="#7dc9">Step 4: Configuring the Bundle</a><br>· <a href="#a8c3">Step 5: Adding Services and Controllers</a><br> ∘ <a href="#3c44">Creating a Controller</a><br> ∘ <a href="#4a5d">Creating a Service</a><br>· <a href="#511a">Step 6: Registering the Bundle</a><br>· <a href="#a500">Step 7: Using the Custom Bundle</a><br>· <a href="#9238">Conclusion</a></p><h3>What Is a Symfony Bundle?</h3><p>A Symfony bundle is a self-contained unit of code that adds functionality to your application. It can contain services, configurations, controllers, routes, templates, and more.</p><p>Bundles are the building blocks of Symfony applications and allow you to reuse code easily across projects.</p><h3>Why Create a Custom Bundle?</h3><p>Here are some reasons to create a custom Symfony bundle:</p><ul><li><strong>Code Reusability</strong>: Bundles can be shared between multiple projects.</li><li><strong>Separation of Concerns</strong>: Group related functionalities in one bundle.</li><li><strong>Maintainability</strong>: Modular code is easier to maintain.</li><li><strong>Collaboration</strong>: Custom bundles allow teams to work on isolated components.</li></ul><h3>Prerequisites</h3><p>Before diving into creating a custom Symfony bundle, ensure you have the following:</p><ul><li>PHP installed on your system (preferably version 7.4 or higher).</li><li>Symfony CLI installed.</li><li>A working Symfony project.</li><li>Composer (<a href="https://medium.com/@mayurkoshti12/how-to-install-composer-a-step-by-step-guide-f41644660a08">PHP package manager</a>) installed.</li></ul><h3>Step 1: Setting Up the Symfony Project</h3><p>If you don’t already have a Symfony project, start by setting one up. Run the following command to create a new Symfony project:</p><pre>symfony new my_project --full</pre><p>This will create a new Symfony project in a directory called my_project.</p><p>Navigate into your project directory:</p><pre>cd my_project</pre><h3>Step 2: Creating the Bundle Structure</h3><p>Symfony bundles typically reside in the src/ directory. Create a new directory for your bundle inside src/:</p><pre>mkdir src/MyCustomBundle</pre><p>Inside this directory, you will need to create the following structure:</p><pre>src/<br>└── MyCustomBundle/<br>    ├── Controller/<br>    ├── DependencyInjection/<br>    ├── Resources/<br>    │   ├── config/<br>    │   └── views/<br>    ├── MyCustomBundle.php</pre><p>The directory structure represents where you will store controllers, configuration, and views for your bundle. The most important file here is MyCustomBundle.php, which will define your bundle.</p><p><a href="https://medium.com/@mayurkoshti12/top-10-useful-functions-in-symfony-94cc47700f4a">Top 10 Useful Functions in Symfony</a></p><h3>Step 3: Defining the Bundle Class</h3><p>The bundle class serves as the entry point for your custom bundle. Create a file named MyCustomBundle.php inside the src/MyCustomBundle/ directory:</p><pre>&lt;?php<br><br>namespace App\MyCustomBundle;<br>use Symfony\Component\HttpKernel\Bundle\Bundle;<br>class MyCustomBundle extends Bundle<br>{<br>    public function boot()<br>    {<br>        // Custom boot logic for the bundle can be placed here.<br>    }<br>}</pre><p>This file defines the MyCustomBundle class, which extends Symfony&#39;s base Bundle class. The boot() method is optional but can be useful if you want to execute custom logic when the bundle is loaded.</p><h3>Step 4: Configuring the Bundle</h3><p>Bundles usually come with configuration options. To handle configuration, create a new file named Configuration.php inside the DependencyInjection/ directory:</p><pre>touch src/MyCustomBundle/DependencyInjection/Configuration.php</pre><p>Add the following content:</p><pre>&lt;?php<br><br>namespace App\MyCustomBundle\DependencyInjection;<br><br>use Symfony\Component\Config\Definition\Builder\TreeBuilder;<br>use Symfony\Component\Config\Definition\ConfigurationInterface;<br><br>class Configuration implements ConfigurationInterface<br>{<br>    public function getConfigTreeBuilder()<br>    {<br>        $treeBuilder = new TreeBuilder(&#39;my_custom_bundle&#39;);<br>        <br>        $rootNode = $treeBuilder-&gt;getRootNode();<br>        // Define configuration options here<br>        $rootNode<br>            -&gt;children()<br>                -&gt;scalarNode(&#39;option&#39;)-&gt;defaultValue(&#39;default_value&#39;)-&gt;end()<br>            -&gt;end();<br>        return $treeBuilder;<br>    }<br>}</pre><p>This file defines configuration options that users of your bundle can override in their project’s config/packages/ directory.</p><h3>Step 5: Adding Services and Controllers</h3><h4>Creating a Controller</h4><p>Create a controller for your bundle in the Controller/ directory:</p><pre>touch src/MyCustomBundle/Controller/DefaultController.php</pre><p>Add the following content:</p><pre>&lt;?php<br><br>namespace App\MyCustomBundle\Controller;<br><br>use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;<br>use Symfony\Component\HttpFoundation\Response;<br>use Symfony\Component\Routing\Annotation\Route;<br><br>class DefaultController extends AbstractController<br>{<br>    /**<br>     * @Route(&quot;/my-custom-bundle&quot;, name=&quot;my_custom_bundle_index&quot;)<br>     */<br>    public function index(): Response<br>    {<br>        return $this-&gt;render(&#39;@MyCustomBundle/default/index.html.twig&#39;);<br>    }<br>}</pre><p>This controller defines a simple route that renders a template.</p><h4>Creating a Service</h4><p>You can also add services to your bundle. To do this, create a file named services.yaml in Resources/config/:</p><pre>services:<br>    App\MyCustomBundle\:<br>        resource: &#39;../*&#39;<br>        exclude: &#39;../{DependencyInjection,Entity,Tests,Kernel.php}&#39;</pre><p>This will automatically register services within your bundle.</p><h3>Step 6: Registering the Bundle</h3><p>In Symfony, you can register your custom bundle by modifying the config/bundles.php file:</p><pre>return [<br>    // Other bundles<br>    App\MyCustomBundle\MyCustomBundle::class =&gt; [&#39;all&#39; =&gt; true],<br>];</pre><p>This tells Symfony to load your custom bundle.</p><h3>Step 7: Using the Custom Bundle</h3><p>Now that your bundle is registered, you can start using it. Access the route defined in the DefaultController:</p><pre>http://localhost:8000/my-custom-bundle</pre><p>This will display the content from your custom bundle’s template.</p><h3>Conclusion</h3><p>Creating a custom Symfony bundle allows you to modularize your application and reuse code effectively.</p><p>By following this guide, you’ve learned how to set up a custom bundle, define its structure, and integrate it into a Symfony project.</p><p>Symfony bundles are powerful tools, and with a deeper understanding, you can create sophisticated and reusable components for your Symfony applications.</p><p>Whether for internal use or distribution as third-party packages, custom bundles enhance the flexibility and maintainability of your projects.</p><h4>Other Topics</h4><ul><li><a href="https://medium.com/codex/symfony-api-platform-example-building-a-simple-rest-api-6ed44c64c2e9">Symfony API Platform Example: Building a Simple REST API</a></li><li><a href="https://medium.com/codex/symfony-vs-laravel-why-symfony-is-better-than-laravel-34c463a8adbb">Symfony vs. Laravel: Why Symfony is  Better Than Laravel</a></li><li><a href="https://medium.com/@mayurkoshti12/symfony-docker-integration-a-step-by-step-guide-3d644020a7c4">Symfony Docker Integration: A Step-by-Step Guide</a></li><li><a href="https://medium.com/@mayurkoshti12/creating-microservices-with-symfony-239da98a4069">Creating Microservices with Symfony</a></li><li><a href="https://medium.com/@mayurkoshti12/symfony-debug-routes-8169153fddc2">Symfony Debug Routes</a></li><li><a href="https://medium.com/@mayurkoshti12/symfony-event-dispatcher-component-how-it-works-f0be05732c2f">Symfony Event Dispatcher Component: How It Works</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9311add252a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/byte-of-knowledge/how-to-create-a-custom-symfony-bundle-in-symfony-d9311add252a">How to Create a Custom Symfony Bundle in Symfony</a> was originally published in <a href="https://medium.com/byte-of-knowledge">Byte of Knowledge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 5 Cybersecurity Jobs That Will Boom in 2025 (and What Skills You Need)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/top-5-cybersecurity-jobs-that-will-boom-in-2025-and-what-skills-you-need-d1e6ff372f25?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/2600/0*0nnvU4XEgSOGbXwj" width="6024"></a></p><p class="medium-feed-snippet">Photo by Clint Patterson on Unsplash</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/top-5-cybersecurity-jobs-that-will-boom-in-2025-and-what-skills-you-need-d1e6ff372f25?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/top-5-cybersecurity-jobs-that-will-boom-in-2025-and-what-skills-you-need-d1e6ff372f25?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/d1e6ff372f25</guid>
            <category><![CDATA[cybercrime]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Tushar kanta Nayak]]></dc:creator>
            <pubDate>Sat, 11 Oct 2025 12:45:23 GMT</pubDate>
            <atom:updated>2025-10-11T12:45:25.215Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Followed a Random Life Hack Every Day for a Month — Here’s What Worked]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/i-followed-a-random-life-hack-every-day-for-a-month-heres-what-worked-a496cb224c88?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/2600/0*X9sOPQ6weVmRX0IK" width="4581"></a></p><p class="medium-feed-snippet">Photo by Nahel Hadi on Unsplash</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/i-followed-a-random-life-hack-every-day-for-a-month-heres-what-worked-a496cb224c88?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/i-followed-a-random-life-hack-every-day-for-a-month-heres-what-worked-a496cb224c88?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/a496cb224c88</guid>
            <category><![CDATA[lifehacks]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Tushar kanta Nayak]]></dc:creator>
            <pubDate>Fri, 10 Oct 2025 02:38:48 GMT</pubDate>
            <atom:updated>2025-10-10T02:38:48.375Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Top 20 Node JS Interview Questions for Experienced Candidates (2025)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/top-20-node-js-interview-questions-for-experienced-candidates-2025-3d3a3d99375e?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/704/1*Yw_1cazchyENqeV9-Bfolw.png" width="704"></a></p><p class="medium-feed-snippet">Node.js remains a cornerstone of modern backend development, especially for building scalable, real-time applications. For experienced&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/top-20-node-js-interview-questions-for-experienced-candidates-2025-3d3a3d99375e?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/top-20-node-js-interview-questions-for-experienced-candidates-2025-3d3a3d99375e?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/3d3a3d99375e</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs-interview]]></category>
            <category><![CDATA[nodejs-training]]></category>
            <category><![CDATA[nodejs-interview-question]]></category>
            <category><![CDATA[node-js-tutorial]]></category>
            <dc:creator><![CDATA[Priyabrata Saha]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 07:08:33 GMT</pubDate>
            <atom:updated>2025-10-07T07:08:33.742Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Avoid Scams in NFT Gaming: 10 Red Flags You Should Know]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/how-to-avoid-scams-in-nft-gaming-10-red-flags-you-should-know-5c2dc39e0ce3?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/2600/0*wLXnw6992NV-qm0_" width="5781"></a></p><p class="medium-feed-snippet">Photo by Andrey Metelev on Unsplash</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/how-to-avoid-scams-in-nft-gaming-10-red-flags-you-should-know-5c2dc39e0ce3?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/how-to-avoid-scams-in-nft-gaming-10-red-flags-you-should-know-5c2dc39e0ce3?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/5c2dc39e0ce3</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Tushar kanta Nayak]]></dc:creator>
            <pubDate>Mon, 06 Oct 2025 15:43:30 GMT</pubDate>
            <atom:updated>2025-10-06T15:43:29.864Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Micro Hustles for Creatives: Monetize Your Skills in 30 Minutes a Day]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/micro-hustles-for-creatives-monetize-your-skills-in-30-minutes-a-day-29af7ddcffc3?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/2600/0*z7dWNA4RGHVQC0zJ" width="5472"></a></p><p class="medium-feed-snippet">Photo by Garrhet Sampson on Unsplash</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/micro-hustles-for-creatives-monetize-your-skills-in-30-minutes-a-day-29af7ddcffc3?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/micro-hustles-for-creatives-monetize-your-skills-in-30-minutes-a-day-29af7ddcffc3?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/29af7ddcffc3</guid>
            <category><![CDATA[money]]></category>
            <category><![CDATA[earnings]]></category>
            <dc:creator><![CDATA[Tushar kanta Nayak]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 17:47:08 GMT</pubDate>
            <atom:updated>2025-10-02T17:47:22.472Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From Surveys to Selling Stickers: The Weirdest Micro Hustles That Worked for Me]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/from-surveys-to-selling-stickers-the-weirdest-micro-hustles-that-worked-for-me-c31abdd19cf5?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/2600/0*R1QxfRwEuMKIP0Ls" width="3576"></a></p><p class="medium-feed-snippet">Photo by Marjan Blan on Unsplash</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/from-surveys-to-selling-stickers-the-weirdest-micro-hustles-that-worked-for-me-c31abdd19cf5?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/from-surveys-to-selling-stickers-the-weirdest-micro-hustles-that-worked-for-me-c31abdd19cf5?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/c31abdd19cf5</guid>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[earnings]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[money]]></category>
            <dc:creator><![CDATA[Tushar kanta Nayak]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 17:46:50 GMT</pubDate>
            <atom:updated>2025-10-02T17:46:50.084Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[10 Python Built-ins You’re Not Using (But Definitely Should)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/byte-of-knowledge/10-python-built-ins-youre-not-using-but-definitely-should-2ff9923f504c?source=rss----f501865d582a---4"><img src="https://cdn-images-1.medium.com/max/2600/0*bhe1-LDmwMlgvL9Q" width="3353"></a></p><p class="medium-feed-snippet">When we think about improving our Python skills, we often chase new libraries, frameworks, or hacks. But sometimes, the best tools are&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/byte-of-knowledge/10-python-built-ins-youre-not-using-but-definitely-should-2ff9923f504c?source=rss----f501865d582a---4">Continue reading on Byte of Knowledge »</a></p></div>]]></description>
            <link>https://medium.com/byte-of-knowledge/10-python-built-ins-youre-not-using-but-definitely-should-2ff9923f504c?source=rss----f501865d582a---4</link>
            <guid isPermaLink="false">https://medium.com/p/2ff9923f504c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Tushar kanta Nayak]]></dc:creator>
            <pubDate>Sun, 06 Jul 2025 08:12:45 GMT</pubDate>
            <atom:updated>2025-06-30T03:20:39.834Z</atom:updated>
        </item>
    </channel>
</rss>