Skip to content

Commit

Permalink
Merge pull request #2393 from alphagov/PP-6234_paas_sqs_config
Browse files Browse the repository at this point in the history
PP-6234: PaaS SQS configuration
  • Loading branch information
rjbaker authored Jun 5, 2020
2 parents b11c37e + 707e28c commit c2fc96b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ The GOV.UK Pay Connector in Java (Dropwizard)
|---------|---------|---------|
| `AWS_SQS_REGION` | - | SQS capture queue region |
| `AWS_SQS_CAPTURE_QUEUE_URL` | - | SQS capture queue URL |
| `AWS_SQS_EVENT_QUEUE_URL` | - | SQS event queue URL |
| `AWS_SQS_PAYOUT_RECONCILE_QUEUE_URL` | - | SQS payout reconcile queue URL |
| `AWS_SQS_NON_STANDARD_SERVICE_ENDPOINT` | false | Set to true to use non standard (eg: http://my-own-sqs-endpoint) SQS endpoint |
| `AWS_SQS_ENDPOINT` | - | URL that is the entry point for SQS. Only required when AWS_SQS_NON_STANDARD_SERVICE_ENDPOINT is `true` |
| `AWS_SECRET_KEY` | - | Secret key. Only required when AWS_SQS_NON_STANDARD_SERVICE_ENDPOINT is `true` |
Expand Down
5 changes: 2 additions & 3 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ applications:
GDS_CONNECTOR_STRIPE_WEBHOOK_LIVE_SIGN_SECRET: ""

# Provided by the sqs service - see src/main/resources/env-map.yml
AWS_SQS_REGION: ""
AWS_SQS_CAPTURE_QUEUE_URL: ""
AWS_SQS_ENDPOINT: ""
AWS_SQS_PAYMENT_EVENT_QUEUE_URL: ""
AWS_SQS_PAYOUT_RECONCILE_QUEUE_URL: ""

# Other sqs settings
AWS_SQS_MESSAGE_MAXIMUM_WAIT_TIME_IN_SECONDS: '20'
AWS_SQS_NON_STANDARD_SERVICE_ENDPOINT: 'true'
AWS_SQS_REGION: region-1

# Provided by the card-connector-db service - see src/main/resources/env-map.yml
DB_HOST: ""
Expand Down
23 changes: 12 additions & 11 deletions src/main/resources/env-map.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
env_vars:
DB_HOST: '.[][] | select(.name == "card-connector-db") | .credentials.host '
DB_NAME: '.[][] | select(.name == "card-connector-db") | .credentials.name '
DB_PASSWORD: '.[][] | select(.name == "card-connector-db") | .credentials.password '
DB_USER: '.[][] | select(.name == "card-connector-db") | .credentials.username '
DB_SSL_OPTION: '.[][] | select(.name == "card-connector-db") | .credentials.ssl_option // "ssl=true"'
FRONTEND_URL: '.[][] | select(.name == "app-catalog") | .credentials.card_frontend_url '
METRICS_HOST: '.[][] | select(.name == "app-catalog") | .credentials.carbon_relay_route '
METRICS_PORT: '.[][] | select(.name == "app-catalog") | .credentials.carbon_relay_port '
AWS_SQS_CAPTURE_QUEUE_URL: '.[][] | select(.name == "sqs") | .credentials.capture_queue_url '
AWS_SQS_ENDPOINT: '.[][] | select(.name == "sqs") | .credentials.endpoint '
AWS_SQS_PAYMENT_EVENT_QUEUE_URL: '.[][] | select(.name == "sqs") | .credentials.event_queue_url '
DB_HOST: '.[][] | select(.name == "card-connector-db") | .credentials.host '
DB_NAME: '.[][] | select(.name == "card-connector-db") | .credentials.name '
DB_PASSWORD: '.[][] | select(.name == "card-connector-db") | .credentials.password '
DB_USER: '.[][] | select(.name == "card-connector-db") | .credentials.username '
DB_SSL_OPTION: '.[][] | select(.name == "card-connector-db") | .credentials.ssl_option // "ssl=true"'
FRONTEND_URL: '.[][] | select(.name == "app-catalog") | .credentials.card_frontend_url '
METRICS_HOST: '.[][] | select(.name == "app-catalog") | .credentials.carbon_relay_route '
METRICS_PORT: '.[][] | select(.name == "app-catalog") | .credentials.carbon_relay_port '
AWS_SQS_REGION: '.[][] | select(.name == "sqs") | .credentials.region '
AWS_SQS_CAPTURE_QUEUE_URL: '.[][] | select(.name == "sqs") | .credentials.capture_queue_url '
AWS_SQS_PAYMENT_EVENT_QUEUE_URL: '.[][] | select(.name == "sqs") | .credentials.event_queue_url '
AWS_SQS_PAYOUT_RECONCILE_QUEUE_URL: '.[][] | select(.name == "sqs") | .credentials.payout_reconcile_queue_url '

CAPTURE_USING_SQS_FEATURE_FLAG: '.[][] | select(.name == "card-connector-secret-service") | .credentials.sqs_enabled'
EVENT_QUEUE_ENABLED: '.[][] | select(.name == "card-connector-secret-service") | .credentials.sqs_enabled'
Expand Down

0 comments on commit c2fc96b

Please sign in to comment.