fix nix flake, add security_group_name which matches the tag rather than the attribute

Signed-off-by: matttrach <matttrach@gmail.com>
This commit is contained in:
matttrach 2023-08-25 11:42:28 -05:00
parent 4d5aa9db7b
commit 618f61c80e
No known key found for this signature in database
GPG Key ID: C00467FDE2D0231F
4 changed files with 10 additions and 4 deletions

4
.envrc
View File

@ -1,6 +1,4 @@
IS_NIX_SHELL=$(echo "$SHELL" | grep 'nix')
if [ -z "${IS_NIX_SHELL}" ]; then
if [ -z "${name}" ]; then
echo "entering dev environment..."
nix develop . --extra-experimental-features nix-command --extra-experimental-features flakes

View File

@ -18,7 +18,8 @@ data "aws_security_group" "selected" {
resource "aws_security_group" "new" {
count = local.create
description = "security group for single person"
description = "${local.type} security group generated by aws_access module"
name = local.name
tags = {
Name = local.name
Owner = local.owner

View File

@ -1,6 +1,9 @@
output "id" {
value = (local.select == 1 ? data.aws_security_group.selected[0].id : aws_security_group.new[0].id)
}
output "name" {
value = (local.select == 1 ? data.aws_security_group.selected[0].tags.Name : aws_security_group.new[0].tags.Name)
}
output "security_group" {
value = (local.select == 1 ? data.aws_security_group.selected[0] : aws_security_group.new[0])
}

View File

@ -14,6 +14,10 @@ output "security_group" {
value = module.security_group.security_group
}
output "security_group_name" {
value = module.security_group.name
}
output "ssh_key" {
value = module.ssh_key.ssh_key
}