Skip to content

Commit 23f2ebf

Browse files
committed
revert
1 parent 844fb64 commit 23f2ebf

File tree

6 files changed

+15
-99
lines changed

6 files changed

+15
-99
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,3 @@ node_modules/
169169

170170
.ruff_cache/
171171
.env-cdk
172-
config.yaml
173-
stac-browser/
174-
.envrc

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ services:
143143
- ./dockerfiles/scripts:/tmp/scripts
144144

145145
database:
146-
image: ghcr.io/stac-utils/pgstac:v0.9.3
146+
image: ghcr.io/stac-utils/pgstac:v0.9.2
147147
environment:
148148
- POSTGRES_USER=username
149149
- POSTGRES_PASSWORD=password

infrastructure/app.py

Lines changed: 9 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
RemovalPolicy,
88
Stack,
99
aws_certificatemanager,
10-
aws_cloudfront,
11-
aws_cloudfront_origins,
1210
aws_ec2,
1311
aws_iam,
1412
aws_lambda,
1513
aws_rds,
16-
aws_route53,
17-
aws_route53_targets,
1814
aws_s3,
1915
)
2016
from aws_cdk.aws_apigateway import DomainNameOptions
@@ -126,7 +122,7 @@ def __init__(
126122
"context": True,
127123
"mosaic_index": True,
128124
},
129-
pgstac_version="0.9.3",
125+
pgstac_version="0.9.2",
130126
)
131127

132128
# allow connections from any ipv4 to pgbouncer instance security group
@@ -356,90 +352,29 @@ def __init__(
356352
)
357353

358354
if app_config.stac_browser_version:
359-
if not (
360-
app_config.hosted_zone_id
361-
and app_config.hosted_zone_name
362-
and app_config.stac_browser_custom_domain
363-
and app_config.stac_browser_certificate_arn
364-
):
365-
raise ValueError(
366-
"to deploy STAC browser you must provide config parameters for hosted_zone_id and stac_browser_custom_domain and stac_browser_certificate_arn"
367-
)
368-
369355
stac_browser_bucket = aws_s3.Bucket(
370356
self,
371357
"stac-browser-bucket",
372358
bucket_name=app_config.build_service_name("stac-browser"),
373359
removal_policy=RemovalPolicy.DESTROY,
374360
auto_delete_objects=True,
375-
block_public_access=aws_s3.BlockPublicAccess.BLOCK_ALL,
376-
enforce_ssl=True,
377-
)
378-
379-
distribution = aws_cloudfront.Distribution(
380-
self,
381-
"stac-browser-distribution",
382-
default_behavior=aws_cloudfront.BehaviorOptions(
383-
origin=aws_cloudfront_origins.S3Origin(stac_browser_bucket),
384-
viewer_protocol_policy=aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
385-
allowed_methods=aws_cloudfront.AllowedMethods.ALLOW_GET_HEAD,
386-
cached_methods=aws_cloudfront.CachedMethods.CACHE_GET_HEAD,
387-
),
388-
default_root_object="index.html",
389-
error_responses=[
390-
aws_cloudfront.ErrorResponse(
391-
http_status=404,
392-
response_http_status=200,
393-
response_page_path="/index.html",
394-
)
395-
],
396-
certificate=aws_certificatemanager.Certificate.from_certificate_arn(
397-
self,
398-
"stac-browser-certificate",
399-
app_config.stac_browser_certificate_arn,
400-
),
401-
domain_names=[app_config.stac_browser_custom_domain],
402-
)
403-
404-
account_id = Stack.of(self).account
405-
distribution_arn = f"arn:aws:cloudfront::${account_id}:distribution/${distribution.distribution_id}"
406-
407-
stac_browser_bucket.add_to_resource_policy(
408-
aws_iam.PolicyStatement(
409-
actions=["s3:GetObject"],
410-
resources=[stac_browser_bucket.arn_for_objects("*")],
411-
principals=[aws_iam.ServicePrincipal("cloudfront.amazonaws.com")],
412-
conditions={"StringEquals": {"AWS:SourceArn": distribution_arn}},
413-
)
414-
)
415-
416-
hosted_zone = aws_route53.HostedZone.from_hosted_zone_attributes(
417-
self,
418-
"stac-browser-hosted-zone",
419-
hosted_zone_id=app_config.hosted_zone_id,
420-
zone_name=app_config.hosted_zone_name,
421-
)
422-
423-
aws_route53.ARecord(
424-
self,
425-
"stac-browser-alias",
426-
zone=hosted_zone,
427-
target=aws_route53.RecordTarget.from_alias(
428-
aws_route53_targets.CloudFrontTarget(distribution)
361+
website_index_document="index.html",
362+
public_read_access=True,
363+
block_public_access=aws_s3.BlockPublicAccess(
364+
block_public_acls=False,
365+
block_public_policy=False,
366+
ignore_public_acls=False,
367+
restrict_public_buckets=False,
429368
),
430-
record_name=app_config.stac_browser_custom_domain,
369+
object_ownership=aws_s3.ObjectOwnership.OBJECT_WRITER,
431370
)
432-
433371
StacBrowser(
434372
self,
435373
"stac-browser",
436374
github_repo_tag=app_config.stac_browser_version,
437375
stac_catalog_url=f"https://{app_config.stac_api_custom_domain}",
438376
website_index_document="index.html",
439377
bucket_arn=stac_browser_bucket.bucket_arn,
440-
config_file_path=os.path.join(
441-
os.path.abspath(context_dir), "browser_config.js"
442-
),
443378
)
444379

445380
def _create_data_access_role(self) -> aws_iam.Role:

infrastructure/config.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,6 @@ class AppConfig(BaseSettings):
116116
as it will be used as a backend.""",
117117
default=None,
118118
)
119-
stac_browser_custom_domain: Optional[str] = Field(
120-
description="Custom domain name for the STAC Browser site",
121-
default=None,
122-
)
123-
stac_browser_certificate_arn: Optional[str] = Field(
124-
description="Arn for the STAC Browser custom domain name (must be in us-east-1)",
125-
default=None,
126-
)
127-
hosted_zone_id: Optional[str] = Field(
128-
description="Hosted Zone ID for custom domains",
129-
default=None,
130-
)
131-
hosted_zone_name: Optional[str] = Field(
132-
description="Hosted Zone Name for custom domains",
133-
default=None,
134-
)
135119

136120
model_config = SettingsConfigDict(
137121
env_file=".env-cdk", yaml_file="config.yaml", extra="allow"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ dev = [
1919
"httpx>=0.28.1",
2020
"pre-commit>=4.1.0",
2121
"psycopg[pool]>=3.2.4",
22-
"pypgstac==0.9.3",
22+
"pypgstac==0.9.2",
2323
"pytest>=8.3.4",
2424
]

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)