Skip to content

Commit

Permalink
Added CfnOutput for NAT gateway IPs. Revised stack names in FjordApp.…
Browse files Browse the repository at this point in the history
…js to allow deployment of multiple servers on a single ECS cluster and the deployment of multiple ECS clusters.
  • Loading branch information
J-SophieCodes committed Aug 26, 2021
1 parent 2fe7ccc commit fb1c280
Show file tree
Hide file tree
Showing 5 changed files with 10,690 additions and 2,155 deletions.
4 changes: 2 additions & 2 deletions FjordSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Fjord App",
"name": "ShoppingApp",
"server": {
"NAME": "Fjord-Server",
"NAME": "APIs",
"JWT_KEY": "",
"API_TOPICS": "orders shipments",
"SEC_PER_PULSE": "30"
Expand Down
4 changes: 2 additions & 2 deletions lib/FjordApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class FjordApp extends cdk.App {
constructor() {
super();

const shared = new SharedResources(this, "fjord-shared");
const server = new Server(this, "fjord-server", {
const shared = new SharedResources(this, "fjord-shared-" + SETTINGS.name);
const server = new Server(this, "fjord-server-" + SETTINGS.server.NAME, {
SERVER: SETTINGS.server,
CLUSTER: shared.cluster,
REDIS: shared.redis
Expand Down
5 changes: 5 additions & 0 deletions lib/sharedResources.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class SharedResources extends cdk.Stack {
maxAzs: 2 // Default is all AZs in region
});

this.vpc.publicSubnets.forEach((subnet, index) => {
const EIP = subnet.node.tryFindChild('EIP');
new cdk.CfnOutput(this, `NAT Gateway ${index+1} - IP:`, { value: EIP.ref });
})

this.cluster = new ecs.Cluster(this, "fjord-cluster", {
vpc: this.vpc
});
Expand Down

0 comments on commit fb1c280

Please sign in to comment.