Convert gem4gov GE application(s) creation to Terraform#148
Conversation
|
|
||
| dynamic "path_matcher" { | ||
| for_each = data.terraform_remote_state.stage_0.outputs.acl_idp_type == "GSUITE" ? ["gsuite"] : [] | ||
| for_each = contains(["GSUITE", "GOOGLE_CLOUD_IDENTITY"], data.terraform_remote_state.stage_0.outputs.acl_idp_type) ? ["gsuite"] : [] |
There was a problem hiding this comment.
fixes a bug where the routing rules were not properly configured when using Cloud Identity as the IdP
| url_rewrite { | ||
| host_rewrite = "vertexaisearch.cloud.google.com" | ||
| path_prefix_rewrite = "/us/home/cid/${var.gemini_config_id}?hl=en_US" | ||
| path_prefix_rewrite = "/us/home/cid/${data.terraform_remote_state.stage_0.outputs.gemini_apps_widget_ids[keys(data.terraform_remote_state.stage_0.outputs.gemini_apps_widget_ids)[0]]}?hl=en_US" |
There was a problem hiding this comment.
we no longer need to prompt the user for the gemini config IDs, just pull them in from the stage 0 state
|
|
||
| # Prompts for Gemini Applications configuration | ||
| echo "" | ||
| echo -e "${BLUE}--- Gemini Enterprise Applications ---${NC}" |
There was a problem hiding this comment.
added to the Stage 0 steps to configure GE apps
|
|
||
| # Write gemini_apps to terraform.tfvars.json | ||
| if [[ "$APPS_OBJ" != "{}" && -n "$APPS_OBJ" ]]; then | ||
| echo "{\"gemini_apps\": ${APPS_OBJ}}" > gemini-stage-0/terraform.tfvars.json |
There was a problem hiding this comment.
writes GE app configs to a separate terraform.tfvars.json file for better readability
| if ! terraform apply -var-file="terraform.tfvars"; then | ||
| VAR_FILES=(-var-file="terraform.tfvars") | ||
| if [[ -f "terraform.tfvars.json" ]]; then | ||
| VAR_FILES+=(-var-file="terraform.tfvars.json") |
There was a problem hiding this comment.
apply terraform with GE app configurations
|
|
||
| # Post-Deployment: Configure Observability (Audit Logs) and Default Assistants for Gemini Apps | ||
| echo "" | ||
| echo "Configuring logging and assistant compliance settings for Gemini applications..." |
There was a problem hiding this comment.
when creating the GE engine via Terraform it automatically creates the Default Assistant when the engine is set to Enterprise, so we need to subsequently update the assistant with the proper configuration.
see hashicorp/terraform-provider-google#26316 for more details
Description
Converts the
gem4gov create appfunctionality to Terraform to follow IaC best practices.Fixes #100
Type of Change
Deployment & Compliance Impact
Checklist
Code Quality & Reusability
modules/orfast/can be leveraged for this change.documentation/naming-convention.md.Documentation
README.mdof the modified module or blueprint.Security
Testing
Testing Performed
I have performed several deployments for GE and have confirmed that the proper infrastructure is correctly set up and the application is accessible to authorized users.