AWS: Cloud Formation

AWS: Cloud Formation

AWS Cloud Formation is a service that lets us create, update and manage AWS Infrastructure with the help of configuration files. Creation and management of cloud infrastructure with help of config files is also called as Infrastructure as Code (IaC). After deploying Cloud Formation template on AWS it creates something called Stack. Stack consists of resources, outputs, inputs etc. We can delete the stack to delete every resources that were created when cloud formation template was deployed.

Cloud formation mainly consists of four sections (Apart from description and version):

1) Parameters: Used to declare variables that we have defined inside files that are present in external folder to template. (In our case we have params folder).

2)?Conditions: Used to define certain conditions which can be used while creating resources.

3) Resources: Used to define the config for resources that we want to create/update using our cloud formation. There can be multiple resources in one cloud formation template.

4) Output: After the stack creation we can output certain things like ARN of? the resources, Name of the resources etc. We can also use the outputs of one stack directly into another template given that both the templates are deployed in same region and account.

Documentation:?https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html

Documentation on Conditions:?https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html


Some of the CloudFormation Functions (Syntax in YML) :

1) Join: Used to concatenate the strings provided.

? ? Ex 1:?!Join [ '', [ "abc", "def", "ghi"] ]

? ? ? ? ? ? ?Output: "abcdefghi"

? ? Ex 2:?Join [ ':', [ 'abc', 'def', 'ghi'] ]

? ? ? ? ? ? ?Output: "abc:def:ghi"


2) Ref: Used to fetch ARN or Name of resource that is created in the same template.

? ? Ex 1:?!Ref Queue1 (Where Queue1 is soft resource name of an AWS SQS Queue named MyQueue)

? ? ? ? ? ? Output: MyQueue


3) GetAtt: Get attributes of a resource that is created in the same template. The attribute depends of resource to resource. Almost every resource has Arn attribute which can be used to find arn of the resource.

? ? Ex 1:?!GetAtt [ Queue1, Arn ]?(Where Queue1 is soft resource name of an AWS SQS Queue named MyQueue and has ARN arn:sqs:us-east-1:123123:MyQueue)

? ? ? ? ? ? Output:?arn:sqs:us-east-1:123123:MyQueue


4) ImportValue: Used to import values that are outputted by another stack in the same account and region.

? ? Ex 1:?!ImportValue QueueArn

? ? ? ? ? ? ?Output: Will give whatever was outputted by any stack in the same account and region with QueueArn name attached to it.


Documentation for CloudFormation Functions:?https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html

Thank you for reading the article ..!

Regards

Mr. Nag


要查看或添加评论,请登录

Nagaraju Juluru的更多文章

  • What is a data pipeline?

    What is a data pipeline?

    A data pipeline is a series of tasks, such as transformations, filters, aggregations, and merging multiple sources…

  • AWS: IAM (Identity and Access Management)

    AWS: IAM (Identity and Access Management)

    IAM acts as basic security feature that is integrated with almost every service in AWS. IAM consists of: Users Groups…

  • AWS: DynamoDB

    AWS: DynamoDB

    DynamoDB is a serverless NoSQL distributed database which scales horizontally. And the data inside DynamoDB is stored…

  • AWS: Basics

    AWS: Basics

    Amazon Web Services is a cloud computing platform that provides customers with a wide array of cloud services. We can…

  • Types of Machine Learning Models

    Types of Machine Learning Models

    What is AI/ML? At a very high-level, you can think of AI/ML as prediction. Prediction is the process of filling in…

  • SPARK - Partitioning

    SPARK - Partitioning

    Why It Matters Performance is greatly impacted if a developer does not consider infrastructure while developing a SPARK…

    1 条评论
  • Data Modeling/Dimension Modeling

    Data Modeling/Dimension Modeling

    Data Modeling Fundamentals What is Data Modeling? Lifecycle of Data Modeling The Building Blocks of Data Modeling…

  • Event Driven AWS Services

    Event Driven AWS Services

    Introduction Event-driven architectures have grown in popularity as they address some of the challenges in building the…

  • Function Structure

    Function Structure

    Structure of a FaaS Lambda Lifecycle TouchpointsExamplesS3 Output Frequently Asked Questions How do I get multiple…

  • AWS Transfer for SFTP

    AWS Transfer for SFTP

    The Secure File Transfer Protocol (SFTP) is a widely used method to exchange data between third parties and inside…

社区洞察

其他会员也浏览了