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

chore: split backup-related variables #115

Merged
merged 8 commits into from
Nov 11, 2023
Merged

Conversation

ShotaroMatsuya
Copy link
Owner

@ShotaroMatsuya ShotaroMatsuya commented Nov 11, 2023

fixes #114

@ShotaroMatsuya ShotaroMatsuya self-assigned this Nov 11, 2023
Copy link

terraform/scheduling

Terraform Format and Style 🖌'No changes needed.'

Terraform Plan 📖failure

Show Plan
module.custom_lambda.module.user_action_filter_function.data.external.archive_prepare[0]: Reading...
module.custom_lambda.module.user_action_filter_function.data.external.archive_prepare[0]: Read complete after 0s [id=-]
data.aws_vpc.myvpc: Reading...
data.aws_iam_role.task_role: Reading...
data.aws_sns_topic.my_sns: Reading...
data.aws_iam_role.task_execution_role: Reading...
data.aws_security_group.fargate_sg: Reading...
module.custom_domain.data.aws_route53_zone.mydomain: Reading...
module.custom_lambda.module.user_action_filter_function.data.aws_iam_policy_document.assume_role[0]: Reading...
module.custom_lambda.module.user_action_filter_function.data.aws_iam_policy_document.assume_role[0]: Read complete after 0s [id=3693445097]
module.custom_lambda.module.user_action_filter_function.data.aws_partition.current: Reading...
module.custom_lambda.module.user_action_filter_function.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_iam_role.task_role: Read complete after 1s [id=ecs_tasks-minecraft-test-role]
data.aws_iam_role.task_execution_role: Read complete after 1s [id=minecraft-test-ecs_tasks_execution-role]
data.aws_sns_topic.my_sns: Read complete after 1s [id=arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic]
data.aws_security_group.fargate_sg: Read complete after 1s [id=sg-070f20f514ee0ff02]
module.custom_domain.data.aws_route53_zone.mydomain: Read complete after 1s [id=Z0885897H6FS59VX1SAQ]
data.aws_vpc.myvpc: Read complete after 2s [id=vpc-0ffb77d0cb3da78f0]
data.aws_subnets.my_subnets: Reading...
data.aws_subnets.my_subnets: Read complete after 0s [id=ap-northeast-1]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
 <= read (data resources)

Terraform planned the following actions, but then encountered a problem:

  # module.custom_cloudwatch.aws_cloudwatch_log_group.firelens will be created
  + resource "aws_cloudwatch_log_group" "firelens" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + name              = "/aws/ecs/minecraft-firelens-logs"
      + name_prefix       = (known after apply)
      + retention_in_days = 14
      + skip_destroy      = false
      + tags_all          = (known after apply)
    }

  # module.custom_cloudwatch.aws_cloudwatch_metric_alarm.target_group_health_check will be created
  + resource "aws_cloudwatch_metric_alarm" "target_group_health_check" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic",
        ]
      + alarm_description                     = "This metric monitors ecs health status"
      + alarm_name                            = "minecraft-test-targetgroup_healthy"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanThreshold"
      + dimensions                            = (known after apply)
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + metric_name                           = "HealthyHostCount"
      + namespace                             = "AWS/NetworkELB"
      + ok_actions                            = [
          + "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic",
        ]
      + period                                = 60
      + statistic                             = "Maximum"
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "breaching"
    }

  # module.custom_domain.aws_route53_record.apps_dns will be created
  + resource "aws_route53_record" "apps_dns" {
      + allow_overwrite = (known after apply)
      + fqdn            = (known after apply)
      + id              = (known after apply)
      + name            = "minecraft.smat710.tk"
      + type            = "A"
      + zone_id         = "Z0885897H6FS59VX1SAQ"

      + alias {
          + evaluate_target_health = true
          + name                   = (sensitive value)
          + zone_id                = (sensitive value)
        }
    }

  # module.custom_ecs.aws_ecs_cluster.main will be created
  + resource "aws_ecs_cluster" "main" {
      + arn                = (known after apply)
      + capacity_providers = (known after apply)
      + id                 = (known after apply)
      + name               = "minecraft-test-cluster"
      + tags               = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all           = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }

      + configuration {
          + execute_command_configuration {
              + logging = "DEFAULT"
            }
        }

      + setting {
          + name  = "containerInsights"
          + value = "enabled"
        }
    }

  # module.custom_lambda.aws_lambda_permission.log_permission will be created
  + resource "aws_lambda_permission" "log_permission" {
      + action              = "lambda:InvokeFunction"
      + function_name       = (known after apply)
      + id                  = (known after apply)
      + principal           = "logs.ap-northeast-1.amazonaws.com"
      + source_arn          = "arn:aws:logs:ap-northeast-1:528163014577:log-group:/aws/ecs/minecraft-firelens-logs:*"
      + statement_id        = (known after apply)
      + statement_id_prefix = (known after apply)
    }

  # module.custom_nlb.null_resource.send_slack_notification will be created
  + resource "null_resource" "send_slack_notification" {
      + id = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.data.aws_iam_policy_document.logs[0] will be read during apply
  # (config refers to values not yet known)
 <= data "aws_iam_policy_document" "logs" {
      + id   = (known after apply)
      + json = (known after apply)

      + statement {
          + actions   = [
              + "logs:CreateLogGroup",
              + "logs:CreateLogStream",
              + "logs:PutLogEvents",
            ]
          + effect    = "Allow"
          + resources = [
              + (known after apply),
              + (known after apply),
            ]
        }
    }

  # module.custom_lambda.module.user_action_filter_function.aws_cloudwatch_log_group.lambda[0] will be created
  + resource "aws_cloudwatch_log_group" "lambda" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + name              = "/aws/lambda/user-action-filter-function"
      + name_prefix       = (known after apply)
      + retention_in_days = 0
      + skip_destroy      = false
      + tags_all          = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_policy.additional_json[0] will be created
  + resource "aws_iam_policy" "additional_json" {
      + arn       = (known after apply)
      + id        = (known after apply)
      + name      = "user-action-filter-function"
      + path      = "/"
      + policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "SNS:Publish",
                        ]
                      + Effect   = "Allow"
                      + Resource = "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic"
                      + Sid      = ""
                    },
                  + {
                      + Action   = [
                          + "logs:CreateLogGroup",
                          + "logs:CreateLogStream",
                          + "logs:PutLogEvents",
                        ]
                      + Effect   = "Allow"
                      + Resource = "arn:aws:logs:ap-northeast-1:528163014577:log-group:/aws/ecs/minecraft-firelens-logs:*"
                      + Sid      = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + policy_id = (known after apply)
      + tags_all  = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_policy.logs[0] will be created
  + resource "aws_iam_policy" "logs" {
      + arn       = (known after apply)
      + id        = (known after apply)
      + name      = "user-action-filter-function-logs"
      + path      = "/"
      + policy    = (known after apply)
      + policy_id = (known after apply)
      + tags_all  = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_role.lambda[0] will be created
  + resource "aws_iam_role" "lambda" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "lambda.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = true
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "user-action-filter-function"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = (known after apply)
      + unique_id             = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_role_policy_attachment.additional_json[0] will be created
  + resource "aws_iam_role_policy_attachment" "additional_json" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "user-action-filter-function"
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_role_policy_attachment.logs[0] will be created
  + resource "aws_iam_role_policy_attachment" "logs" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "user-action-filter-function"
    }

  # module.custom_lambda.module.user_action_filter_function.aws_lambda_function.this[0] will be created
  + resource "aws_lambda_function" "this" {
      + architectures                  = [
          + "x86_64",
        ]
      + arn                            = (known after apply)
      + description                    = "My awsome lambda function"
      + filename                       = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.zip"
      + function_name                  = "user-action-filter-function"
      + handler                        = "index.lambda_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = true
      + qualified_arn                  = (known after apply)
      + qualified_invoke_arn           = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = (known after apply)
      + runtime                        = "python3.9"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + skip_destroy                   = false
      + source_code_hash               = (known after apply)
      + source_code_size               = (known after apply)
      + tags_all                       = (known after apply)
      + timeout                        = 360
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "ALARM_SUBJECT" = "【UserEvent Notification】"
              + "SNS_TOPIC_ARN" = "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic"
              + "WEB_HOOK_URL"  = (sensitive value)
            }
        }

      + ephemeral_storage {
          + size = 512
        }
    }

  # module.custom_lambda.module.user_action_filter_function.local_file.archive_plan[0] will be created
  + resource "local_file" "archive_plan" {
      + content              = jsonencode(
            {
              + artifacts_dir = "builds"
              + build_plan    = [
                  + [
                      + "zip",
                      + "../modules/lambda/fixtures/python3.9/index.py",
                      + null,
                    ],
                ]
              + filename      = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.zip"
              + runtime       = "python3.9"
            }
        )
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0755"
      + file_permission      = "0644"
      + filename             = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.plan.json"
      + id                   = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.null_resource.archive[0] will be created
  + resource "null_resource" "archive" {
      + id       = (known after apply)
      + triggers = {
          + "filename"  = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.zip"
          + "timestamp" = "1699667459640194000"
        }
    }

  # module.custom_nlb.module.nlb.aws_lb.this[0] will be created
  + resource "aws_lb" "this" {
      + arn                              = (known after apply)
      + arn_suffix                       = (known after apply)
      + dns_name                         = (known after apply)
      + enable_cross_zone_load_balancing = false
      + enable_deletion_protection       = false
      + id                               = (known after apply)
      + internal                         = false
      + ip_address_type                  = "ipv4"
      + load_balancer_type               = "network"
      + name                             = "minecraft-test-nlb"
      + security_groups                  = (known after apply)
      + subnets                          = [
          + "subnet-04c80e3888c2deeb8",
          + "subnet-0624da4bbf3bae8e3",
        ]
      + tags                             = {
          + "Name"        = "minecraft-test-nlb"
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all                         = {
          + "Name"        = "minecraft-test-nlb"
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + vpc_id                           = (known after apply)
      + zone_id                          = (known after apply)

      + timeouts {
          + create = "10m"
          + delete = "10m"
          + update = "10m"
        }
    }

  # module.custom_nlb.module.nlb.aws_lb_listener.frontend_http_tcp[0] will be created
  + resource "aws_lb_listener" "frontend_http_tcp" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + load_balancer_arn = (known after apply)
      + port              = 25565
      + protocol          = "TCP"
      + ssl_policy        = (known after apply)
      + tags              = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all          = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }

      + default_action {
          + order            = (known after apply)
          + target_group_arn = (known after apply)
          + type             = "forward"
        }
    }

  # module.custom_nlb.module.nlb.aws_lb_target_group.main[0] will be created
  + resource "aws_lb_target_group" "main" {
      + arn                                = (known after apply)
      + arn_suffix                         = (known after apply)
      + connection_termination             = false
      + deregistration_delay               = "10"
      + id                                 = (known after apply)
      + ip_address_type                    = (known after apply)
      + lambda_multi_value_headers_enabled = false
      + load_balancing_algorithm_type      = (known after apply)
      + load_balancing_cross_zone_enabled  = (known after apply)
      + name                               = (known after apply)
      + port                               = 25565
      + preserve_client_ip                 = (known after apply)
      + protocol                           = "TCP"
      + protocol_version                   = (known after apply)
      + proxy_protocol_v2                  = false
      + slow_start                         = 0
      + tags                               = {
          + "Name"        = ""
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all                           = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + target_type                        = "ip"
      + vpc_id                             = "vpc-0ffb77d0cb3da78f0"

      + health_check {
          + enabled             = true
          + healthy_threshold   = 2
          + interval            = 30
          + matcher             = (known after apply)
          + path                = (known after apply)
          + port                = "traffic-port"
          + protocol            = "TCP"
          + timeout             = 20
          + unhealthy_threshold = 2
        }
    }

Plan: 18 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + vpc_cidr_block = "10.0.0.0/16"
  + vpc_id         = "vpc-0ffb77d0cb3da78f0"

Copy link

terraform/scheduling

Terraform Format and Style 🖌'No changes needed.'

Terraform Plan 📖failure

Show Plan
module.custom_lambda.module.user_action_filter_function.data.external.archive_prepare[0]: Reading...
module.custom_lambda.module.user_action_filter_function.data.external.archive_prepare[0]: Read complete after 0s [id=-]
module.custom_domain.data.aws_route53_zone.mydomain: Reading...
data.aws_sns_topic.my_sns: Reading...
data.aws_iam_role.task_execution_role: Reading...
module.custom_lambda.module.user_action_filter_function.data.aws_iam_policy_document.assume_role[0]: Reading...
data.aws_security_group.fargate_sg: Reading...
data.aws_vpc.myvpc: Reading...
module.custom_lambda.module.user_action_filter_function.data.aws_partition.current: Reading...
module.custom_lambda.module.user_action_filter_function.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_iam_role.task_role: Reading...
module.custom_lambda.module.user_action_filter_function.data.aws_iam_policy_document.assume_role[0]: Read complete after 0s [id=3693445097]
data.aws_iam_role.task_role: Read complete after 0s [id=ecs_tasks-minecraft-test-role]
data.aws_iam_role.task_execution_role: Read complete after 0s [id=minecraft-test-ecs_tasks_execution-role]
data.aws_sns_topic.my_sns: Read complete after 0s [id=arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic]
data.aws_security_group.fargate_sg: Read complete after 1s [id=sg-070f20f514ee0ff02]
module.custom_domain.data.aws_route53_zone.mydomain: Read complete after 1s [id=Z0885897H6FS59VX1SAQ]
data.aws_vpc.myvpc: Read complete after 1s [id=vpc-0ffb77d0cb3da78f0]
data.aws_subnets.my_subnets: Reading...
data.aws_subnets.my_subnets: Read complete after 0s [id=ap-northeast-1]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
 <= read (data resources)

Terraform planned the following actions, but then encountered a problem:

  # module.custom_cloudwatch.aws_cloudwatch_log_group.firelens will be created
  + resource "aws_cloudwatch_log_group" "firelens" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + name              = "/aws/ecs/minecraft-firelens-logs"
      + name_prefix       = (known after apply)
      + retention_in_days = 14
      + skip_destroy      = false
      + tags_all          = (known after apply)
    }

  # module.custom_cloudwatch.aws_cloudwatch_metric_alarm.target_group_health_check will be created
  + resource "aws_cloudwatch_metric_alarm" "target_group_health_check" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic",
        ]
      + alarm_description                     = "This metric monitors ecs health status"
      + alarm_name                            = "minecraft-test-targetgroup_healthy"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanThreshold"
      + dimensions                            = (known after apply)
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + metric_name                           = "HealthyHostCount"
      + namespace                             = "AWS/NetworkELB"
      + ok_actions                            = [
          + "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic",
        ]
      + period                                = 60
      + statistic                             = "Maximum"
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "breaching"
    }

  # module.custom_domain.aws_route53_record.apps_dns will be created
  + resource "aws_route53_record" "apps_dns" {
      + allow_overwrite = (known after apply)
      + fqdn            = (known after apply)
      + id              = (known after apply)
      + name            = "minecraft.smat710.tk"
      + type            = "A"
      + zone_id         = "Z0885897H6FS59VX1SAQ"

      + alias {
          + evaluate_target_health = true
          + name                   = (sensitive value)
          + zone_id                = (sensitive value)
        }
    }

  # module.custom_ecs.aws_ecs_cluster.main will be created
  + resource "aws_ecs_cluster" "main" {
      + arn                = (known after apply)
      + capacity_providers = (known after apply)
      + id                 = (known after apply)
      + name               = "minecraft-test-cluster"
      + tags               = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all           = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }

      + configuration {
          + execute_command_configuration {
              + logging = "DEFAULT"
            }
        }

      + setting {
          + name  = "containerInsights"
          + value = "enabled"
        }
    }

  # module.custom_lambda.aws_lambda_permission.log_permission will be created
  + resource "aws_lambda_permission" "log_permission" {
      + action              = "lambda:InvokeFunction"
      + function_name       = (known after apply)
      + id                  = (known after apply)
      + principal           = "logs.ap-northeast-1.amazonaws.com"
      + source_arn          = "arn:aws:logs:ap-northeast-1:528163014577:log-group:/aws/ecs/minecraft-firelens-logs:*"
      + statement_id        = (known after apply)
      + statement_id_prefix = (known after apply)
    }

  # module.custom_nlb.null_resource.send_slack_notification will be created
  + resource "null_resource" "send_slack_notification" {
      + id = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.data.aws_iam_policy_document.logs[0] will be read during apply
  # (config refers to values not yet known)
 <= data "aws_iam_policy_document" "logs" {
      + id   = (known after apply)
      + json = (known after apply)

      + statement {
          + actions   = [
              + "logs:CreateLogGroup",
              + "logs:CreateLogStream",
              + "logs:PutLogEvents",
            ]
          + effect    = "Allow"
          + resources = [
              + (known after apply),
              + (known after apply),
            ]
        }
    }

  # module.custom_lambda.module.user_action_filter_function.aws_cloudwatch_log_group.lambda[0] will be created
  + resource "aws_cloudwatch_log_group" "lambda" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + name              = "/aws/lambda/user-action-filter-function"
      + name_prefix       = (known after apply)
      + retention_in_days = 0
      + skip_destroy      = false
      + tags_all          = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_policy.additional_json[0] will be created
  + resource "aws_iam_policy" "additional_json" {
      + arn       = (known after apply)
      + id        = (known after apply)
      + name      = "user-action-filter-function"
      + path      = "/"
      + policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "SNS:Publish",
                        ]
                      + Effect   = "Allow"
                      + Resource = "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic"
                      + Sid      = ""
                    },
                  + {
                      + Action   = [
                          + "logs:CreateLogGroup",
                          + "logs:CreateLogStream",
                          + "logs:PutLogEvents",
                        ]
                      + Effect   = "Allow"
                      + Resource = "arn:aws:logs:ap-northeast-1:528163014577:log-group:/aws/ecs/minecraft-firelens-logs:*"
                      + Sid      = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + policy_id = (known after apply)
      + tags_all  = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_policy.logs[0] will be created
  + resource "aws_iam_policy" "logs" {
      + arn       = (known after apply)
      + id        = (known after apply)
      + name      = "user-action-filter-function-logs"
      + path      = "/"
      + policy    = (known after apply)
      + policy_id = (known after apply)
      + tags_all  = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_role.lambda[0] will be created
  + resource "aws_iam_role" "lambda" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "lambda.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = true
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "user-action-filter-function"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = (known after apply)
      + unique_id             = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_role_policy_attachment.additional_json[0] will be created
  + resource "aws_iam_role_policy_attachment" "additional_json" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "user-action-filter-function"
    }

  # module.custom_lambda.module.user_action_filter_function.aws_iam_role_policy_attachment.logs[0] will be created
  + resource "aws_iam_role_policy_attachment" "logs" {
      + id         = (known after apply)
      + policy_arn = (known after apply)
      + role       = "user-action-filter-function"
    }

  # module.custom_lambda.module.user_action_filter_function.aws_lambda_function.this[0] will be created
  + resource "aws_lambda_function" "this" {
      + architectures                  = [
          + "x86_64",
        ]
      + arn                            = (known after apply)
      + description                    = "My awsome lambda function"
      + filename                       = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.zip"
      + function_name                  = "user-action-filter-function"
      + handler                        = "index.lambda_handler"
      + id                             = (known after apply)
      + invoke_arn                     = (known after apply)
      + last_modified                  = (known after apply)
      + memory_size                    = 128
      + package_type                   = "Zip"
      + publish                        = true
      + qualified_arn                  = (known after apply)
      + qualified_invoke_arn           = (known after apply)
      + reserved_concurrent_executions = -1
      + role                           = (known after apply)
      + runtime                        = "python3.9"
      + signing_job_arn                = (known after apply)
      + signing_profile_version_arn    = (known after apply)
      + skip_destroy                   = false
      + source_code_hash               = (known after apply)
      + source_code_size               = (known after apply)
      + tags_all                       = (known after apply)
      + timeout                        = 360
      + version                        = (known after apply)

      + environment {
          + variables = {
              + "ALARM_SUBJECT" = "【UserEvent Notification】"
              + "SNS_TOPIC_ARN" = "arn:aws:sns:ap-northeast-1:528163014577:minecraft-test-sns-topic"
              + "WEB_HOOK_URL"  = (sensitive value)
            }
        }

      + ephemeral_storage {
          + size = 512
        }
    }

  # module.custom_lambda.module.user_action_filter_function.local_file.archive_plan[0] will be created
  + resource "local_file" "archive_plan" {
      + content              = jsonencode(
            {
              + artifacts_dir = "builds"
              + build_plan    = [
                  + [
                      + "zip",
                      + "../modules/lambda/fixtures/python3.9/index.py",
                      + null,
                    ],
                ]
              + filename      = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.zip"
              + runtime       = "python3.9"
            }
        )
      + content_base64sha256 = (known after apply)
      + content_base64sha512 = (known after apply)
      + content_md5          = (known after apply)
      + content_sha1         = (known after apply)
      + content_sha256       = (known after apply)
      + content_sha512       = (known after apply)
      + directory_permission = "0755"
      + file_permission      = "0644"
      + filename             = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.plan.json"
      + id                   = (known after apply)
    }

  # module.custom_lambda.module.user_action_filter_function.null_resource.archive[0] will be created
  + resource "null_resource" "archive" {
      + id       = (known after apply)
      + triggers = {
          + "filename"  = "builds/ea96dc4de2016fe5f3b29c4e5952cf7ed9f0d78b607e635369a8cb31b68e76c8.zip"
          + "timestamp" = "1699667730015261000"
        }
    }

  # module.custom_nlb.module.nlb.aws_lb.this[0] will be created
  + resource "aws_lb" "this" {
      + arn                              = (known after apply)
      + arn_suffix                       = (known after apply)
      + dns_name                         = (known after apply)
      + enable_cross_zone_load_balancing = false
      + enable_deletion_protection       = false
      + id                               = (known after apply)
      + internal                         = false
      + ip_address_type                  = "ipv4"
      + load_balancer_type               = "network"
      + name                             = "minecraft-test-nlb"
      + security_groups                  = (known after apply)
      + subnets                          = [
          + "subnet-04c80e3888c2deeb8",
          + "subnet-0624da4bbf3bae8e3",
        ]
      + tags                             = {
          + "Name"        = "minecraft-test-nlb"
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all                         = {
          + "Name"        = "minecraft-test-nlb"
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + vpc_id                           = (known after apply)
      + zone_id                          = (known after apply)

      + timeouts {
          + create = "10m"
          + delete = "10m"
          + update = "10m"
        }
    }

  # module.custom_nlb.module.nlb.aws_lb_listener.frontend_http_tcp[0] will be created
  + resource "aws_lb_listener" "frontend_http_tcp" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + load_balancer_arn = (known after apply)
      + port              = 25565
      + protocol          = "TCP"
      + ssl_policy        = (known after apply)
      + tags              = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all          = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }

      + default_action {
          + order            = (known after apply)
          + target_group_arn = (known after apply)
          + type             = "forward"
        }
    }

  # module.custom_nlb.module.nlb.aws_lb_target_group.main[0] will be created
  + resource "aws_lb_target_group" "main" {
      + arn                                = (known after apply)
      + arn_suffix                         = (known after apply)
      + connection_termination             = false
      + deregistration_delay               = "10"
      + id                                 = (known after apply)
      + ip_address_type                    = (known after apply)
      + lambda_multi_value_headers_enabled = false
      + load_balancing_algorithm_type      = (known after apply)
      + load_balancing_cross_zone_enabled  = (known after apply)
      + name                               = (known after apply)
      + port                               = 25565
      + preserve_client_ip                 = (known after apply)
      + protocol                           = "TCP"
      + protocol_version                   = (known after apply)
      + proxy_protocol_v2                  = false
      + slow_start                         = 0
      + tags                               = {
          + "Name"        = ""
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + tags_all                           = {
          + "environment" = "test"
          + "owners"      = "minecraft"
        }
      + target_type                        = "ip"
      + vpc_id                             = "vpc-0ffb77d0cb3da78f0"

      + health_check {
          + enabled             = true
          + healthy_threshold   = 2
          + interval            = 30
          + matcher             = (known after apply)
          + path                = (known after apply)
          + port                = "traffic-port"
          + protocol            = "TCP"
          + timeout             = 20
          + unhealthy_threshold = 2
        }
    }

Plan: 18 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + vpc_cidr_block = "10.0.0.0/16"
  + vpc_id         = "vpc-0ffb77d0cb3da78f0"

@ShotaroMatsuya ShotaroMatsuya merged commit f24fd2b into main Nov 11, 2023
5 checks passed
@ShotaroMatsuya ShotaroMatsuya deleted the ShotaroMatsuya/issue114 branch November 19, 2023 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECSタスク定義の環境変数に配列を指定できないためapply失敗している
1 participant