Skip to content

Chores: unique name for instance profile in both environments #12

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

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

IrezD
Copy link
Owner

@IrezD IrezD commented Jan 8, 2024

No description provided.

Copy link

github-actions bot commented Jan 8, 2024

Terraform plan for Staging

Plan: 1 to add, 3 to change, 1 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
!~  update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_autoscaling_group.ASG_config will be updated in-place
!~  resource "aws_autoscaling_group" "ASG_config" {
+       desired_capacity_type            = "units"
        id                               = "fastapi-ASG-dev"
        name                             = "fastapi-ASG-dev"
#        (26 unchanged attributes hidden)

#        (5 unchanged blocks hidden)
    }

  # aws_ecs_cluster.fastapi-cluster will be updated in-place
!~  resource "aws_ecs_cluster" "fastapi-cluster" {
        id       = "arn:aws:ecs:eu-central-1:806066816337:cluster/fastapi-cluster"
        name     = "fastapi-cluster"
!~      tags     = {
-           "Environment" = "Prod Environment" -> null
        }
!~      tags_all = {
!~          "Environment" = "Prod Environment" -> "Dev Environment"
        }
#        (1 unchanged attribute hidden)

#        (2 unchanged blocks hidden)
    }

  # aws_ecs_service.fastapi-service will be updated in-place
!~  resource "aws_ecs_service" "fastapi-service" {
        id                                 = "arn:aws:ecs:eu-central-1:806066816337:service/fastapi-cluster/dev-fastapi-service"
        name                               = "dev-fastapi-service"
        tags                               = {}
!~      task_definition                    = "arn:aws:ecs:eu-central-1:806066816337:task-definition/dev-fastapi-container:48" -> (known after apply)
#        (15 unchanged attributes hidden)

#        (3 unchanged blocks hidden)
    }

  # aws_ecs_task_definition.task_definition must be replaced
-/+ resource "aws_ecs_task_definition" "task_definition" {
!~      arn                      = "arn:aws:ecs:eu-central-1:806066816337:task-definition/dev-fastapi-container:48" -> (known after apply)
!~      arn_without_revision     = "arn:aws:ecs:eu-central-1:806066816337:task-definition/dev-fastapi-container" -> (known after apply)
!~      container_definitions    = jsonencode(
!~          [
!~              {
-                   environment  = []
!~                  image        = "public.ecr.aws/p2x0k5a9/dev/irezd/fastapi:0eddadda493e2dd22fde5c3b8874e93e597f8080" -> "public.ecr.aws/p2x0k5a9/dev/irezd/fastapi:25dd427b6600694128e5505e8bbf6e029a7b0978"
-                   mountPoints  = []
                    name         = "dev_FastAPI_image"
!~                  portMappings = [
!~                      {
-                           protocol      = "tcp"
#                            (2 unchanged attributes hidden)
                        },
                    ]
-                   volumesFrom  = []
#                    (3 unchanged attributes hidden)
                },
            ] # forces replacement
        )
!~      id                       = "*********************" -> (known after apply)
+       network_mode             = (known after apply)
!~      revision                 = 48 -> (known after apply)
-       tags                     = {} -> null
#        (4 unchanged attributes hidden)
    }

Plan: 1 to add, 3 to change, 1 to destroy.

✅ Plan applied in Staging Image Build & Push #61

Outputs
ecr_registry_id     = "806066816337"
ecr_repository_name = "dev/irezd/fastapi"

@IrezD IrezD merged commit 0fe098b into main Jan 8, 2024
@IrezD IrezD deleted the feature branch January 8, 2024 08:28
Copy link

github-actions bot commented Jan 8, 2024

Terraform plan for Staging

Plan: 3 to add, 1 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+   create
!~  update in-place

Terraform will perform the following actions:

  # aws_autoscaling_group.ASG_config will be updated in-place
!~  resource "aws_autoscaling_group" "ASG_config" {
+       desired_capacity_type            = "units"
        id                               = "fastapi-ASG-dev"
        name                             = "fastapi-ASG-dev"
#        (26 unchanged attributes hidden)

#        (5 unchanged blocks hidden)
    }

  # aws_ecs_cluster.fastapi-cluster will be created
+   resource "aws_ecs_cluster" "fastapi-cluster" {
+       arn      = (known after apply)
+       id       = (known after apply)
+       name     = "fastapi-cluster"
+       tags_all = {
+           "Environment" = "Dev Environment"
        }

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

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

  # aws_ecs_cluster_capacity_providers.Provider_config will be created
+   resource "aws_ecs_cluster_capacity_providers" "Provider_config" {
+       capacity_providers = [
+           "CustomEC2Provider",
        ]
+       cluster_name       = "fastapi-cluster"
+       id                 = (known after apply)

+       default_capacity_provider_strategy {
+           base              = 1
+           capacity_provider = "CustomEC2Provider"
+           weight            = 100
        }
    }

  # aws_ecs_service.fastapi-service will be created
+   resource "aws_ecs_service" "fastapi-service" {
+       cluster                            = (known after apply)
+       deployment_maximum_percent         = 200
+       deployment_minimum_healthy_percent = 100
+       desired_count                      = 1
+       enable_ecs_managed_tags            = false
+       enable_execute_command             = false
+       force_new_deployment               = true
+       iam_role                           = (known after apply)
+       id                                 = (known after apply)
+       launch_type                        = "EC2"
+       name                               = "dev-fastapi-service"
+       platform_version                   = (known after apply)
+       scheduling_strategy                = "REPLICA"
+       tags_all                           = {
+           "Environment" = "Dev Environment"
        }
+       task_definition                    = "arn:aws:ecs:eu-central-1:806066816337:task-definition/dev-fastapi-container"
+       triggers                           = (known after apply)
+       wait_for_steady_state              = false

+       load_balancer {
+           container_name   = "dev_FastAPI_image"
+           container_port   = 5000
+           target_group_arn = "arn:aws:elasticloadbalancing:eu-central-1:806066816337:targetgroup/alb-target-group-dev/3c273cd8ab1a4464"
        }
    }

Plan: 3 to add, 1 to change, 0 to destroy.

❌ Error applying plan in Staging Image Build & Push #61

Copy link

github-actions bot commented Jan 8, 2024

Terraform plan for Staging

Plan: 1 to add, 2 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+   create
!~  update in-place

Terraform will perform the following actions:

  # aws_autoscaling_group.ASG_config will be updated in-place
!~  resource "aws_autoscaling_group" "ASG_config" {
+       desired_capacity_type            = "units"
        id                               = "fastapi-ASG-dev"
        name                             = "fastapi-ASG-dev"
#        (26 unchanged attributes hidden)

#        (5 unchanged blocks hidden)
    }

  # aws_ecs_cluster.fastapi-cluster will be updated in-place
!~  resource "aws_ecs_cluster" "fastapi-cluster" {
        id       = "arn:aws:ecs:eu-central-1:806066816337:cluster/fastapi-cluster"
        name     = "fastapi-cluster"
!~      tags     = {
-           "Environment" = "Prod Environment" -> null
        }
!~      tags_all = {
!~          "Environment" = "Prod Environment" -> "Dev Environment"
        }
#        (1 unchanged attribute hidden)

#        (2 unchanged blocks hidden)
    }

  # aws_ecs_service.fastapi-service will be created
+   resource "aws_ecs_service" "fastapi-service" {
+       cluster                            = "arn:aws:ecs:eu-central-1:806066816337:cluster/fastapi-cluster"
+       deployment_maximum_percent         = 200
+       deployment_minimum_healthy_percent = 100
+       desired_count                      = 1
+       enable_ecs_managed_tags            = false
+       enable_execute_command             = false
+       force_new_deployment               = true
+       iam_role                           = (known after apply)
+       id                                 = (known after apply)
+       launch_type                        = "EC2"
+       name                               = "dev-fastapi-service"
+       platform_version                   = (known after apply)
+       scheduling_strategy                = "REPLICA"
+       tags_all                           = {
+           "Environment" = "Dev Environment"
        }
+       task_definition                    = "arn:aws:ecs:eu-central-1:806066816337:task-definition/dev-fastapi-container"
+       triggers                           = (known after apply)
+       wait_for_steady_state              = false

+       load_balancer {
+           container_name   = "dev_FastAPI_image"
+           container_port   = 5000
+           target_group_arn = "arn:aws:elasticloadbalancing:eu-central-1:806066816337:targetgroup/alb-target-group-dev/3c273cd8ab1a4464"
        }
    }

Plan: 1 to add, 2 to change, 0 to destroy.

✅ Plan applied in Staging Image Build & Push #61

Outputs
ecr_registry_id     = "806066816337"
ecr_repository_name = "dev/irezd/fastapi"

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.

1 participant