Former2 allows you to generate IaC (Infrastructure as Code) (such as CloudFormation, CDK, Terraform, etc) from existing AWS resources and is mentioned on AWS Open Source Blog (Accelerate infrastructure as code development with open source Former2 and How DNAnexus used the open source Former2 project to create infrastructure as code templates for their disaster recovery pipeline).
Some users have challenges creating access keys while others express security concerns about entering AWS security credentials on a public website, and would prefer a private web instance. However, Former2 requires browser helper extension that only works with websites that has domain names 127.0.0.1, localhost, former2.com and www.former2.com.
This CloudFormation template creates an EC2 instance hosting Former2 in your AWS account. You can connect to the instance with Amazon DCV remote display protocol to generate and download IaC templates using temporary security credentials.
EC2 instances must be provisioned in a subnet with IPv4 internet connectivity.
Download the CloudFormation template(AL2023 or AL2). Login to your CloudFormation console. Choose Create Stack, Upload a template file, Choose File, select your .yaml file and choose Next. Enter a Stack name and specify parameters values.
EC2
ec2Name
: EC2 instance nameprocessorArchitecture
: Intel/AMD x86_64 or Graviton arm64. Default isGraviton (arm64)
instanceType
: EC2 instance types. Do ensure type matches processor architecture.
Network
vpcID
: VPC with internet connectivity. Select default VPC if unsuresubnetID
: subnet with internet connectivity. Select subnet in default VPC if unsuredisplayPublicIP
: set this toNo
if your EC2 instance will not receive public IP address. EC2 private IP will be displayed in CloudFormation Outputs section instead. Default isYes
assignStaticIP
: associates a static public IPv4 address using Elastic IP address. Default isYes
Remote Access
ingressIPv4
: allowed IPv4 source prefix to your EC2 instance, e.g.1.2.3.4/32
. You can get your source IP from https://checkip.amazonaws.comingressIPv6
: allowed IPv6 source prefix to your EC2 instance. Use::1/128
to block all incoming IPv6 access. Default is::/0
EBS
volumeSize
: Amazon EBS volume sizevolumeType
: EBS General Purpose Volume type
Continue Next with Configure stack options, Review Stack, and click Submit to launch your stack. After your stack has been successfully created, its status changes to CREATE_COMPLETE.
Once provisioned, go to CloudFormation stack Outputs section and use the Values associated with the following Keys
-
SSMSessionManager
: open URL in a new browser tab for shell access.From session manager terminal, set your ec2-user password with the command
sudo passwd ec2-user
-
DCVwebConsole
: open URL in a new browser tab, and connect to your EC2 instanceLogin as ec2-user and your configured password
Launch
Firefox
and navigate to Former2 site athttp://localhost
. Install Former 2 Helper for Mozilla Firefox
-
In your DCV session, launch
Terminal
and run the command/home/ec2-user/get-iam-creds
.Use these values to enter IAM credentials (Access Key ID, Secret Access Key, Session Token) at http://localhost/#section-setup-credentials
Refer to Accelerate infrastructure as code development with open source Former2 blog post for usage guidance.
CloudFormation template downloads Former2 web codes from Ian Mckay's GitHub repo which are released under MIT license.
Former2 is under active development. To download latest codes, login to EC2 instance and run /home/ec2-user/update-former2
script.
DCV supports file transfer. Native clients can be downloaded from Amazon DCV site
Usage indicates acceptance of DCV EULA.
To remove created resources, delete your created CloudFormation stack
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.