An example Cloudformation stack for provisioning
- EC2 Instance
- Auto-generated SSH Key for accessing the EC2 Instance
- Security Group allowing incoming SSH access to the EC2 Instance
You can deploy the stack via the AWS SAM CLI. Once you have cloned the repository, run
$ sam deploy
By default, this will deploy the stack to the us-east-1
region. You can change this value via the command line options or updating the value within the samconfig.toml
.
You can configure GitHub actions to deploy your stack whenever changes are made to the main
branch.
Although the workflow is already written, there are other steps required to have this deploy complete in a desired AWS account.
In your AWS Account, create a new IAM Role with the permissions you deem necessary. This must include Cloudformation. Refer to GitHub's docs for Configuring OpenID Connect in AWS for guidance.
Add the following secrets via Repository settings > Secrets > Actions.
IAM_ROLE_ARN
containing your IAM Role ARN from step 1.
To trigger a deploy, simply commit changes to the main
branch.