AWS Resources - krdheeraj51/aws-labs GitHub Wiki
In AWS CloudFormation, resources are the fundamental building blocks of your AWS infrastructure. They represent the various AWS services and components that you can provision and manage using CloudFormation templates. Each resource is defined in the template and can be configured with specific properties.
Key Points about Resources in CloudFormation Templates:
Resource Types:
- Each resource type corresponds to an AWS service or component, such as AWS::EC2::Instance for an EC2 instance, AWS::S3::Bucket for an S3 bucket, and AWS::Lambda::Function for a Lambda function.
- The resource type determines the properties that can be specified for the resource.
Resource Properties:
- Properties are the settings and configurations for the resource. For example, an EC2 instance resource might have properties like InstanceType, KeyName, and SecurityGroups.
- Each resource type has a specific set of properties that you can define.
Resource Dependencies:
Resources can depend on other resources. CloudFormation automatically handles dependencies between resources to ensure they are created in the correct order. You can explicitly specify dependencies using the DependsOn attribute.
Intrinsic Functions:
CloudFormation provides intrinsic functions to reference and manipulate resource properties. Examples include Ref, Fn::GetAtt, and Fn::Join. These functions allow you to dynamically reference resource attributes and create more flexible templates.
Resource Deletion Policies:
- You can specify deletion policies for resources to control what happens when a stack is deleted. Options include Retain, Snapshot, and Delete.
- This is useful for preserving data or creating backups when resources are deleted.
Resource Metadata:
- Metadata can be added to resources to provide additional information or configuration details.
- This can be used for custom processing or to include additional documentation within the template