Skip to content

Commit f38d5d2

Browse files
Merge pull request #63 from asfadmin/dev
API Stage Maturities
2 parents b52a6af + 1eeec62 commit f38d5d2

12 files changed

Lines changed: 47 additions & 43 deletions

File tree

.github/workflows/deploy-prod-staging.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
with:
7979
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
8080
staging: true
81+
maturity: prod-staging
8182

8283
run-prod-staging-integration-tests:
8384
needs: [deploy-prod-staging]

.github/workflows/deploy-prod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ jobs:
4040
uses: ./.github/workflows/search-api-composite
4141
with:
4242
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
43+
maturity: prod
4344

.github/workflows/deploy-test-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
uses: ./.github/workflows/search-api-composite
7878
with:
7979
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
80-
staging: true
80+
maturity: test-staging
8181

8282
run-test-staging-integration-tests:
8383
needs: [deploy-test-staging]

.github/workflows/deploy-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ jobs:
4040
uses: ./.github/workflows/search-api-composite
4141
with:
4242
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
43+
maturity: test

.github/workflows/search-api-composite/action.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ inputs:
1313
security-group:
1414
required: true
1515
type: string
16-
17-
staging:
18-
required: false
19-
type: boolean
16+
maturity:
17+
required: true
18+
type: string
2019

2120
runs:
2221
using: "composite"
@@ -57,5 +56,4 @@ runs:
5756
--context vpc_id=${{ inputs.vpc-id }} \
5857
--context subnet_ids=${{ inputs.subnet-ids }} \
5958
--context security_group=${{ inputs.security-group }} \
60-
--context staging=${{ inputs.staging }}
61-
59+
--context api_stage=${{ inputs.maturity }}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
3232

3333
### Fixed
3434
- boolean values are properly capitalized in `python` output file
35-
35+
- API maturity set for each level of deployment stage
3636
------
3737
## [1.0.7](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.6...v1.0.7)
3838
### Changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM public.ecr.aws/docker/library/python:3.12
22
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
33
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
44

5+
ARG MATURITY="local"
6+
ENV MATURITY=${MATURITY}
57
ARG HOST=0.0.0.0
68
ENV HOST=${HOST}
79
ARG PORT=8080

cdk/app.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
app = cdk.App()
1010

11-
staging = app.node.try_get_context('staging')
12-
if staging is None:
13-
staging = False
14-
11+
staging = False
1512
suffix = ''
16-
if staging:
13+
api_stage = app.node.try_get_context('api_stage')
14+
15+
if api_stage.endswith('staging'):
16+
staging = True
1717
suffix = '-Staging'
1818

1919
SearchAPIStack(app, f"SearchAPIStack{suffix}",
@@ -24,6 +24,7 @@
2424
# Uncomment the next line to specialize this stack for the AWS Account
2525
# and Region that are implied by the current CLI configuration.
2626
staging=staging,
27+
api_stage=api_stage,
2728
env=cdk.Environment(
2829
account=os.getenv('CDK_DEFAULT_ACCOUNT'),
2930
region=os.getenv('CDK_DEFAULT_REGION')

cdk/cdk/cdk_stack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class SearchAPIStack(Stack):
1414

15-
def __init__(self, scope: Construct, construct_id: str, staging: bool = False, **kwargs) -> None:
15+
def __init__(self, scope: Construct, construct_id: str, api_stage: str, staging: bool = False, **kwargs) -> None:
1616
super().__init__(scope, construct_id, **kwargs)
1717

1818
try:
@@ -60,7 +60,7 @@ def __init__(self, scope: Construct, construct_id: str, staging: bool = False, *
6060
memory_size=5308,
6161
code=lambda_.DockerImageCode.from_image_asset(
6262
directory='..',
63-
# build_args={'MATURITY': }
63+
build_args={'MATURITY': api_stage},
6464
),
6565
**lambda_vpc_kwargs,
6666
)

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
anyio==3.6.2
22
certifi>=2023.7.22
33
click==8.1.3
4-
dnspython==2.3.0
4+
dnspython>=2.6.1
55
email-validator>=2.0
6-
fastapi>=0.115.12
7-
h11==0.14.0
6+
fastapi>=0.116.1
7+
h11<0.15.0
88
httpcore==0.16.3
9-
httpx==0.23.3
10-
idna==3.4
9+
httpx<0.29.0
10+
idna==3.10
1111
itsdangerous==2.1.2
1212
jinja2>=3.1.3
1313
orjson>=3.9.15

0 commit comments

Comments
 (0)