Skip to content

Commit

Permalink
cross(tf): remove unused outputs
Browse files Browse the repository at this point in the history
- Latest verion of bitte cli does not consume any outputs anymore
- Do other tf workspaces consume core outputs?
  • Loading branch information
blaggacao committed Nov 8, 2021
1 parent 55a7849 commit 8c49df4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
21 changes: 0 additions & 21 deletions modules/terraform/clients.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,6 @@ in {

terraform.required_providers = pkgs.terraform-provider-versions;

output.cluster = {
value = {
# Consumed by bitte cli
# TODO: this is declarative & static and could be consumed directly
# from the nix evaluation. For historic reasons & practicality, this
# was consumed out of the tf state.
s3-cache = config.cluster.s3Cache;
asgs = lib.flip lib.mapAttrs config.cluster.autoscalingGroups
(name: group: {
flake-attr =
"nixosConfigurations.${group.uid}.config.system.build.toplevel";
instance-type =
var "aws_launch_configuration.${group.uid}.instance_type";
uid = group.uid;
arn = var "aws_autoscaling_group.${group.uid}.arn";
region = group.region;
count = group.desiredCapacity;
});
};
};

provider.aws = [{ region = config.cluster.region; }] ++ (lib.forEach regions
(region: {
inherit region;
Expand Down
27 changes: 0 additions & 27 deletions modules/terraform/core.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,6 @@ in {

terraform.required_providers = pkgs.terraform-provider-versions;

output.cluster = {
value = {
flake = toString config.cluster.flakePath;
kms = config.cluster.kms;
name = config.cluster.name;
nix = pkgs.nixFlakes;
region = config.cluster.region;
s3-bucket = config.cluster.s3Bucket;
s3-cache = config.cluster.s3Cache;

roles = lib.flip lib.mapAttrs config.cluster.iam.roles
(name: role: { arn = var "aws_iam_role.${role.uid}.arn"; });

instances = lib.flip lib.mapAttrs config.cluster.instances
(name: server: {
flake-attr =
"nixosConfigurations.${server.uid}.config.system.build.toplevel";
instance-type = var "aws_instance.${server.name}.instance_type";
name = server.name;
private-ip = var "aws_instance.${server.name}.private_ip";
public-ip = var "aws_instance.${server.name}.public_ip";
tags = server.tags;
uid = server.uid;
});
};
};

provider = {
acme = {
server_url = "https://acme-v02.api.letsencrypt.org/directory";
Expand Down

0 comments on commit 8c49df4

Please sign in to comment.