diff --git a/.envrc b/.envrc index 47d28b4..7e06b10 100644 --- a/.envrc +++ b/.envrc @@ -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 diff --git a/modules/security_group/main.tf b/modules/security_group/main.tf index c35bedf..c2ad38b 100644 --- a/modules/security_group/main.tf +++ b/modules/security_group/main.tf @@ -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 diff --git a/modules/security_group/outputs.tf b/modules/security_group/outputs.tf index 02c64ae..617fafb 100644 --- a/modules/security_group/outputs.tf +++ b/modules/security_group/outputs.tf @@ -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]) } \ No newline at end of file diff --git a/outputs.tf b/outputs.tf index e6ba8c6..12bbe1b 100644 --- a/outputs.tf +++ b/outputs.tf @@ -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 }