Skip to main content
Knowledge Base

How to handle "Provided value for option repo does not match regex" in GW Pipelines?

Answer

When running a `plan` on the Reference Architecture, I'm getting the following error: ``` [INFO] [aws-auth] Success! Running infrastructure-deployer with args: --aws-region us-east-1 -- terraform-planner infrastructure-deploy-script --ref e052cd6495ca55ad03cc918a86de9fa3d78cce0a --binary terragrunt --command plan --command-args --deploy-path dev/us-east-1/dev/ec2-test --repo https://github.com/gruntwork-io/infrastructure-live --force-https true [infrastructure-deployer] time="2022-02-23T10:02:05Z" level=info msg="Invoking Lambda function ecs-deploy-runner-invoker to trigger deployment." ERROR: OptionRegexRestrictedError: Provided value for option repo (https://github.com/gruntwork-io/infrastructure-live) does not match regex (^((git@github\.com:gruntwork-io/infrastructure-live\.git)|(https://github/\.com/gruntwork-clients/infrastructure-live\.git))$) Error: Process completed with exit code 123. ``` How do I fix this?

This is because the ECS Deploy Runner has been configured to restrict your repo to the ssh URL instead of https, but your script is trying to deploy using the https URL. The easiest way to resolve this would be to update the CI scripts so that it uses the SSH url instead of the HTTPS url for the `--repo` call (e.g., you can try hardcoding the `repo_url` var [here](https://github.com/gruntwork-io/terraform-aws-service-catalog/blob/master/examples/for-production/infrastructure-live/_ci/scripts/deploy-infra.sh#L58)) Alternatively, you can update the `ecs-deploy-runner` to allow using the https URL. This setting is configured using the `terraform_applier_config.infrastructure_live_repositories` setting for the `ecs-deploy-runner` module. In the ref arch, it’s managed [here](https://github.com/gruntwork-io/terraform-aws-service-catalog/blob/master/examples/for-production/infrastructure-live/_envcommon/mgmt/ecs-deploy-runner.hcl#L161), which points to [this local](https://github.com/gruntwork-io/terraform-aws-service-catalog/blob/master/examples/for-production/infrastructure-live/_envcommon/mgmt/ecs-deploy-runner.hcl#L110-L113). You can add the https URL to that local and redeploy the `ecs-deploy-runner` in each account, which should update the regex to allow the https URL.