<?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 Dev Raj on Medium]]></title>
        <description><![CDATA[Stories by Dev Raj on Medium]]></description>
        <link>https://medium.com/@dev.raj_21299?source=rss-5633a735ead4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Dev Raj on Medium</title>
            <link>https://medium.com/@dev.raj_21299?source=rss-5633a735ead4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 12:45:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dev.raj_21299/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[Cloud Formation from scratch Part-I]]></title>
            <link>https://medium.com/@dev.raj_21299/cloud-formation-from-scratch-part-i-33b8bb334004?source=rss-5633a735ead4------2</link>
            <guid isPermaLink="false">https://medium.com/p/33b8bb334004</guid>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[stackset]]></category>
            <dc:creator><![CDATA[Dev Raj]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 08:56:47 GMT</pubDate>
            <atom:updated>2023-12-20T08:56:47.362Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>1. What is AWS CloudFormation?</strong><br> AWS CloudFormation is an Infrastructure as Code (IaC) service that allows you to define and provision AWS infrastructure in a declarative manner. It helps you automate the creation, modification, and deletion of resources in your AWS environment.</p><p><strong>2. Why use CloudFormation?</strong><br> CloudFormation provides a consistent and repeatable way to deploy infrastructure. It helps in version control, collaboration, and ensures that your infrastructure is in the desired state.</p><p><strong>3. What are the components of a CloudFormation template?</strong><br> A CloudFormation template consists of the following main components:<br> — AWSTemplateFormatVersion: Specifies the format version.<br> — Description: Provides a description of the template.<br> — Metadata: Provides additional information.<br> — Parameters: Allows input of custom values.<br> — Mappings: Defines conditional values.<br> — Conditions: Specifies conditions for resource creation.<br> — Transform: Specifies one or more macros.<br> — Resources: Defines the AWS resources to be created.<br> — Outputs: Describes the output values.</p><p><strong>4. What is an AWS CloudFormation stack?</strong><br> A stack is a collection of AWS resources created and managed as a single unit when you deploy a template. Stacks help you organize and manage related resources together.</p><p><strong>5. How can you create a CloudFormation stack?</strong><br> You can create a stack using the AWS Management Console, AWS CLI, or AWS SDKs. The most common method is to use the AWS Management Console to upload your template and initiate the stack creation.</p><p><strong>6. What is a CloudFormation change set?</strong><br> A change set is a summary of changes that will be made to your stack. It allows you to preview the changes before applying them, helping to avoid unintended modifications.</p><p><strong>7. How to define resources in a CloudFormation template?</strong><br> Resources are defined under the “Resources” section in the template. Each resource has a logical ID and type. <br>For example:</p><blockquote>```yaml<br> Resources:<br> MyEC2Instance:<br> Type: AWS::EC2::Instance<br> Properties:<br> ImageId: ami-xxxxxxxx<br> InstanceType: t2.micro<br> ```</blockquote><p><strong>8. Explain the concept of parameters in CloudFormation.</strong><br> Parameters allow you to customize your template by providing input values when creating a stack. For example, you can define a parameter for the instance type and use it in the template.</p><p><strong>9. How to use parameters in a CloudFormation template?</strong><br> Define parameters in the “Parameters” section and reference them in the resources. <br>Example:</p><blockquote>```yaml<br> Parameters:<br> InstanceTypeParameter:<br> Type: String<br> Default: t2.micro</blockquote><p>Resources:</p><blockquote>MyEC2Instance:<br> Type: AWS::EC2::Instance<br> Properties:<br> InstanceType: !Ref InstanceTypeParameter<br> ```</blockquote><p><strong>10. What is the intrinsic function `!Ref` used for?</strong><br> The `!Ref` function is used to get the value of the specified parameter or resource. In the example above, it references the value of the `InstanceTypeParameter`.</p><p><strong>11. How to use conditions in CloudFormation?</strong><br> Conditions are defined under the “Conditions” section and can be used to control whether certain resources are created. <br>Example:</p><blockquote>```yaml<br> Conditions:<br> CreateProdResources: !Equals [ !Ref EnvType, prod ]</blockquote><p>Resources:</p><blockquote>MyEC2Instance:<br> Type: AWS::EC2::Instance<br> Condition: CreateProdResources<br> Properties:<br> ImageId: ami-xxxxxxxx<br> ```</blockquote><p><strong>12. What is the purpose of the `Mappings` section in CloudFormation?</strong><br> The `Mappings` section allows you to create a lookup table of keys and associated values. It is useful for conditional resource creation based on a key.</p><p><strong>13. How to define outputs in CloudFormation?</strong><br> Outputs are defined in the “Outputs” section and provide information about your stack, such as the IP address of a resource. <br>Example:</p><blockquote>```yaml<br> Outputs:<br> InstanceIP:<br> Value: !GetAtt MyEC2Instance.PublicIp<br> ```</blockquote><p><strong>14. What is the purpose of the `Metadata` section in CloudFormation?</strong><br> The `Metadata` section provides additional information about the template. It can include details such as author, version, or any other relevant information.</p><p><strong>15. Explain the use of the `Transform` section in CloudFormation.</strong><br> The `Transform` section allows you to specify one or more macros to process your template before AWS CloudFormation deploys it. For example, transforming a template written in YAML to JSON.</p><p><strong>16. How to include external files in a CloudFormation template?</strong><br> You can use the `AWS::Include` transform to include external files in your CloudFormation template. This is helpful for separating and organizing code.</p><p><strong>17. What is the purpose of the `AWSTemplateFormatVersion` field?</strong><br> `AWSTemplateFormatVersion` specifies the format version of the CloudFormation template. It helps AWS CloudFormation understand the template’s structure and syntax.</p><p><strong>18. Can you provide a simple example of a CloudFormation template?</strong><br> Sure, here’s a simple template creating an S3 bucket:</p><blockquote>```yaml<br> AWSTemplateFormatVersion: ‘2010–09–09’<br> Resources:<br> MyS3Bucket:<br> Type: AWS::S3::Bucket<br> ```</blockquote><p><strong>19. How to use CloudFormation to create an EC2 instance?</strong><br> Here’s an example template for creating an EC2 instance:</p><blockquote>```yaml<br> AWSTemplateFormatVersion: ‘2010–09–09’<br> Resources:<br> MyEC2Instance:<br> Type: AWS::EC2::Instance<br> Properties:<br> ImageId: ami-xxxxxxxx<br> InstanceType: t2.micro<br> ```</blockquote><p><strong>20. How can you update a CloudFormation stack?</strong><br> To update a stack, you can modify the template or change parameter values. Use the AWS Management Console, AWS CLI, or SDKs to create a change set and then apply the changes to the stack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33b8bb334004" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>