Skip to content

Commit

Permalink
Update Terraform configuration to add user data
Browse files Browse the repository at this point in the history
During initialization, a test script is run. Update workflow.
  • Loading branch information
emilyllim committed Nov 3, 2023
1 parent 2c57cf3 commit 90c0c0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/benchrunner-aws.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Deploy benchrunner to AWS

on:
[push]
push:
branches:
- main
workflow_dispatch: {}

jobs:
deploy:
Expand Down
3 changes: 3 additions & 0 deletions terraform/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo "This is a test file was created during the instance initialization." > test.txt
1 change: 1 addition & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ resource "aws_instance" "bench_runner" {
key_name = "bench-runner"
vpc_security_group_ids = ["${aws_security_group.ingress_all.id}"]
subnet_id = aws_subnet.subnet1.id
user_data = file("init.sh")

tags = {
Name = "BenchmarkingEC2Runner"
Expand Down

0 comments on commit 90c0c0a

Please sign in to comment.