Skip to content

Commit

Permalink
update bitte-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
manveru committed Aug 13, 2020
1 parent b7e9e04 commit 89562f2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/terraform.nix
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ let

id = mkOption {
type = str;
default = id "aws_vpc.${this.config.name}";
default = id "data.aws_vpc.${this.config.name}";
};

region = mkOption { type = enum regions; };
Expand Down
5 changes: 5 additions & 0 deletions modules/terraform/clients.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ let
vpcs = pkgs.terralib.vpcs config.cluster;
in {
tf.clients.configuration = {
terraform.backend.remote = {
organization = "iohk-midnight";
workspaces = [{ prefix = "${config.cluster.name}_"; }];
};

output.cluster = {
value = {
flake = self.outPath;
Expand Down
5 changes: 5 additions & 0 deletions modules/terraform/consul.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{ config, lib, ... }: {
tf.consul.configuration = {
terraform.backend.remote = {
organization = "iohk-midnight";
workspaces = [{ prefix = "${config.cluster.name}_"; }];
};

provider.consul = {
address = "https://consul.${config.cluster.domain}";
datacenter = "eu-central-1";
Expand Down
22 changes: 22 additions & 0 deletions modules/terraform/core.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ in {
config = {
tf = {
core.configuration = {
terraform.backend.remote = {
organization = "iohk-midnight";
workspaces = [{ prefix = "${config.cluster.name}_"; }];
};

output.cluster = {
value = {
flake = self.outPath;
Expand Down Expand Up @@ -149,6 +154,23 @@ in {
# };
# };

data.aws_vpc = (lib.flip lib.mapAttrs' vpcs (region: vpc:
lib.nameValuePair vpc.name {
inherit (vpc) provider;
filter = {
name = "tag:Name";
values = [ vpc.name ];
};
})) // {
core = {
provider = awsProviderFor config.cluster.region;
filter = {
name = "tag:Name";
values = [ config.cluster.vpc.name ];
};
};
};

resource.aws_security_group = {
"${config.cluster.name}" = {
provider = awsProviderFor config.cluster.region;
Expand Down
1 change: 0 additions & 1 deletion modules/terraform/network.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ let
tags = { Cluster = config.cluster.name; };
in {
tf.network.configuration = {

terraform.backend.remote = {
organization = "iohk-midnight";
workspaces = [{ prefix = "${config.cluster.name}_"; }];
Expand Down

0 comments on commit 89562f2

Please sign in to comment.