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

updated to support traditional ecs deployment #116

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Conversation

kunduso
Copy link
Owner

@kunduso kunduso commented Nov 27, 2024

This PR partially closes #114

@kunduso kunduso self-assigned this Nov 27, 2024
Copy link

💰 Infracost report

Monthly estimate generated

This comment will be updated when code changes.

Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
aws_service_discovery_http_namespace.namespace: Refreshing state... [id=ns-cc5i7ykaj67ppst3]
data.aws_caller_identity.current: Reading...
aws_kms_key.custom_kms_key: Refreshing state... [id=ef68e503-5cdd-4baf-9547-3d39d0e4a0c8]
aws_vpc.this: Refreshing state... [id=vpc-0177cbea506968866]
aws_lb_target_group.green_target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6-green/8054f7143db62529]
aws_lb_target_group.blue_target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6-blue/bee4cbd72f2fedfe]
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
aws_kms_alias.key: Refreshing state... [id=alias/app-6]
aws_cloudwatch_log_group.logs: Refreshing state... [id=/amazon-ecs/app-6/log]
aws_kms_key_policy.encrypt_app: Refreshing state... [id=ef68e503-5cdd-4baf-9547-3d39d0e4a0c8]
aws_ecr_repository.image_repo: Refreshing state... [id=app-6]
aws_secretsmanager_secret.ecs_secret: Refreshing state... [id=arn:aws:secretsmanager:us-east-2:743794601996:secret:ecs_secret-xyMvld]
aws_secretsmanager_secret_version.ecs_secret_version: Refreshing state... [id=arn:aws:secretsmanager:us-east-2:743794601996:secret:ecs_secret-xyMvld|terraform-20241006125625851100000001]
aws_ecs_cluster.app_cluster: Refreshing state... [id=arn:aws:ecs:us-east-2:743794601996:cluster/app-6]
aws_route_table.this_rt: Refreshing state... [id=rtb-0ee63cd483cdda2a6]
aws_security_group.container_sg: Refreshing state... [id=sg-011020866225de511]
aws_subnet.private[1]: Refreshing state... [id=subnet-09b612ab68f8cf06d]
aws_route_table.this_rt_private: Refreshing state... [id=rtb-076c0decdd5557da1]
aws_subnet.public[1]: Refreshing state... [id=subnet-0ba781f8c180ec1c5]
aws_subnet.public[0]: Refreshing state... [id=subnet-0265de33fcbcc74bf]
aws_security_group.custom_sg: Refreshing state... [id=sg-0f503030dfa8c9ef8]
aws_subnet.private[0]: Refreshing state... [id=subnet-0da40b020a8b8fca6]
aws_security_group.endpoint_sg: Refreshing state... [id=sg-0318f588f4818e5cf]
aws_default_security_group.default: Refreshing state... [id=sg-0e90b718d992b31ea]
aws_internet_gateway.this_igw: Refreshing state... [id=igw-0c1c35cd1eebdf561]
aws_vpc_endpoint.s3: Refreshing state... [id=vpce-08ac7d43bbc3bb49d]
aws_security_group_rule.ingress_vpc_endpoint: Refreshing state... [id=sgrule-993827166]
aws_security_group_rule.egress_container: Refreshing state... [id=sgrule-4292562398]
aws_security_group_rule.egress_load_balancer: Refreshing state... [id=sgrule-4047886860]
aws_security_group_rule.ingress_load_balancer: Refreshing state... [id=sgrule-2183468127]
aws_security_group_rule.ingress_container: Refreshing state... [id=sgrule-1962334996]
aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-068a2547cce99ca0d]
aws_lb.app_lb: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:loadbalancer/app/app-6/dd3117db6f42b247]
aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-01e8adeb6b52b7d82]
aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-07314797ccaba5e5f]
aws_vpc_endpoint.ecr: Refreshing state... [id=vpce-0eda08325c5d33c42]
aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-0accdb89f1535e6c5]
aws_vpc_endpoint.secrets_manager: Refreshing state... [id=vpce-0a6cf8ee910b8e883]
aws_route_table_association.private[0]: Refreshing state... [id=rtbassoc-0dfbe27f944a69c10]
aws_route_table_association.private[1]: Refreshing state... [id=rtbassoc-05abae80d12bb9a36]
aws_route.internet_route: Refreshing state... [id=r-rtb-0ee63cd483cdda2a61080289494]
aws_vpc_endpoint_route_table_association.s3_association: Refreshing state... [id=a-vpce-08ac7d43bbc3bb49d1013104409]
aws_alb_listener.listener: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:listener/app/app-6/dd3117db6f42b247/97befa50e51ff9bc]
aws_ssm_parameter.infra_output: Refreshing state... [id=/app-6/output]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_lb_target_group.blue_target_group will be destroyed
  # (because aws_lb_target_group.blue_target_group is not in configuration)
  - resource "aws_lb_target_group" "blue_target_group" {
      - arn                                = "arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6-blue/bee4cbd72f2fedfe" -> null
      - arn_suffix                         = "targetgroup/app-6-blue/bee4cbd72f2fedfe" -> null
      - deregistration_delay               = "300" -> null
      - id                                 = "arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6-blue/bee4cbd72f2fedfe" -> null
      - ip_address_type                    = "ipv4" -> null
      - lambda_multi_value_headers_enabled = false -> null
      - load_balancer_arns                 = [
          - "arn:aws:elasticloadbalancing:us-east-2:743794601996:loadbalancer/app/app-6/dd3117db6f42b247",
        ] -> 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                               = "app-6-blue" -> null
      - port                               = 8080 -> null
      - protocol                           = "HTTP" -> null
      - protocol_version                   = "HTTP1" -> null
      - proxy_protocol_v2                  = false -> null
      - slow_start                         = 0 -> null
      - tags                               = {} -> null
      - tags_all                           = {
          - "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        } -> null
      - target_type                        = "ip" -> null
      - vpc_id                             = "vpc-0177cbea506968866" -> null
        # (1 unchanged attribute hidden)

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

      - stickiness {
          - cookie_duration = 86400 -> null
          - enabled         = false -> null
          - type            = "lb_cookie" -> null
            # (1 unchanged attribute hidden)
        }

      - target_failover {}

      - target_health_state {}
    }

  # aws_lb_target_group.green_target_group will be destroyed
  # (because aws_lb_target_group.green_target_group is not in configuration)
  - resource "aws_lb_target_group" "green_target_group" {
      - arn                                = "arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6-green/8054f7143db62529" -> null
      - arn_suffix                         = "targetgroup/app-6-green/8054f7143db62529" -> null
      - deregistration_delay               = "300" -> null
      - id                                 = "arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6-green/8054f7143db62529" -> null
      - ip_address_type                    = "ipv4" -> null
      - lambda_multi_value_headers_enabled = false -> null
      - load_balancer_arns                 = [] -> 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                               = "app-6-green" -> null
      - port                               = 8080 -> null
      - protocol                           = "HTTP" -> null
      - protocol_version                   = "HTTP1" -> null
      - proxy_protocol_v2                  = false -> null
      - slow_start                         = 0 -> null
      - tags                               = {} -> null
      - tags_all                           = {
          - "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        } -> null
      - target_type                        = "ip" -> null
      - vpc_id                             = "vpc-0177cbea506968866" -> null
        # (1 unchanged attribute hidden)

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

      - stickiness {
          - cookie_duration = 86400 -> null
          - enabled         = false -> null
          - type            = "lb_cookie" -> null
            # (1 unchanged attribute hidden)
        }

      - target_failover {}

      - target_health_state {}
    }

  # aws_lb_target_group.target_group will be created
  + resource "aws_lb_target_group" "target_group" {
      + arn                                = (known after apply)
      + arn_suffix                         = (known after apply)
      + connection_termination             = (known after apply)
      + deregistration_delay               = "300"
      + 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                               = "app-6"
      + name_prefix                        = (known after apply)
      + port                               = 8080
      + preserve_client_ip                 = (known after apply)
      + protocol                           = "HTTP"
      + protocol_version                   = (known after apply)
      + proxy_protocol_v2                  = false
      + slow_start                         = 0
      + tags_all                           = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + target_type                        = "ip"
      + vpc_id                             = "vpc-0177cbea506968866"

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

      + stickiness (known after apply)

      + target_failover (known after apply)

      + target_health_state (known after apply)
    }

  # aws_ssm_parameter.infra_output will be updated in-place
  ~ resource "aws_ssm_parameter" "infra_output" {
        id              = "/app-6/output"
      + insecure_value  = (known after apply)
        name            = "/app-6/output"
        tags            = {}
      ~ value           = (sensitive value)
      ~ version         = 8 -> (known after apply)
        # (8 unchanged attributes hidden)
    }

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

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: TFplan.JSON

To perform exactly these actions, run the following command to apply:
    terraform apply "TFplan.JSON"

Pushed by: @kunduso, Action: pull_request

@kunduso kunduso merged commit 85e012a into main Nov 27, 2024
6 checks passed
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.

Separate out the ECR repository into the Central AWS account
1 participant