Authoring desired state
Key Principles
Principle
Description
Step-by-Step: From CloudFormation to MechCloud
CloudFormation (Original)
Resources:
VPC1:
Type: AWS::EC2::VPC
Properties:
CidrBlock: "10.2.0.0/16"
SGWeb:
Type: AWS::EC2::SecurityGroup
Properties:
VpcId: !Ref VPC1
GroupDescription: "Allow HTTP from internet"
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: "0.0.0.0/0"
SGService:
Type: AWS::EC2::SecurityGroup
Properties:
VpcId: !Ref VPC1
GroupDescription: "Allow app traffic only from web1 SG"
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 8080
ToPort: 8080
SourceSecurityGroupId: !Ref SGWeb
Subnet1:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC1
CidrBlock: "10.2.1.0/24"
Service1:
Type: AWS::EC2::Instance
Properties:
ImageId: "ami-0bc691261a82b32bc"
InstanceType: "t3.small"
SubnetId: !Ref Subnet1
SecurityGroupIds:
- !Ref SGService
Web1:
Type: AWS::EC2::Instance
Properties:
ImageId: "ami-0bc691261a82b32bc"
InstanceType: "t3.small"
SubnetId: !Ref Subnet1
SecurityGroupIds:
- !Ref SGWebMechCloud Desired State (Converted)
Conversion Rules
CloudFormation
→
MechCloud
Resource Paths (Must Be Unique)
Resource
Path
Resource Id Aliases
Provider
Resource Type
Prefix
Next Steps
Last updated