Skip to content

Commit 5ff6af5

Browse files
committed
fix: configurable dapa url
1 parent b419eab commit 5ff6af5

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

tf-module/stac_browser/ec2.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ resource "aws_instance" "ds_stac_browser" {
7070
user_data = templatefile("${path.module}/ec2_start.txt", {
7171
github_image_url: var.github_image_url,
7272
image_tag: var.image_tag,
73+
dapa_api_url_base_val: var.dapa_api_url_base_val
7374
})
7475
tags = merge(var.tags, {
7576
Name = "${var.prefix}-ds_stac_browser"

tf-module/stac_browser/ec2_start.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ echo 'done script permission' >> /var/log/user-data-whoami.log;
1717

1818
echo "script wrote";
1919

20-
docker run -d --name my_service --restart always --tty --workdir /usr/src/app/unity/cumulus_lambda_functions/uds_api -v "/root/ss.sh":"/usr/src/app/unity/cumulus_lambda_functions/uds_api/ss.sh":z -p 8005:8005 -e AWS_REGION='us-west-2' -e PYTHONPATH='$PYTHONPATH:/usr/src/app/unity' -e LOG_LEVEL='10' -e DAPA_API_URL_BASE='https://d3vc8w9zcq658.cloudfront.net/am-uds-dapa' -e DAPA_API_PREIFX_KEY='data' -e STATIC_PARENT_DIR='/usr/src/app/unity/cumulus_lambda_functions/uds_api/' --entrypoint /usr/src/app/unity/cumulus_lambda_functions/uds_api/ss.sh ${github_image_url}:${image_tag}
20+
docker run -d --name my_service --restart always --tty --workdir /usr/src/app/unity/cumulus_lambda_functions/uds_api -v "/root/ss.sh":"/usr/src/app/unity/cumulus_lambda_functions/uds_api/ss.sh":z -p 8005:8005 -e AWS_REGION='us-west-2' -e PYTHONPATH='$PYTHONPATH:/usr/src/app/unity' -e LOG_LEVEL='10' -e DAPA_API_URL_BASE=${dapa_api_url_base_val} -e DAPA_API_PREIFX_KEY='data' -e STATIC_PARENT_DIR='/usr/src/app/unity/cumulus_lambda_functions/uds_api/' --entrypoint /usr/src/app/unity/cumulus_lambda_functions/uds_api/ss.sh ${github_image_url}:${image_tag}

tf-module/stac_browser/terraform.tfvars.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ cumulus_lambda_vpc_id = "vpc-xxx"
44
image_tag="9.6.0"
55
subnet_ids = ["subnet-private-subnet-id-1", "subnet-private-subnet-id-2"]
66
shared_services_ec2_subnet_cidr = "10.52.0.0/16"
7-
alb_subnet_cidr = "10.52.0.0/16"
7+
alb_subnet_cidr = "10.52.0.0/16"
8+
dapa_api_url_base_val = "https://d3vc8w9zcq658.cloudfront.net/am-uds-dapa"

tf-module/stac_browser/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,9 @@ variable "shared_services_ec2_subnet_cidr" {
5353
variable "alb_subnet_cidr" {
5454
type = string
5555
description = "CIDR of the Subnet where ALB resides. This is to allow connections from ALB to Stac Browser EC2. Example: 10.52.0.0/16"
56+
}
57+
58+
variable "dapa_api_url_base_val" {
59+
type = string
60+
description = "Base URL to hit Stac API to retrieve catalog and so on.. It must start with https and must include the prefix such as `/am-uds-dapa` example: https://d3vc8w9zcq658.cloudfront.net/am-uds-dapa."
5661
}

0 commit comments

Comments
 (0)