Skip to content

Commit

Permalink
feat: add tf ec2 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lanandra committed Dec 10, 2024
1 parent 6279df0 commit ad09da5
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .codecatalyst/workflows/tf-sandbox-sbx0-ec2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Name: tf-sandbox-sbx0-ec2
SchemaVersion: "1.0"

Triggers:
- Type: PUSH
Branches:
- master
FilesChanged:
- sandbox\/sbx0\/ec2\/.*

Actions:
terraform-plan:
Identifier: aws/build@v1
Inputs:
Sources:
- WorkflowSource
Environment:
Name: sandbox
Connections:
- Name: lanandra-sandbox
Role: tf-codecatalyst-admin-sandbox
Configuration:
Container:
Registry: DockerHub
Image: hashicorp/terraform:1.8.2
Steps:
- Run: cd sandbox/sbx0/ec2
- Run: terraform fmt -check -no-color
- Run: terraform init -no-color
- Run: terraform validate -no-color
- Run: terraform plan -no-color -input=false
Compute:
Type: EC2
wait-for-approval:
Identifier: aws/approval@v1
DependsOn:
- terraform-plan
Configuration:
ApprovalsRequired: 1
terraform-apply:
DependsOn:
- wait-for-approval
Identifier: aws/build@v1
Inputs:
Sources:
- WorkflowSource
Environment:
Name: sandbox
Connections:
- Name: lanandra-sandbox
Role: tf-codecatalyst-admin-sandbox
Configuration:
Container:
Registry: DockerHub
Image: hashicorp/terraform:1.8.2
Steps:
- Run: cd sandbox/sbx0/ec2
- Run: terraform init -no-color
- Run: terraform apply -auto-approve -no-color -input=false
Compute:
Type: EC2

0 comments on commit ad09da5

Please sign in to comment.