Bootstrapping nodes under Configuration Management (end-to-end IaC)
Without further delay, let us get our old VPC re-deployed along with a configuration-managed web service inside it.
Terraform will spawn the VPC, ELB, and EC2 nodes then bootstrap the SaltStack workflow with the use of EC2 UserData. Naturally, we strive to reuse as much code as possible; however, our next deployment requires some changes to the TF templates.
resources.tf
:
- We do not need the private subnets/route tables, NAT, nor RDS resources this time, so we have removed these, making the deployment a bit faster.
- We will be using an IAM Role to grant permission to the EC2 node to access the CodeCommit repository.
- We have declared the role:
resource "aws_iam_role" "terraform-role" { name = "terraform-role"path = "/"...
- We have added and associated a policy (granting...
- We have declared the role: