-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into AG-1622-mixed-content-error
- Loading branch information
Showing
13 changed files
with
230 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @Sage-Bionetworks-IT/sagebio-it @Sage-Bionetworks-IT/infra-oversight-committee | ||
* @Sage-Bionetworks-IT/infra-oversight-committee @Sage-Bionetworks-IT/agora-admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: pr-check | ||
|
||
on: | ||
pull_request: | ||
branches: ['*'] | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yaml | ||
with: | ||
environment: dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
aws-cdk-lib~=2.139 | ||
aws-cdk-lib~=2.176 | ||
constructs~=10.0 | ||
boto3~=1.34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from aws_cdk import aws_ec2 as ec2 | ||
|
||
|
||
class DocdbProps: | ||
""" | ||
DocumentDB properties | ||
instance_type: What type of instance to start for the replicas | ||
master_username: The database admin account username | ||
port: The MongoDB port | ||
""" | ||
|
||
def __init__( | ||
self, instance_type: ec2.InstanceType, master_username: str, port: int | ||
) -> None: | ||
self.instance_type = instance_type | ||
self.master_username = master_username | ||
self.port = port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import aws_cdk as cdk | ||
from aws_cdk import ( | ||
aws_docdb as docdb, | ||
aws_ec2 as ec2, | ||
aws_secretsmanager as sm, | ||
) | ||
from src.docdb_props import DocdbProps | ||
|
||
from constructs import Construct | ||
|
||
|
||
class DocdbStack(cdk.Stack): | ||
""" | ||
DocumentDB cluster | ||
""" | ||
|
||
def __init__( | ||
self, | ||
scope: Construct, | ||
construct_id: str, | ||
vpc: ec2.Vpc, | ||
props: DocdbProps, | ||
**kwargs, | ||
) -> None: | ||
super().__init__(scope, construct_id, **kwargs) | ||
|
||
self.master_password_secret = sm.Secret( | ||
self, | ||
"DocDbMasterPassword", | ||
generate_secret_string=sm.SecretStringGenerator( | ||
password_length=32, exclude_punctuation=True | ||
), | ||
) | ||
|
||
cluster_parameter_group = docdb.ClusterParameterGroup( | ||
self, | ||
"DocDbClusterParameterGroup", | ||
family="docdb5.0", | ||
parameters={ | ||
"audit_logs": "disabled", | ||
"profiler": "enabled", | ||
"profiler_sampling_rate": "1.0", | ||
"profiler_threshold_ms": "50", | ||
"change_stream_log_retention_duration": "10800", | ||
"tls": "disabled", | ||
"ttl_monitor": "disabled", | ||
}, | ||
) | ||
|
||
# https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_docdb/DatabaseCluster.html | ||
self.cluster = docdb.DatabaseCluster( | ||
self, | ||
"DocDbCluster", | ||
master_user=docdb.Login( | ||
username=props.master_username, | ||
password=self.master_password_secret.secret_value, | ||
), | ||
instance_type=props.instance_type, | ||
vpc=vpc, | ||
vpc_subnets=ec2.SubnetSelection( | ||
subnet_type=ec2.SubnetType.PRIVATE_WITH_EGRESS | ||
), | ||
parameter_group=cluster_parameter_group, | ||
removal_policy=cdk.RemovalPolicy.DESTROY, | ||
storage_encrypted=True, | ||
preferred_maintenance_window="sat:06:54-sat:07:24", | ||
port=props.port, | ||
export_profiler_logs_to_cloud_watch=True, | ||
) |
Oops, something went wrong.