Skip to content

Commit

Permalink
Cleanup autogenerated server vars (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockycodes committed Nov 7, 2023
1 parent 53dfc1b commit 57b8ae7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 850 deletions.
78 changes: 3 additions & 75 deletions cloud/aws/templates/aws_oidc/app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,83 +82,11 @@ module "civiform_server_container_def" {
]

map_environment = merge({
PORT = var.port

DB_JDBC_STRING = "jdbc:postgresql://${aws_db_instance.civiform.address}:${aws_db_instance.civiform.port}/postgres?ssl=true&sslmode=require"

PORT = var.port
DB_JDBC_STRING = "jdbc:postgresql://${aws_db_instance.civiform.address}:${aws_db_instance.civiform.port}/postgres?ssl=true&sslmode=require"
STORAGE_SERVICE_NAME = "s3"
AWS_S3_BUCKET_NAME = aws_s3_bucket.civiform_files_s3.id

CIVIFORM_VERSION = var.image_tag
SHOW_CIVIFORM_IMAGE_TAG_ON_LANDING_PAGE = var.show_civiform_image_tag_on_landing_page

WHITELABEL_CIVIC_ENTITY_SHORT_NAME = var.civic_entity_short_name
WHITELABEL_CIVIC_ENTITY_FULL_NAME = var.civic_entity_full_name
WHITELABEL_SMALL_LOGO_URL = var.civic_entity_small_logo_url
WHITELABEL_LOGO_WITH_NAME_URL = var.civic_entity_logo_with_name_url

SUPPORT_EMAIL_ADDRESS = var.civic_entity_support_email_address
AWS_SES_SENDER = var.sender_email_address

STAGING_ADMIN_LIST = var.staging_program_admin_notification_mailing_list
STAGING_TI_LIST = var.staging_ti_notification_mailing_list
STAGING_APPLICANT_LIST = var.staging_applicant_notification_mailing_list
STAGING_ADD_NOINDEX_META_TAG = var.staging_add_noindex_meta_tag
STAGING_DISABLE_DEMO_MODE_LOGINS = var.staging_disable_demo_mode_logins
STAGING_DISABLE_APPLICANT_GUEST_LOGIN = var.staging_disable_applicant_guest_login

APPLICANT_OIDC_PROVIDER_LOGOUT = var.applicant_oidc_provider_logout
APPLICANT_OIDC_OVERRIDE_LOGOUT_URL = var.applicant_oidc_override_logout_url
APPLICANT_OIDC_POST_LOGOUT_REDIRECT_PARAM = var.applicant_oidc_post_logout_redirect_param
APPLICANT_OIDC_LOGOUT_CLIENT_PARAM = var.applicant_oidc_logout_client_param
APPLICANT_OIDC_DISCOVERY_URI = var.applicant_oidc_discovery_uri
APPLICANT_REGISTER_URI = var.applicant_register_uri
APPLICANT_PORTAL_NAME = var.applicant_portal_name

CIVIFORM_ADMIN_REPORTING_UI_ENABLED = var.feature_flag_reporting_enabled
CIVIFORM_APPLICATION_STATUS_TRACKING_ENABLED = var.feature_flag_status_tracking_enabled

# Add variables that are also listed in env-var-docs.json in the civiform repository below this line.

# TODO: Remove variables below when auto generation via env-var-docs is fully enabled to avoid
# duplicates in the civiform_server_environment_variables map.
STAGING_HOSTNAME = var.staging_hostname
BASE_URL = var.base_url != "" ? var.base_url : "https://${var.custom_hostname}"
CLIENT_IP_TYPE = "FORWARDED"
CIVIFORM_TIME_ZONE_ID = var.civiform_time_zone_id
FAVICON_URL = var.favicon_url
AWS_REGION = var.aws_region
CIVIFORM_APPLICANT_IDP = var.civiform_applicant_idp
APPLICANT_OIDC_PROVIDER_NAME = var.applicant_oidc_provider_name
APPLICANT_OIDC_RESPONSE_MODE = var.applicant_oidc_response_mode
APPLICANT_OIDC_RESPONSE_TYPE = var.applicant_oidc_response_type
APPLICANT_OIDC_ADDITIONAL_SCOPES = var.applicant_oidc_additional_scopes
APPLICANT_OIDC_LOCALE_ATTRIBUTE = var.applicant_oidc_locale_attribute
APPLICANT_OIDC_EMAIL_ATTRIBUTE = var.applicant_oidc_email_attribute
APPLICANT_OIDC_FIRST_NAME_ATTRIBUTE = var.applicant_oidc_first_name_attribute
APPLICANT_OIDC_MIDDLE_NAME_ATTRIBUTE = var.applicant_oidc_middle_name_attribute
APPLICANT_OIDC_LAST_NAME_ATTRIBUTE = var.applicant_oidc_last_name_attribute
ADFS_DISCOVERY_URI = var.adfs_discovery_uri
ADFS_ADDITIONAL_SCOPES = var.adfs_additional_scopes
ADFS_GLOBAL_ADMIN_GROUP = var.adfs_admin_group
AD_GROUPS_ATTRIBUTE_NAME = var.ad_groups_attribute_name

BYPASS_LOGIN_LANGUAGE_SCREENS = var.bypass_login_language_screens
ALLOW_CIVIFORM_ADMIN_ACCESS_PROGRAMS = var.allow_civiform_admin_access_programs
PROGRAM_ELIGIBILITY_CONDITIONS_ENABLED = var.program_eligibility_conditions_enabled
INTAKE_FORM_ENABLED = var.intake_form_enabled
NONGATED_ELIGIBILITY_ENABLED = var.nongated_eligibility_enabled
PUBLISH_SINGLE_PROGRAM_ENABLED = var.publish_single_program_enabled

COMMON_INTAKE_MORE_RESOURCES_LINK_TEXT = var.common_intake_more_resources_link_text
COMMON_INTAKE_MORE_RESOURCES_LINK_HREF = var.common_intake_more_resources_link_href

ESRI_ADDRESS_CORRECTION_ENABLED = var.esri_address_correction_enabled
ESRI_FIND_ADDRESS_CANDIDATES_URL = var.esri_find_address_candidate_url

CIVIFORM_API_KEYS_BAN_GLOBAL_SUBNET = var.civiform_api_keys_ban_global_subnet
CIVIFORM_SERVER_METRICS_ENABLED = var.civiform_server_metrics_enabled
FEATURE_FLAG_OVERRIDES_ENABLED = var.feature_flag_overrides_enabled
CLIENT_IP_TYPE = "FORWARDED" // must be "FORWARDED" for all AWS deployments
}, var.civiform_server_environment_variables)

port_mappings = [
Expand Down
101 changes: 0 additions & 101 deletions cloud/aws/templates/aws_oidc/variable_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,107 +41,6 @@
"cn-northwest-1"
]
},
"STAGING_HOSTNAME": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"BASE_URL": {
"required": true,
"secret": false,
"tfvar": true,
"type": "string",
"value_regex": "https?://[^\\s]+",
"value_regex_error_message": "needs to be a url that starts with http(s)://."
},
"CIVIFORM_APPLICANT_IDP": {
"required": true,
"secret": false,
"tfvar": true,
"type": "enum",
"values": ["idcs", "generic-oidc", "adfs", "disabled", "login-gov", "auth0"]
},
"APPLICANT_OIDC_PROVIDER_NAME": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string",
"value_regex": "[^\\s]*",
"value_regex_error_message": "needs to be url safe. No spaces are allowed."
},
"APPLICANT_OIDC_DISCOVERY_URI": {
"required": true,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_RESPONSE_MODE": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_RESPONSE_TYPE": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_ADDITIONAL_SCOPES": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_LOCALE_ATTRIBUTE": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_EMAIL_ATTRIBUTE": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_FIRST_NAME_ATTRIBUTE": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_MIDDLE_NAME_ATTRIBUTE": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"APPLICANT_OIDC_LAST_NAME_ATTRIBUTE": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"ADFS_DISCOVERY_URI": {
"required": true,
"secret": false,
"tfvar": true,
"type": "string"
},
"ADFS_ADDITIONAL_SCOPES": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"AD_GROUPS_ATTRIBUTE_NAME": {
"required": false,
"secret": false,
"tfvar": true,
"type": "string"
},
"SSL_CERTIFICATE_ARN": {
"required": true,
"secret": false,
Expand Down
Loading

0 comments on commit 57b8ae7

Please sign in to comment.