Resources
To declare resources in CloudFormation
Resources:
MyResource1:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
MyResource2:
Type: AWS::EC2::EIP
Properties
InstanceId: !Ref MyResource1
Note: You can't create a dynamic amount of resources. Everything has to be declared