Skip to content

Commit

Permalink
Revert "feat: allow users to choose which user data script to apply (#13
Browse files Browse the repository at this point in the history
)"

This reverts commit b7b895d.
  • Loading branch information
luqmanbazran authored Oct 31, 2024
1 parent b7b895d commit b0f014e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ resource "aws_lambda_function" "database_lambda" {
WEBSERVER_HOSTNAME = var.turbo_deploy_hostname
WEBSERVER_HTTP_PORT = var.turbo_deploy_http_port
WEBSERVER_HTTPS_PORT = var.turbo_deploy_https_port
USER_SCRIPTS = jsonencode(keys(var.user_scripts))
AMI_FILTERS = base64gzip(jsonencode(var.image_filter_groups))
}
}
Expand Down Expand Up @@ -480,7 +479,6 @@ resource "aws_lambda_function" "my_tf_function" {
HOSTED_ZONE_ID = var.zone_id
PUBLIC_KEY = aws_key_pair.admin_key.key_name
PROFILE_NAME = aws_iam_instance_profile.turbodeploy_profile.name
USER_SCRIPTS = jsonencode(keys(var.user_scripts))
}
}
depends_on = [
Expand All @@ -496,11 +494,10 @@ resource "aws_lambda_event_source_mapping" "terraform_event_mapping" {
}

resource "aws_s3_object" "file_upload" {
for_each = var.user_scripts
bucket = aws_s3_bucket.s3_terraform_state.bucket
key = "user-data-scripts/${each.key}.sh"
key = "user-data-scripts/user-data.sh"
content_type = "text/plain"
content = each.value
content = var.user_scripts
}

resource "aws_key_pair" "admin_key" {
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ variable "ec2_attributes" {

variable "user_scripts" {
description = "The user data to use when launching the instance"
type = map(string)
default = null
type = string
default = ""
}

variable "zone_id" {
Expand Down

0 comments on commit b0f014e

Please sign in to comment.