Skip to content

Commit

Permalink
fix ssm
Browse files Browse the repository at this point in the history
  • Loading branch information
arianvp committed Jun 1, 2024
1 parent 56b5f29 commit 8f53b7b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform.tfstate*
.direnv
.terraform
result
result*
cache.key
plan.out
.vscode
Expand Down
16 changes: 5 additions & 11 deletions deploy/instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,16 @@ resource "aws_instance" "web" {
}
}

locals {
flake = "github:arianvp/nixos-village#nixosConfigurations.web.config.system.build.toplevel"
}


resource "aws_ssm_association" "web" {
association_name = "web-deploy-hourly"
name = module.ssm_documents.nixos_deploy.name
association_name = "web-deploy"
name = module.ssm_documents.nixos_deploy.name
parameters = {
installable = local.flake
installable = "github:arianvp/nixos-village#nixosConfigurations.web.config.system.build.toplevel"
action = "switch"
}
targets {
key = "tag:Name"
values = ["web"]
}

# roll out updates every hour
schedule_expression = "rate(1 hour)"
schedule_expression = "rate(30 minutes)"
}
2 changes: 1 addition & 1 deletion deploy/modules/ssm_documents/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nixStorePath=$(/run/current-system/sw/bin/nix build \
--print-out-paths \
"$installable")

if [ "$action" == "boot" ] && [ "$(/run/current-system/sw/bin/readlink /run/current-system)" == "$(/run/current-system/sw/bin/readlink ./result)" ]; then
if [ "$(/run/current-system/sw/bin/readlink /run/current-system)" == "$(/run/current-system/sw/bin/readlink ./result)" ]; then
echo "Already booted into the desired configuration"
exit 0
fi
Expand Down
2 changes: 0 additions & 2 deletions nix/configs/web.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

services.getty.autologinUser = "root";

users.users.root.initialHashedPassword = "$y$j9T$sTq5/5v8FYMgdBNN8dWny0$wkGYT3Jv.UGxteor8V7CL99v6OFtHqqmrhEOGlYs.53";

# services.journald.console = "/dev/ttyS0";

networking.firewall.allowedTCPPorts = [ 80 443 ];
Expand Down

0 comments on commit 8f53b7b

Please sign in to comment.