Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
environment tag
Browse files Browse the repository at this point in the history
  • Loading branch information
disassembler committed Feb 16, 2019
1 parent 421e902 commit 16d6434
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions deployments/adapay-aws-production.nix
Expand Up @@ -21,6 +21,7 @@ in {
resources.ec2SecurityGroups.adapaySG.name
resources.ec2SecurityGroups.adapaySGimporter.name
];
tags = { inherit environment; };
};
targetEnv = "ec2";
route53 = {
Expand All @@ -47,6 +48,7 @@ in {
resources.ec2SecurityGroups.adapaySG.name
resources.ec2SecurityGroups.adapaySGadapay.name
];
tags = { inherit environment; };
};
targetEnv = "ec2";
route53 = {
Expand Down Expand Up @@ -74,6 +76,7 @@ in {
resources.ec2SecurityGroups.adapaySG.name
resources.ec2SecurityGroups.adapaySGnginx.name
];
tags = { inherit environment; };
};
targetEnv = "ec2";
route53 = {
Expand All @@ -89,9 +92,11 @@ in {
elasticIPs.adapayIP = {
inherit accessKeyId region;
vpc = true;
tags = { inherit environment; };
};
ec2KeyPairs.adapayKey = {
inherit accessKeyId region;
tags = { inherit environment; };
};
ec2SecurityGroups = let
allowPortSource = source: port: {
Expand All @@ -106,55 +111,65 @@ in {
inherit accessKeyId region;
vpcId = resources.vpc.adapayVPC;
rules = map allowPortPublic [ 22 ];
tags = { inherit environment; };
};
adapaySGnginx = { resources, ... }: {
inherit accessKeyId region;
vpcId = resources.vpc.adapayVPC;
rules = map allowPortPublic [ 80 443 ];
tags = { inherit environment; };
};
adapaySGimporter = { resources, ... }: {
inherit accessKeyId region;
vpcId = resources.vpc.adapayVPC;
rules = [ (allowPortVPC 8200) ];
tags = { inherit environment; };
};
adapaySGadapay = { resources, ... }: {
inherit accessKeyId region;
vpcId = resources.vpc.adapayVPC;
rules = [ (allowPortVPC 8081) ];
tags = { inherit environment; };
};
};
vpc.adapayVPC = {
inherit accessKeyId region;
enableDnsSupport = true;
cidrBlock = "10.0.0.0/16";
tags = { inherit environment; };
};
vpcSubnets.adapayVPCSubnet = { resources, ... }: {
inherit accessKeyId region zone;
cidrBlock = "10.0.1.0/24";
vpcId = resources.vpc.adapayVPC;
mapPublicIpOnLaunch = true;
tags = { inherit environment; };
};
vpcInternetGateways.adapayIGW = { resources, ... }: {
inherit region accessKeyId;
vpcId = resources.vpc.adapayVPC;
tags = { inherit environment; };
};

vpcRouteTables.adapayRouteTable = { resources, ... }: {
inherit region accessKeyId;
vpcId = resources.vpc.adapayVPC;
tags = { inherit environment; };
};

vpcRouteTableAssociations.adapayAssociation = { resources, ... }: {
inherit region accessKeyId;
subnetId = resources.vpcSubnets.adapayVPCSubnet;
routeTableId = resources.vpcRouteTables.adapayRouteTable;
tags = { inherit environment; };
};

vpcRoutes.adapayIGWRoute = { resources, ... }: {
inherit region accessKeyId;
routeTableId = resources.vpcRouteTables.adapayRouteTable;
destinationCidrBlock = "0.0.0.0/0";
gatewayId = resources.vpcInternetGateways.adapayIGW;
tags = { inherit environment; };
};
};
}

0 comments on commit 16d6434

Please sign in to comment.