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

Updating logic for plan action and adding module validation #73

Merged
merged 14 commits into from
May 30, 2024

Conversation

chelseybeck
Copy link
Member

Fixes #72

Changes made

  • removed job to run a plan for changed modules and replaced with a validation when modules are added without corresponding configurations
  • updated logic to allow a plan on a project change or environment change but not both simultaneously

Copy link

Terraform plan in terraform-incubator/people-depot/dev

Plan: 11 to add, 0 to change, 9 to destroy, 1 to move. Changes to Outputs.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+   create
-   destroy

Terraform will perform the following actions:

  # aws_appautoscaling_policy.ecs_autoscale_cpu will be destroyed
  # (because aws_appautoscaling_policy.ecs_autoscale_cpu is not in configuration)
-   resource "aws_appautoscaling_policy" "ecs_autoscale_cpu" {
-       alarm_arns         = [
-           "arn:aws:cloudwatch:us-west-2:035866691871:alarm:TargetTracking-service/incubator-prod/people-depot-backend-dev-AlarmHigh-400240ef-055f-4b10-b735-6542fd7c6dee",
-           "arn:aws:cloudwatch:us-west-2:035866691871:alarm:TargetTracking-service/incubator-prod/people-depot-backend-dev-AlarmLow-97101a5b-b9f1-4417-920e-555af308c2aa",
        ] -> null
-       arn                = "arn:aws:autoscaling:us-west-2:035866691871:scalingPolicy:339820cc-9009-4453-86c5-3432afed2643:resource/ecs/service/incubator-prod/people-depot-backend-dev:policyName/ecs_autoscale_cpu" -> null
-       id                 = "ecs_autoscale_cpu" -> null
-       name               = "ecs_autoscale_cpu" -> null
-       policy_type        = "TargetTrackingScaling" -> null
-       resource_id        = "service/incubator-prod/people-depot-backend-dev" -> null
-       scalable_dimension = "ecs:service:DesiredCount" -> null
-       service_namespace  = "ecs" -> null

-       target_tracking_scaling_policy_configuration {
-           disable_scale_in   = false -> null
-           scale_in_cooldown  = 0 -> null
-           scale_out_cooldown = 0 -> null
-           target_value       = 60 -> null

-           predefined_metric_specification {
-               predefined_metric_type = "ECSServiceAverageCPUUtilization" -> null
            }
        }
    }

  # aws_appautoscaling_policy.ecs_autoscale_memory will be destroyed
  # (because aws_appautoscaling_policy.ecs_autoscale_memory is not in configuration)
-   resource "aws_appautoscaling_policy" "ecs_autoscale_memory" {
-       alarm_arns         = [
-           "arn:aws:cloudwatch:us-west-2:035866691871:alarm:TargetTracking-service/incubator-prod/people-depot-backend-dev-AlarmHigh-00cd01aa-d7f0-4046-8746-ff302e13b8a5",
-           "arn:aws:cloudwatch:us-west-2:035866691871:alarm:TargetTracking-service/incubator-prod/people-depot-backend-dev-AlarmLow-fa1b4205-e7fb-4bfe-8d35-4f1cfff340c3",
        ] -> null
-       arn                = "arn:aws:autoscaling:us-west-2:035866691871:scalingPolicy:339820cc-9009-4453-86c5-3432afed2643:resource/ecs/service/incubator-prod/people-depot-backend-dev:policyName/ecs_autoscale_memory" -> null
-       id                 = "ecs_autoscale_memory" -> null
-       name               = "ecs_autoscale_memory" -> null
-       policy_type        = "TargetTrackingScaling" -> null
-       resource_id        = "service/incubator-prod/people-depot-backend-dev" -> null
-       scalable_dimension = "ecs:service:DesiredCount" -> null
-       service_namespace  = "ecs" -> null

-       target_tracking_scaling_policy_configuration {
-           disable_scale_in   = false -> null
-           scale_in_cooldown  = 0 -> null
-           scale_out_cooldown = 0 -> null
-           target_value       = 80 -> null

-           predefined_metric_specification {
-               predefined_metric_type = "ECSServiceAverageMemoryUtilization" -> null
            }
        }
    }

  # aws_appautoscaling_target.ecs_target will be destroyed
  # (because aws_appautoscaling_target.ecs_target is not in configuration)
-   resource "aws_appautoscaling_target" "ecs_target" {
-       arn                = "arn:aws:application-autoscaling:us-west-2:035866691871:scalable-target/0ec5339820cc9009445386c53432afed2643" -> null
-       id                 = "service/incubator-prod/people-depot-backend-dev" -> null
-       max_capacity       = 4 -> null
-       min_capacity       = 1 -> null
-       resource_id        = "service/incubator-prod/people-depot-backend-dev" -> null
-       role_arn           = "arn:aws:iam::035866691871:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService" -> null
-       scalable_dimension = "ecs:service:DesiredCount" -> null
-       service_namespace  = "ecs" -> null
-       tags               = {} -> null
-       tags_all           = {} -> null
    }

  # aws_cloudwatch_log_group.cwlogs will be destroyed
  # (because aws_cloudwatch_log_group.cwlogs is not in configuration)
-   resource "aws_cloudwatch_log_group" "cwlogs" {
-       arn               = "arn:aws:logs:us-west-2:035866691871:log-group:ecs/people-depot-backend-dev" -> null
-       id                = "ecs/people-depot-backend-dev" -> null
-       log_group_class   = "STANDARD" -> null
-       name              = "ecs/people-depot-backend-dev" -> null
-       retention_in_days = 14 -> null
-       skip_destroy      = false -> null
-       tags              = {} -> null
-       tags_all          = {} -> null
    }

  # aws_ecs_service.fargate[0] will be destroyed
  # (because aws_ecs_service.fargate is not in configuration)
-   resource "aws_ecs_service" "fargate" {
-       cluster                            = "arn:aws:ecs:us-west-2:035866691871:cluster/incubator-prod" -> null
-       deployment_maximum_percent         = 200 -> null
-       deployment_minimum_healthy_percent = 100 -> null
-       desired_count                      = 1 -> null
-       enable_ecs_managed_tags            = false -> null
-       enable_execute_command             = true -> null
-       health_check_grace_period_seconds  = 0 -> null
-       iam_role                           = "/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS" -> null
-       id                                 = "arn:aws:ecs:us-west-2:035866691871:service/incubator-prod/people-depot-backend-dev" -> null
-       launch_type                        = "FARGATE" -> null
-       name                               = "people-depot-backend-dev" -> null
-       platform_version                   = "LATEST" -> null
-       propagate_tags                     = "NONE" -> null
-       scheduling_strategy                = "REPLICA" -> null
-       tags                               = {} -> null
-       tags_all                           = {} -> null
-       task_definition                    = "arn:aws:ecs:us-west-2:035866691871:task-definition/people-depot-backend-dev:7" -> null
-       triggers                           = {} -> null
-       wait_for_steady_state              = false -> null

-       deployment_circuit_breaker {
-           enable   = false -> null
-           rollback = false -> null
        }

-       deployment_controller {
-           type = "ECS" -> null
        }

-       load_balancer {
-           container_name   = "people-depot-backend-dev" -> null
-           container_port   = 8000 -> null
-           target_group_arn = "arn:aws:elasticloadbalancing:us-west-2:035866691871:targetgroup/people-depot-backend-dev/6603e421d89b235f" -> null
        }

-       network_configuration {
-           assign_public_ip = true -> null
-           security_groups  = [
-               "sg-08832fecdee2cee14",
            ] -> null
-           subnets          = [
-               "subnet-03202f3bf9a24c1a5",
-               "subnet-08c26edd1afc2b9d7",
            ] -> null
        }
    }

  # aws_ecs_task_definition.task will be destroyed
  # (because aws_ecs_task_definition.task is not in configuration)
-   resource "aws_ecs_task_definition" "task" {
-       arn                      = "arn:aws:ecs:us-west-2:035866691871:task-definition/people-depot-backend-dev:7" -> null
-       arn_without_revision     = "arn:aws:ecs:us-west-2:035866691871:task-definition/people-depot-backend-dev" -> null
-       container_definitions    = jsonencode(
            [
-               {
-                   cpu                    = 256
-                   environment            = [
-                       {
-                           name  = "COGNITO_AWS_REGION"
-                           value = "us-west-2"
                        },
-                       {
-                           name  = "COGNITO_USER_POOL"
-                           value = "us-west-2_Fn4rkZpuB"
                        },
-                       {
-                           name  = "DATABASE"
-                           value = "postgres"
                        },
-                       {
-                           name  = "DJANGO_ALLOWED_HOSTS"
-                           value = "localhost 127.0.0.1 [::1]"
                        },
-                       {
-                           name  = "SECRET_KEY"
-                           value = "foo"
                        },
-                       {
-                           name  = "SQL_DATABASE"
-                           value = "people_depot_dev"
                        },
-                       {
-                           name  = "SQL_ENGINE"
-                           value = "django.db.backends.postgresql"
                        },
-                       {
-                           name  = "SQL_HOST"
-                           value = "incubator-prod-database.cewewwrvdqjn.us-west-2.rds.amazonaws.com"
                        },
-                       {
-                           name  = "SQL_PASSWORD"
-                           value = "people_depot"
                        },
-                       {
-                           name  = "SQL_PORT"
-                           value = "5432"
                        },
-                       {
-                           name  = "SQL_USER"
-                           value = "people_depot"
                        },
                    ]
-                   essential              = true
-                   image                  = "035866691871.dkr.ecr.us-west-2.amazonaws.com/people-depot-backend-dev:latest"
-                   linuxParameters        = {
-                       initProcessEnabled = true
                    }
-                   logConfiguration       = {
-                       logDriver = "awslogs"
-                       options   = {
-                           awslogs-group         = "ecs/people-depot-backend-dev"
-                           awslogs-region        = "us-west-2"
-                           awslogs-stream-prefix = "backend"
                        }
                    }
-                   memoryReservation      = 512
-                   mountPoints            = []
-                   name                   = "people-depot-backend-dev"
-                   portMappings           = [
-                       {
-                           containerPort = 8000
-                           hostPort      = 8000
-                           protocol      = "tcp"
                        },
                    ]
-                   readonlyRootFilesystem = false
-                   volumesFrom            = []
                },
            ]
        ) -> null
-       cpu                      = "256" -> null
-       execution_role_arn       = "arn:aws:iam::035866691871:role/incubator-prod-ecs-task-role" -> null
-       family                   = "people-depot-backend-dev" -> null
-       id                       = "people-depot-backend-dev" -> null
-       memory                   = "512" -> null
-       network_mode             = "awsvpc" -> null
-       requires_compatibilities = [
-           "FARGATE",
        ] -> null
-       revision                 = 7 -> null
-       skip_destroy             = false -> null
-       tags                     = {} -> null
-       tags_all                 = {} -> null
-       task_role_arn            = "arn:aws:iam::035866691871:role/incubator-prod-ecs-task-role" -> null
-       track_latest             = false -> null
    }

  # aws_lb_listener_rule.static will be destroyed
  # (because aws_lb_listener_rule.static is not in configuration)
-   resource "aws_lb_listener_rule" "static" {
-       arn          = "arn:aws:elasticloadbalancing:us-west-2:035866691871:listener-rule/app/incubator-prod-lb/7451adf77133ef36/390a225766a4daf3/8f35bb4a2420e295" -> null
-       id           = "arn:aws:elasticloadbalancing:us-west-2:035866691871:listener-rule/app/incubator-prod-lb/7451adf77133ef36/390a225766a4daf3/8f35bb4a2420e295" -> null
-       listener_arn = "arn:aws:elasticloadbalancing:us-west-2:035866691871:listener/app/incubator-prod-lb/7451adf77133ef36/390a225766a4daf3" -> null
-       priority     = 15 -> null
-       tags         = {} -> null
-       tags_all     = {} -> null

-       action {
-           order            = 1 -> null
-           target_group_arn = "arn:aws:elasticloadbalancing:us-west-2:035866691871:targetgroup/people-depot-backend-dev/6603e421d89b235f" -> null
-           type             = "forward" -> null
        }

-       condition {
-           host_header {
-               values = [
-                   "people-depot-backend.com",
                ] -> null
            }
        }
-       condition {

-           path_pattern {
-               values = [
-                   "/*",
                ] -> null
            }
        }
    }

  # aws_lb_target_group.this will be destroyed
  # (because aws_lb_target_group.this is not in configuration)
-   resource "aws_lb_target_group" "this" {
-       arn                                = "arn:aws:elasticloadbalancing:us-west-2:035866691871:targetgroup/people-depot-backend-dev/6603e421d89b235f" -> null
-       arn_suffix                         = "targetgroup/people-depot-backend-dev/6603e421d89b235f" -> null
-       connection_termination             = false -> null
-       deregistration_delay               = "5" -> null
-       id                                 = "arn:aws:elasticloadbalancing:us-west-2:035866691871:targetgroup/people-depot-backend-dev/6603e421d89b235f" -> null
-       ip_address_type                    = "ipv4" -> null
-       lambda_multi_value_headers_enabled = false -> null
-       load_balancer_arns                 = [
-           "arn:aws:elasticloadbalancing:us-west-2:035866691871:loadbalancer/app/incubator-prod-lb/7451adf77133ef36",
        ] -> null
-       load_balancing_algorithm_type      = "round_robin" -> null
-       load_balancing_anomaly_mitigation  = "off" -> null
-       load_balancing_cross_zone_enabled  = "use_load_balancer_configuration" -> null
-       name                               = "people-depot-backend-dev" -> null
-       port                               = 80 -> null
-       protocol                           = "HTTP" -> null
-       protocol_version                   = "HTTP1" -> null
-       proxy_protocol_v2                  = false -> null
-       slow_start                         = 0 -> null
-       tags                               = {} -> null
-       tags_all                           = {} -> null
-       target_type                        = "ip" -> null
-       vpc_id                             = "vpc-0bec93a4d80243845" -> null

-       health_check {
-           enabled             = true -> null
-           healthy_threshold   = 3 -> null
-           interval            = 15 -> null
-           matcher             = "200,302" -> null
-           path                = "/" -> null
-           port                = "traffic-port" -> null
-           protocol            = "HTTP" -> null
-           timeout             = 5 -> null
-           unhealthy_threshold = 2 -> null
        }

-       stickiness {
-           cookie_duration = 86400 -> null
-           enabled         = true -> null
-           type            = "lb_cookie" -> null
        }

-       target_failover {}

-       target_health_state {}
    }

  # aws_security_group.fargate will be destroyed
  # (because aws_security_group.fargate is not in configuration)
-   resource "aws_security_group" "fargate" {
-       arn                    = "arn:aws:ec2:us-west-2:035866691871:security-group/sg-08832fecdee2cee14" -> null
-       description            = "Allow TLS inbound traffic" -> null
-       egress                 = [
-           {
-               cidr_blocks      = [
-                   "0.0.0.0/0",
                ]
-               description      = ""
-               from_port        = 0
-               ipv6_cidr_blocks = []
-               prefix_list_ids  = []
-               protocol         = "-1"
-               security_groups  = []
-               self             = false
-               to_port          = 0
            },
        ] -> null
-       id                     = "sg-08832fecdee2cee14" -> null
-       ingress                = [
-           {
-               cidr_blocks      = [
-                   "10.10.0.0/16",
                ]
-               description      = "All Internal traffic"
-               from_port        = 0
-               ipv6_cidr_blocks = []
-               prefix_list_ids  = []
-               protocol         = "tcp"
-               security_groups  = []
-               self             = false
-               to_port          = 65535
            },
        ] -> null
-       name                   = "ecs_fargate_people-depot-backend-dev" -> null
-       owner_id               = "035866691871" -> null
-       revoke_rules_on_delete = false -> null
-       tags                   = {
-           "Name" = "ecs_container_instance_people-depot-backend-dev"
        } -> null
-       tags_all               = {
-           "Name" = "ecs_container_instance_people-depot-backend-dev"
        } -> null
-       vpc_id                 = "vpc-0bec93a4d80243845" -> null
    }

  # module.cognito.aws_cognito_user_pool.main will be created
+   resource "aws_cognito_user_pool" "main" {
+       arn                        = (known after apply)
+       creation_date              = (known after apply)
+       custom_domain              = (known after apply)
+       deletion_protection        = "INACTIVE"
+       domain                     = (known after apply)
+       email_verification_message = (known after apply)
+       email_verification_subject = (known after apply)
+       endpoint                   = (known after apply)
+       estimated_number_of_users  = (known after apply)
+       id                         = (known after apply)
+       last_modified_date         = (known after apply)
+       mfa_configuration          = "OFF"
+       name                       = "people-depot-user-pool"
+       sms_verification_message   = (known after apply)
+       tags_all                   = (known after apply)

+       admin_create_user_config {
+           allow_admin_create_user_only = (known after apply)

+           invite_message_template {
+               email_message = (known after apply)
+               email_subject = (known after apply)
+               sms_message   = (known after apply)
            }
        }

+       password_policy {
+           minimum_length                   = (known after apply)
+           require_lowercase                = (known after apply)
+           require_numbers                  = (known after apply)
+           require_symbols                  = (known after apply)
+           require_uppercase                = (known after apply)
+           temporary_password_validity_days = (known after apply)
        }

+       sms_configuration {
+           external_id    = (known after apply)
+           sns_caller_arn = (known after apply)
+           sns_region     = (known after apply)
        }

+       verification_message_template {
+           default_email_option  = (known after apply)
+           email_message         = (known after apply)
+           email_message_by_link = (known after apply)
+           email_subject         = (known after apply)
+           email_subject_by_link = (known after apply)
+           sms_message           = (known after apply)
        }
    }

  # module.cognito.aws_cognito_user_pool_client.main will be created
+   resource "aws_cognito_user_pool_client" "main" {
+       access_token_validity                         = (known after apply)
+       allowed_oauth_flows                           = [
+           "code",
+           "implicit",
        ]
+       allowed_oauth_flows_user_pool_client          = true
+       allowed_oauth_scopes                          = [
+           "email",
+           "openid",
        ]
+       auth_session_validity                         = (known after apply)
+       callback_urls                                 = (known after apply)
+       client_secret                                 = (sensitive value)
+       default_redirect_uri                          = (known after apply)
+       enable_propagate_additional_user_context_data = (known after apply)
+       enable_token_revocation                       = (known after apply)
+       explicit_auth_flows                           = (known after apply)
+       generate_secret                               = false
+       id                                            = (known after apply)
+       id_token_validity                             = (known after apply)
+       logout_urls                                   = (known after apply)
+       name                                          = "people-depot-client"
+       prevent_user_existence_errors                 = (known after apply)
+       read_attributes                               = (known after apply)
+       refresh_token_validity                        = (known after apply)
+       supported_identity_providers                  = (known after apply)
+       user_pool_id                                  = (known after apply)
+       write_attributes                              = (known after apply)
    }

  # module.dev.module.people_depot.aws_appautoscaling_policy.ecs_autoscale_cpu will be created
+   resource "aws_appautoscaling_policy" "ecs_autoscale_cpu" {
+       alarm_arns         = (known after apply)
+       arn                = (known after apply)
+       id                 = (known after apply)
+       name               = "ecs_autoscale_cpu"
+       policy_type        = "TargetTrackingScaling"
+       resource_id        = "***********************************************"
+       scalable_dimension = "ecs:service:DesiredCount"
+       service_namespace  = "ecs"

+       target_tracking_scaling_policy_configuration {
+           disable_scale_in = false
+           target_value     = 60

+           predefined_metric_specification {
+               predefined_metric_type = "ECSServiceAverageCPUUtilization"
            }
        }
    }

  # module.dev.module.people_depot.aws_appautoscaling_policy.ecs_autoscale_memory will be created
+   resource "aws_appautoscaling_policy" "ecs_autoscale_memory" {
+       alarm_arns         = (known after apply)
+       arn                = (known after apply)
+       id                 = (known after apply)
+       name               = "ecs_autoscale_memory"
+       policy_type        = "TargetTrackingScaling"
+       resource_id        = "***********************************************"
+       scalable_dimension = "ecs:service:DesiredCount"
+       service_namespace  = "ecs"

+       target_tracking_scaling_policy_configuration {
+           disable_scale_in = false
+           target_value     = 80

+           predefined_metric_specification {
+               predefined_metric_type = "ECSServiceAverageMemoryUtilization"
            }
        }
    }

  # module.dev.module.people_depot.aws_appautoscaling_target.ecs_target will be created
+   resource "aws_appautoscaling_target" "ecs_target" {
+       arn                = (known after apply)
+       id                 = (known after apply)
+       max_capacity       = 4
+       min_capacity       = 1
+       resource_id        = "***********************************************"
+       role_arn           = (known after apply)
+       scalable_dimension = "ecs:service:DesiredCount"
+       service_namespace  = "ecs"
+       tags_all           = (known after apply)
    }

  # module.dev.module.people_depot.aws_cloudwatch_log_group.cwlogs will be created
+   resource "aws_cloudwatch_log_group" "cwlogs" {
+       arn               = (known after apply)
+       id                = (known after apply)
+       log_group_class   = (known after apply)
+       name              = "ecs/people-depot-backend-dev"
+       name_prefix       = (known after apply)
+       retention_in_days = 14
+       skip_destroy      = false
+       tags_all          = (known after apply)
    }

  # module.dev.module.people_depot.aws_ecs_service.fargate[0] will be created
+   resource "aws_ecs_service" "fargate" {
+       cluster                            = "arn:aws:ecs:us-west-2:035866691871:cluster/incubator-prod"
+       deployment_maximum_percent         = 200
+       deployment_minimum_healthy_percent = 100
+       desired_count                      = 1
+       enable_ecs_managed_tags            = false
+       enable_execute_command             = true
+       iam_role                           = (known after apply)
+       id                                 = (known after apply)
+       launch_type                        = "FARGATE"
+       name                               = "people-depot-backend-dev"
+       platform_version                   = (known after apply)
+       scheduling_strategy                = "REPLICA"
+       tags_all                           = (known after apply)
+       task_definition                    = (known after apply)
+       triggers                           = (known after apply)
+       wait_for_steady_state              = false

+       load_balancer {
+           container_name   = "people-depot-backend-dev"
+           container_port   = 8000
+           target_group_arn = (known after apply)
        }

+       network_configuration {
+           assign_public_ip = true
+           security_groups  = (known after apply)
+           subnets          = [
+               "subnet-03202f3bf9a24c1a5",
+               "subnet-08c26edd1afc2b9d7",
            ]
        }
    }

  # module.dev.module.people_depot.aws_ecs_task_definition.task will be created
+   resource "aws_ecs_task_definition" "task" {
+       arn                      = (known after apply)
+       arn_without_revision     = (known after apply)
+       container_definitions    = jsonencode(
            [
+               {
+                   cpu                    = 256
+                   environment            = [
+                       {
+                           name  = "COGNITO_AWS_REGION"
+                           value = "us-west-2"
                        },
+                       {
+                           name  = "COGNITO_USER_POOL"
+                           value = "us-west-2_Fn4rkZpuB"
                        },
+                       {
+                           name  = "DATABASE"
+                           value = "postgres"
                        },
+                       {
+                           name  = "DJANGO_ALLOWED_HOSTS"
+                           value = "localhost 127.0.0.1 [::1]"
                        },
+                       {
+                           name  = "SECRET_KEY"
+                           value = "foo"
                        },
+                       {
+                           name  = "SQL_DATABASE"
+                           value = "people_depot_dev"
                        },
+                       {
+                           name  = "SQL_ENGINE"
+                           value = "django.db.backends.postgresql"
                        },
+                       {
+                           name  = "SQL_HOST"
+                           value = "incubator-prod-database.cewewwrvdqjn.us-west-2.rds.amazonaws.com:5432"
                        },
+                       {
+                           name  = "SQL_PASSWORD"
+                           value = "password"
                        },
+                       {
+                           name  = "SQL_PORT"
+                           value = "5432"
                        },
+                       {
+                           name  = "SQL_USER"
+                           value = "people_depot"
                        },
                    ]
+                   essential              = true
+                   image                  = "035866691871.dkr.ecr.us-west-2.amazonaws.com/people-depot-backend-dev:latest"
+                   linuxParameters        = {
+                       initProcessEnabled = true
                    }
+                   logConfiguration       = {
+                       logDriver = "awslogs"
+                       options   = {
+                           awslogs-group         = "ecs/people-depot-backend-dev"
+                           awslogs-region        = "us-west-2"
+                           awslogs-stream-prefix = "backend"
                        }
                    }
+                   memoryReservation      = 512
+                   mountPoints            = []
+                   name                   = "people-depot-backend-dev"
+                   portMappings           = [
+                       {
+                           containerPort = 8000
+                           hostPort      = 8000
+                           protocol      = "tcp"
                        },
                    ]
+                   readonlyRootFilesystem = false
+                   volumesFrom            = []
                },
            ]
        )
+       cpu                      = "256"
+       execution_role_arn       = "arn:aws:iam::035866691871:role/incubator-prod-ecs-task-role"
+       family                   = "people-depot-backend-dev"
+       id                       = (known after apply)
+       memory                   = "512"
+       network_mode             = "awsvpc"
+       requires_compatibilities = [
+           "FARGATE",
        ]
+       revision                 = (known after apply)
+       skip_destroy             = false
+       tags_all                 = (known after apply)
+       task_role_arn            = "arn:aws:iam::035866691871:role/incubator-prod-ecs-task-role"
+       track_latest             = false
    }

  # module.dev.module.people_depot.aws_lb_listener_rule.static will be created
+   resource "aws_lb_listener_rule" "static" {
+       arn          = (known after apply)
+       id           = (known after apply)
+       listener_arn = "arn:aws:elasticloadbalancing:us-west-2:035866691871:listener/app/incubator-prod-lb/7451adf77133ef36/390a225766a4daf3"
+       priority     = (known after apply)
+       tags_all     = (known after apply)

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

+       condition {
+           host_header {
+               values = [
+                   "people-depot-backend.com",
                ]
            }
        }
+       condition {

+           path_pattern {
+               values = [
+                   "/*",
                ]
            }
        }
    }

  # module.dev.module.people_depot.aws_lb_target_group.this will be created
+   resource "aws_lb_target_group" "this" {
+       arn                                = (known after apply)
+       arn_suffix                         = (known after apply)
+       connection_termination             = (known after apply)
+       deregistration_delay               = "5"
+       id                                 = (known after apply)
+       ip_address_type                    = (known after apply)
+       lambda_multi_value_headers_enabled = false
+       load_balancer_arns                 = (known after apply)
+       load_balancing_algorithm_type      = (known after apply)
+       load_balancing_anomaly_mitigation  = (known after apply)
+       load_balancing_cross_zone_enabled  = (known after apply)
+       name                               = "people-depot-backend-dev"
+       name_prefix                        = (known after apply)
+       port                               = 80
+       preserve_client_ip                 = (known after apply)
+       protocol                           = "HTTP"
+       protocol_version                   = (known after apply)
+       proxy_protocol_v2                  = false
+       slow_start                         = 0
+       tags_all                           = (known after apply)
+       target_type                        = "ip"
+       vpc_id                             = "*********************"

+       health_check {
+           enabled             = true
+           healthy_threshold   = 3
+           interval            = 15
+           matcher             = "200,302"
+           path                = "/"
+           port                = "traffic-port"
+           protocol            = "HTTP"
+           timeout             = (known after apply)
+           unhealthy_threshold = 2
        }

+       stickiness {
+           cookie_duration = 86400
+           enabled         = true
+           type            = "lb_cookie"
        }

+       target_failover {
+           on_deregistration = (known after apply)
+           on_unhealthy      = (known after apply)
        }

+       target_health_state {
+           enable_unhealthy_connection_termination = (known after apply)
        }
    }

  # module.dev.module.people_depot.aws_security_group.fargate will be created
+   resource "aws_security_group" "fargate" {
+       arn                    = (known after apply)
+       description            = "Allow TLS inbound traffic"
+       egress                 = [
+           {
+               cidr_blocks      = [
+                   "0.0.0.0/0",
                ]
+               description      = ""
+               from_port        = 0
+               ipv6_cidr_blocks = []
+               prefix_list_ids  = []
+               protocol         = "-1"
+               security_groups  = []
+               self             = false
+               to_port          = 0
            },
        ]
+       id                     = (known after apply)
+       ingress                = [
+           {
+               cidr_blocks      = [
+                   "10.10.0.0/16",
                ]
+               description      = "All Internal traffic"
+               from_port        = 0
+               ipv6_cidr_blocks = []
+               prefix_list_ids  = []
+               protocol         = "tcp"
+               security_groups  = []
+               self             = false
+               to_port          = 65535
            },
        ]
+       name                   = "ecs_fargate_people-depot-backend-dev"
+       name_prefix            = (known after apply)
+       owner_id               = (known after apply)
+       revoke_rules_on_delete = false
+       tags                   = {
+           "Name" = "ecs_container_instance_people-depot-backend-dev"
        }
+       tags_all               = {
+           "Name" = "ecs_container_instance_people-depot-backend-dev"
        }
+       vpc_id                 = "*********************"
    }

  # module.ecr.aws_ecr_repository.this has moved to module.dev.module.people_depot.module.ecr.aws_ecr_repository.this
    resource "aws_ecr_repository" "this" {
        id                   = "people-depot-backend-dev"
        name                 = "people-depot-backend-dev"
        tags                 = {}
#        (5 unchanged attributes hidden)

#        (2 unchanged blocks hidden)
    }

Plan: 11 to add, 0 to change, 9 to destroy.

Changes to Outputs:

📝 Plan generated in PR Terraform Plan #81

Copy link

github-actions bot commented May 18, 2024

Terraform plan in terraform-incubator/people-depot/project

Error: state data in S3 does not have the expected content.
Error: state data in S3 does not have the expected content.

The checksum calculated for the state stored in S3 does not match the checksum
stored in DynamoDB.

Bucket: hlfa-incubator-terragrunt
Key:    terragrunt-states/incubator/./terraform.tfstate
Calculated checksum: 
Stored checksum:     d87d9e2b81af4cd66ddc08f48762a6df

This may be caused by unusually long delays in S3 processing a previous state
update. Please wait for a minute or two and try again.

If this problem persists, and neither S3 nor DynamoDB are experiencing an
outage, you may need to manually verify the remote state and remove the Digest
value stored in the DynamoDB table



Error: Invalid provider configuration

Provider "registry.terraform.io/hashicorp/aws" requires explicit
configuration. Add a provider block to the root module and configure the
provider's required arguments as described in the provider documentation.


Error: Invalid AWS Region: 

  with provider["registry.terraform.io/hashicorp/aws"],
  on <empty> line 0:
  (source code not available)

❌ Failed to generate plan in PR Terraform Plan #86

tylerthome
tylerthome previously approved these changes May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Terraform Plan Action
2 participants