Skip to content

Commit

Permalink
fix: refactor constructs
Browse files Browse the repository at this point in the history
  • Loading branch information
briancaffey committed Jun 9, 2021
1 parent d0ee936 commit 0f3c3ed
Show file tree
Hide file tree
Showing 8 changed files with 304 additions and 163 deletions.
24 changes: 12 additions & 12 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@

Name|Description
----|-----------
[DjangoCdk](#django-cdk-djangocdk)|*No description*
[DjangoEks](#django-cdk-djangoeks)|*No description*
[DjangoEcs](#django-cdk-djangoecs)|Configures a Django project using ECS Fargate.
[DjangoEks](#django-cdk-djangoeks)|Configures a Django project using EKS.


**Structs**

Name|Description
----|-----------
[DjangoCdkProps](#django-cdk-djangocdkprops)|*No description*
[DjangoEksProps](#django-cdk-djangoeksprops)|*No description*
[DjangoEcsProps](#django-cdk-djangoecsprops)|Options to configure a Django ECS project.
[DjangoEksProps](#django-cdk-djangoeksprops)|Options to configure a Django EKS project.



## class DjangoCdk <a id="django-cdk-djangocdk"></a>

## class DjangoEcs <a id="django-cdk-djangoecs"></a>

Configures a Django project using ECS Fargate.

__Implements__: [IConstruct](#constructs-iconstruct), [IConstruct](#aws-cdk-core-iconstruct), [IConstruct](#constructs-iconstruct), [IDependable](#aws-cdk-core-idependable)
__Extends__: [Construct](#aws-cdk-core-construct)
Expand All @@ -30,12 +30,12 @@ __Extends__: [Construct](#aws-cdk-core-construct)


```ts
new DjangoCdk(scope: Construct, id: string, props: DjangoCdkProps)
new DjangoEcs(scope: Construct, id: string, props: DjangoEcsProps)
```

* **scope** (<code>[Construct](#aws-cdk-core-construct)</code>) *No description*
* **id** (<code>string</code>) *No description*
* **props** (<code>[DjangoCdkProps](#django-cdk-djangocdkprops)</code>) *No description*
* **props** (<code>[DjangoEcsProps](#django-cdk-djangoecsprops)</code>) *No description*
* **imageDirectory** (<code>string</code>) The location of the Dockerfile used to create the main application image.
* **bucketName** (<code>string</code>) Name of existing bucket to use for media files. __*Optional*__
* **useCeleryBeat** (<code>boolean</code>) Used to enable the celery beat service. __*Default*__: false
Expand All @@ -58,7 +58,7 @@ Name | Type | Description

## class DjangoEks <a id="django-cdk-djangoeks"></a>


Configures a Django project using EKS.

__Implements__: [IConstruct](#constructs-iconstruct), [IConstruct](#aws-cdk-core-iconstruct), [IConstruct](#constructs-iconstruct), [IDependable](#aws-cdk-core-idependable)
__Extends__: [Construct](#aws-cdk-core-construct)
Expand Down Expand Up @@ -94,10 +94,10 @@ Name | Type | Description



## struct DjangoCdkProps <a id="django-cdk-djangocdkprops"></a>

## struct DjangoEcsProps <a id="django-cdk-djangoecsprops"></a>


Options to configure a Django ECS project.



Expand All @@ -114,7 +114,7 @@ Name | Type | Description
## struct DjangoEksProps <a id="django-cdk-djangoeksprops"></a>



Options to configure a Django EKS project.



Expand Down
77 changes: 76 additions & 1 deletion cdk.context.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,80 @@
"us-east-1d",
"us-east-1e",
"us-east-1f"
]
],
"load-balancer:account=733623710918:loadBalancerTags.0.key=Environment:loadBalancerTags.0.value=test:loadBalancerType=application:region=us-east-1": {
"loadBalancerArn": "arn:aws:elasticloadbalancing:us-east-1:733623710918:loadbalancer/app/k8s-app-appingre-a5bb1f9208/c8c2d842ab565650",
"loadBalancerCanonicalHostedZoneId": "Z35SXDOTRQ7X7K",
"loadBalancerDnsName": "k8s-app-appingre-a5bb1f9208-1217069225.us-east-1.elb.amazonaws.com",
"vpcId": "vpc-08b5e4b490e169443",
"securityGroupIds": [
"sg-0b18d301c815cd8b5"
],
"ipAddressType": "ipv4"
},
"vpc-provider:account=733623710918:filter.vpc-id=vpc-08b5e4b490e169443:region=us-east-1:returnAsymmetricSubnets=true": {
"vpcId": "vpc-08b5e4b490e169443",
"vpcCidrBlock": "10.0.0.0/16",
"availabilityZones": [],
"subnetGroups": [
{
"name": "ingress",
"type": "Public",
"subnets": [
{
"subnetId": "subnet-044de5f080e540664",
"cidr": "10.0.0.0/24",
"availabilityZone": "us-east-1a",
"routeTableId": "rtb-06447e66ba447ddfc"
},
{
"subnetId": "subnet-08f7a0bed16fab24b",
"cidr": "10.0.1.0/24",
"availabilityZone": "us-east-1b",
"routeTableId": "rtb-08a0586ed339f8579"
}
]
},
{
"name": "rds",
"type": "Isolated",
"subnets": [
{
"subnetId": "subnet-0f214b88435bd593f",
"cidr": "10.0.4.0/28",
"availabilityZone": "us-east-1a",
"routeTableId": "rtb-08843aa4e5e0088db"
},
{
"subnetId": "subnet-0a6713a44cfd3565b",
"cidr": "10.0.4.16/28",
"availabilityZone": "us-east-1b",
"routeTableId": "rtb-0ad2401a3239f765f"
}
]
},
{
"name": "application",
"type": "Private",
"subnets": [
{
"subnetId": "subnet-09d4a41e23683ec31",
"cidr": "10.0.2.0/24",
"availabilityZone": "us-east-1a",
"routeTableId": "rtb-03bf68d16656c3310"
},
{
"subnetId": "subnet-0f8040c2ce9ce7d3e",
"cidr": "10.0.3.0/24",
"availabilityZone": "us-east-1b",
"routeTableId": "rtb-0fe16e76311a407a1"
}
]
}
]
},
"security-group:account=733623710918:region=us-east-1:securityGroupId=sg-0b18d301c815cd8b5": {
"securityGroupId": "sg-0b18d301c815cd8b5",
"allowAllOutbound": false
}
}
6 changes: 3 additions & 3 deletions src/django-ecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import * as logs from '@aws-cdk/aws-logs';
import * as s3 from '@aws-cdk/aws-s3';
import * as secretsmanager from '@aws-cdk/aws-secretsmanager';
import * as cdk from '@aws-cdk/core';
import { CeleryBeat } from './ecs/celery/beat';
import { CeleryWorker } from './ecs/celery/worker';
import { RdsPostgresInstance } from './common/database';
import { ElastiCacheCluster } from './common/elasticache';
import { managementCommandTask } from './ecs/tasks';
import { ApplicationVpc } from './common/vpc';
import { CeleryBeat } from './ecs/celery/beat';
import { CeleryWorker } from './ecs/celery/worker';
import { managementCommandTask } from './ecs/tasks';


/**
Expand Down
Loading

0 comments on commit 0f3c3ed

Please sign in to comment.