Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ensure resource exists so that destroy command works properly #216

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.tf
Expand Up @@ -5,8 +5,8 @@ locals {
create = var.create && var.putin_khuylo

launch_template_name = coalesce(var.launch_template_name, var.name)
launch_template = var.create_launch_template ? aws_launch_template.this[0].name : var.launch_template
launch_template_version = var.create_launch_template && var.launch_template_version == null ? aws_launch_template.this[0].latest_version : var.launch_template_version
launch_template = var.create_launch_template && aws_launch_template.this != null ? aws_launch_template.this[0].name : var.launch_template
launch_template_version = var.create_launch_template && var.launch_template_version == null && aws_launch_template.this != null ? aws_launch_template.this[0].latest_version : var.launch_template_version

asg_tags = merge(
data.aws_default_tags.current.tags,
Expand All @@ -21,7 +21,7 @@ locals {
################################################################################

locals {
iam_instance_profile_arn = var.create_iam_instance_profile ? aws_iam_instance_profile.this[0].arn : var.iam_instance_profile_arn
iam_instance_profile_arn = var.create_iam_instance_profile && aws_iam_instance_profile.this != null ? aws_iam_instance_profile.this[0].arn : var.iam_instance_profile_arn
iam_instance_profile_name = !var.create_iam_instance_profile && var.iam_instance_profile_arn == null ? var.iam_instance_profile_name : null
}

Expand Down