diff --git a/.github/workflows/verify-ssm-parameters.yml b/.github/workflows/verify-ssm-parameters.yml index f97cbb6..d48ffe0 100644 --- a/.github/workflows/verify-ssm-parameters.yml +++ b/.github/workflows/verify-ssm-parameters.yml @@ -57,8 +57,8 @@ jobs: if ! PARAM_VALUE=$(aws ssm get-parameter --name "$param" --with-decryption --query 'Parameter.Value' --output text 2>/dev/null); then echo "::error::Missing required SSM parameter: $param" MISSING_PARAMS=1 - elif [ "$PARAM_VALUE" = "CHANGE_ME" ] || [ -z "$PARAM_VALUE" ]; then - echo "::error::SSM parameter $param has not been configured (value is empty or placeholder)" + elif [ -z "$PARAM_VALUE" ]; then + echo "::error::SSM parameter $param exists but has an empty value" MISSING_PARAMS=1 else echo "✅ Parameter $param is properly configured" @@ -71,9 +71,9 @@ jobs: echo "::error::❌ One or more required SSM parameters are missing or misconfigured" echo "" echo "💡 To fix this:" - echo " 1. Ensure Terraform has been applied to create the parameter structure" - echo " 2. Manually set the actual values in AWS Systems Manager Parameter Store" - echo " 3. Replace any 'CHANGE_ME' placeholder values with real configuration" + echo " 1. Ensure bootstrap Terraform has been applied to create the parameters" + echo " 2. Run 'terraform apply' in the infra/terraform/bootstrap directory" + echo " 3. Provide the required values when prompted during bootstrap" exit 1 fi diff --git a/infra/terraform/bootstrap/main.tf b/infra/terraform/bootstrap/main.tf index a738780..e1b6777 100644 --- a/infra/terraform/bootstrap/main.tf +++ b/infra/terraform/bootstrap/main.tf @@ -2,6 +2,30 @@ provider "aws" { region = var.aws_region } +# SSM Parameters +# These are populated interactively during bootstrap + +resource "aws_ssm_parameter" "alert_email" { + name = "/jaildata/alert-email" + type = "String" + value = var.alert_email + description = "E-mail address for JailData alerts" +} + +resource "aws_ssm_parameter" "jail_data_base_url" { + name = "/jaildata/base-url" + type = "String" + value = var.jail_data_base_url + description = "Base URL for external jail data API endpoints" +} + +resource "aws_ssm_parameter" "buncombe_api_id" { + name = "/jaildata/facilities/buncombe/api-id" + type = "String" + value = var.buncombe_api_id + description = "API ID for Buncombe County jail data system" +} + # Create IAM user for GitHub Actions resource "aws_iam_user" "github_actions" { name = "github-actions-jaildata" @@ -331,4 +355,32 @@ output "terraform_state_bucket" { output "terraform_state_lock_table" { description = "DynamoDB table for Terraform state locking" value = aws_dynamodb_table.terraform_state_lock.name +} + +# Reminder about SSM parameter configuration +output "ssm_parameters_created" { + description = "SSM parameters created by bootstrap" + value = <