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

Add application deploy #36

Merged
merged 37 commits into from
May 3, 2024
Merged

Add application deploy #36

merged 37 commits into from
May 3, 2024

Conversation

kunduso
Copy link
Owner

@kunduso kunduso commented May 3, 2024

The changes in this PR close #13, close #31, close #30, close #29, close #28, close #27.

Copy link

github-actions bot commented May 3, 2024

Infracost report

💰 Monthly cost will increase by $79 📈

Project Cost change New monthly cost
kunduso/add-aws-ecr-ecs-fargate/deploy/TFplan.JSON +$79 $79
Cost details
Key: * usage cost, ~ changed, + added, - removed

──────────────────────────────────
Project: kunduso/add-aws-ecr-ecs-fargate/deploy/TFplan.JSON

+ aws_ecs_service.service
  +$79

    + Per GB per hour
      +$19

    + Per vCPU per hour
      +$59

Monthly cost change for kunduso/add-aws-ecr-ecs-fargate/deploy/TFplan.JSON
Amount:  +$79 ($0.00 → $79)

──────────────────────────────────
Key: * usage cost, ~ changed, + added, - removed

5 cloud resources were detected:
∙ 1 was estimated
∙ 4 were free

Infracost estimate: Monthly cost will increase by $79 ↑
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃ Project                                            ┃ Cost change ┃ New monthly cost ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━┫
┃ kunduso/add-aws-ecr-ecs-fargate/deploy/TFplan.JSON ┃        +$79 ┃ $79              ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━┛
This comment will be updated when code changes.

Copy link

github-actions bot commented May 3, 2024

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.aws_caller_identity.current: Reading...
aws_service_discovery_http_namespace.namespace: Refreshing state... [id=ns-cc5i7ykaj67ppst3]
aws_kms_key.custom_kms_key: Refreshing state... [id=d01608ec-6fe5-4e78-985f-73ae43aaeabf]
aws_vpc.this: Refreshing state... [id=vpc-0c25adbecbb690848]
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=d01608ec-6fe5-4e78-985f-73ae43aaeabf]
aws_ecr_repository.image_repo: Refreshing state... [id=app-6]
aws_ecs_cluster.app_cluster: Refreshing state... [id=arn:aws:ecs:us-east-2:743794601996:cluster/app-6]
aws_vpc_endpoint.s3: Refreshing state... [id=vpce-02f0ebcaad8ca09ab]
aws_security_group.endpoint-sg: Refreshing state... [id=sg-05930af064bcda15f]
aws_subnet.public[0]: Refreshing state... [id=subnet-052b79dcfca7c2da8]
aws_route_table.this_rt_private: Refreshing state... [id=rtb-0d1790cd2e8fc467b]
aws_security_group.custom_sg: Refreshing state... [id=sg-0aa0899fa57a4474f]
aws_route_table.this_rt: Refreshing state... [id=rtb-0146905b2ea976fac]
aws_subnet.private[1]: Refreshing state... [id=subnet-0b115cd59ccee52cc]
aws_internet_gateway.this_igw: Refreshing state... [id=igw-0881aaa1abff279c3]
aws_subnet.private[0]: Refreshing state... [id=subnet-00b200da3736480b3]
aws_lb_target_group.target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6/bfd3d4ad324ca04f]
aws_subnet.public[1]: Refreshing state... [id=subnet-0ccd6f12831863744]
aws_default_security_group.default: Refreshing state... [id=sg-06e68bd9c87e44033]
aws_route.internet_route: Refreshing state... [id=r-rtb-0146905b2ea976fac1080289494]
aws_security_group_rule.ingress_vpc_endpoint: Refreshing state... [id=sgrule-2232583338]
aws_security_group_rule.egress_load_balancer: Refreshing state... [id=sgrule-444283331]
aws_security_group_rule.ingress_load_balancer: Refreshing state... [id=sgrule-2328443206]
aws_vpc_endpoint.ecr: Refreshing state... [id=vpce-0b59563ce67422eb4]
aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-01dcc22686bbd490d]
aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-00a083e0f972936f5]
aws_route_table_association.private[1]: Refreshing state... [id=rtbassoc-0162c61432d3d4ff0]
aws_route_table_association.private[0]: Refreshing state... [id=rtbassoc-080ae5df228a0a3eb]
aws_lb.app_lb: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:loadbalancer/app/app-6/75a4b6466f16b98e]
aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-01dd8f540f25af285]
aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0242b8bd7cdbfc57d]
aws_vpc_endpoint_route_table_association.s3_association: Refreshing state... [id=a-vpce-02f0ebcaad8ca09ab950437006]
aws_ssm_parameter.infra_output: Refreshing state... [id=/app-6/output]
aws_alb_listener.listener: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:listener/app/app-6/75a4b6466f16b98e/1adac489bfe99a5a]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

Pushed by: @kunduso, Action: pull_request

Copy link

github-actions bot commented May 3, 2024

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.aws_ssm_parameter.infra_output: Reading...
data.aws_caller_identity.current: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
data.aws_ssm_parameter.infra_output: Read complete after 0s [id=/app-6/output]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_ecs_service.service will be created
  + resource "aws_ecs_service" "service" {
      + cluster                            = (sensitive value)
      + deployment_maximum_percent         = 200
      + deployment_minimum_healthy_percent = 100
      + desired_count                      = 2
      + enable_ecs_managed_tags            = false
      + enable_execute_command             = false
      + force_new_deployment               = true
      + iam_role                           = (known after apply)
      + id                                 = (known after apply)
      + launch_type                        = "FARGATE"
      + name                               = "web-app"
      + platform_version                   = (known after apply)
      + scheduling_strategy                = "REPLICA"
      + tags_all                           = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + task_definition                    = (known after apply)
      + triggers                           = (known after apply)
      + wait_for_steady_state              = false

      + load_balancer {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }

      + network_configuration {
          + assign_public_ip = false
          + security_groups  = (sensitive value)
          + subnets          = (sensitive value)
        }
    }

  # aws_ecs_task_definition.web_app will be created
  + resource "aws_ecs_task_definition" "web_app" {
      + arn                      = (known after apply)
      + arn_without_revision     = (known after apply)
      + container_definitions    = (sensitive value)
      + cpu                      = "1024"
      + execution_role_arn       = (known after apply)
      + family                   = "web_app"
      + id                       = (known after apply)
      + memory                   = "3072"
      + network_mode             = "awsvpc"
      + requires_compatibilities = [
          + "FARGATE",
        ]
      + revision                 = (known after apply)
      + skip_destroy             = false
      + tags_all                 = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + task_role_arn            = (known after apply)
      + track_latest             = false

      + runtime_platform {
          + cpu_architecture        = "X86_64"
          + operating_system_family = "LINUX"
        }
    }

  # aws_iam_role.ecs_task_execution_role will be created
  + resource "aws_iam_role" "ecs_task_execution_role" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "ecs-tasks.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "app-6-task-execution-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + unique_id             = (known after apply)
    }

  # aws_iam_role.ecs_task_role will be created
  + resource "aws_iam_role" "ecs_task_role" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Condition = {
                          + ArnLike      = {
                              + "aws:SourceArn" = "arn:aws:ecs:us-east-2:743794601996:*"
                            }
                          + StringEquals = {
                              + "aws:SourceAccount" = "743794601996"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "ecs-tasks.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "app-6-task-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + unique_id             = (known after apply)
    }

  # aws_iam_role_policy_attachment.custom will be created
  + resource "aws_iam_role_policy_attachment" "custom" {
      + id         = (known after apply)
      + policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
      + role       = "app-6-task-execution-role"
    }

Plan: 5 to add, 0 to change, 0 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

Copy link

github-actions bot commented May 3, 2024

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.aws_caller_identity.current: Reading...
aws_service_discovery_http_namespace.namespace: Refreshing state... [id=ns-cc5i7ykaj67ppst3]
aws_vpc.this: Refreshing state... [id=vpc-0c25adbecbb690848]
aws_kms_key.custom_kms_key: Refreshing state... [id=d01608ec-6fe5-4e78-985f-73ae43aaeabf]
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
aws_kms_key_policy.encrypt_app: Refreshing state... [id=d01608ec-6fe5-4e78-985f-73ae43aaeabf]
aws_cloudwatch_log_group.logs: Refreshing state... [id=/amazon-ecs/app-6/log]
aws_kms_alias.key: Refreshing state... [id=alias/app-6]
aws_ecr_repository.image_repo: Refreshing state... [id=app-6]
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-0146905b2ea976fac]
aws_internet_gateway.this_igw: Refreshing state... [id=igw-0881aaa1abff279c3]
aws_subnet.private[0]: Refreshing state... [id=subnet-00b200da3736480b3]
aws_subnet.private[1]: Refreshing state... [id=subnet-0b115cd59ccee52cc]
aws_default_security_group.default: Refreshing state... [id=sg-06e68bd9c87e44033]
aws_vpc_endpoint.s3: Refreshing state... [id=vpce-02f0ebcaad8ca09ab]
aws_lb_target_group.target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6/bfd3d4ad324ca04f]
aws_route_table.this_rt_private: Refreshing state... [id=rtb-0d1790cd2e8fc467b]
aws_security_group.endpoint-sg: Refreshing state... [id=sg-05930af064bcda15f]
aws_security_group.custom_sg: Refreshing state... [id=sg-0aa0899fa57a4474f]
aws_subnet.public[0]: Refreshing state... [id=subnet-052b79dcfca7c2da8]
aws_subnet.public[1]: Refreshing state... [id=subnet-0ccd6f12831863744]
aws_security_group_rule.ingress_load_balancer: Refreshing state... [id=sgrule-2328443206]
aws_security_group_rule.ingress_vpc_endpoint: Refreshing state... [id=sgrule-2232583338]
aws_security_group_rule.egress_load_balancer: Refreshing state... [id=sgrule-444283331]
aws_route.internet_route: Refreshing state... [id=r-rtb-0146905b2ea976fac1080289494]
aws_route_table_association.private[0]: Refreshing state... [id=rtbassoc-080ae5df228a0a3eb]
aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-00a083e0f972936f5]
aws_route_table_association.private[1]: Refreshing state... [id=rtbassoc-0162c61432d3d4ff0]
aws_vpc_endpoint.ecr: Refreshing state... [id=vpce-0b59563ce67422eb4]
aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-01dcc22686bbd490d]
aws_lb.app_lb: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:loadbalancer/app/app-6/75a4b6466f16b98e]
aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-01dd8f540f25af285]
aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0242b8bd7cdbfc57d]
aws_ssm_parameter.infra_output: Refreshing state... [id=/app-6/output]
aws_vpc_endpoint_route_table_association.s3_association: Refreshing state... [id=a-vpce-02f0ebcaad8ca09ab950437006]
aws_alb_listener.listener: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:listener/app/app-6/75a4b6466f16b98e/1adac489bfe99a5a]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

Pushed by: @kunduso, Action: pull_request

Copy link

github-actions bot commented May 3, 2024

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.aws_ssm_parameter.infra_output: Reading...
data.aws_caller_identity.current: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
data.aws_ssm_parameter.infra_output: Read complete after 0s [id=/app-6/output]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_ecs_service.service will be created
  + resource "aws_ecs_service" "service" {
      + cluster                            = (sensitive value)
      + deployment_maximum_percent         = 200
      + deployment_minimum_healthy_percent = 100
      + desired_count                      = 2
      + enable_ecs_managed_tags            = false
      + enable_execute_command             = false
      + force_new_deployment               = true
      + iam_role                           = (known after apply)
      + id                                 = (known after apply)
      + launch_type                        = "FARGATE"
      + name                               = "web-app"
      + platform_version                   = (known after apply)
      + scheduling_strategy                = "REPLICA"
      + tags_all                           = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + task_definition                    = (known after apply)
      + triggers                           = (known after apply)
      + wait_for_steady_state              = false

      + load_balancer {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }

      + network_configuration {
          + assign_public_ip = false
          + security_groups  = (sensitive value)
          + subnets          = (sensitive value)
        }
    }

  # aws_ecs_task_definition.web_app will be created
  + resource "aws_ecs_task_definition" "web_app" {
      + arn                      = (known after apply)
      + arn_without_revision     = (known after apply)
      + container_definitions    = (sensitive value)
      + cpu                      = "1024"
      + execution_role_arn       = (known after apply)
      + family                   = "web_app"
      + id                       = (known after apply)
      + memory                   = "3072"
      + network_mode             = "awsvpc"
      + requires_compatibilities = [
          + "FARGATE",
        ]
      + revision                 = (known after apply)
      + skip_destroy             = false
      + tags_all                 = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + task_role_arn            = (known after apply)
      + track_latest             = false

      + runtime_platform {
          + cpu_architecture        = "X86_64"
          + operating_system_family = "LINUX"
        }
    }

  # aws_iam_role.ecs_task_execution_role will be created
  + resource "aws_iam_role" "ecs_task_execution_role" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "ecs-tasks.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "app-6-task-execution-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + unique_id             = (known after apply)
    }

  # aws_iam_role.ecs_task_role will be created
  + resource "aws_iam_role" "ecs_task_role" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Condition = {
                          + ArnLike      = {
                              + "aws:SourceArn" = "arn:aws:ecs:us-east-2:743794601996:*"
                            }
                          + StringEquals = {
                              + "aws:SourceAccount" = "743794601996"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "ecs-tasks.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "app-6-task-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + unique_id             = (known after apply)
    }

  # aws_iam_role_policy_attachment.custom will be created
  + resource "aws_iam_role_policy_attachment" "custom" {
      + id         = (known after apply)
      + policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
      + role       = "app-6-task-execution-role"
    }

Plan: 5 to add, 0 to change, 0 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

Copy link

github-actions bot commented May 3, 2024

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.aws_caller_identity.current: Reading...
aws_service_discovery_http_namespace.namespace: Refreshing state... [id=ns-cc5i7ykaj67ppst3]
aws_kms_key.custom_kms_key: Refreshing state... [id=d01608ec-6fe5-4e78-985f-73ae43aaeabf]
aws_vpc.this: Refreshing state... [id=vpc-0c25adbecbb690848]
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
aws_kms_alias.key: Refreshing state... [id=alias/app-6]
aws_kms_key_policy.encrypt_app: Refreshing state... [id=d01608ec-6fe5-4e78-985f-73ae43aaeabf]
aws_cloudwatch_log_group.logs: Refreshing state... [id=/amazon-ecs/app-6/log]
aws_ecr_repository.image_repo: Refreshing state... [id=app-6]
aws_ecs_cluster.app_cluster: Refreshing state... [id=arn:aws:ecs:us-east-2:743794601996:cluster/app-6]
aws_internet_gateway.this_igw: Refreshing state... [id=igw-0881aaa1abff279c3]
aws_vpc_endpoint.s3: Refreshing state... [id=vpce-02f0ebcaad8ca09ab]
aws_lb_target_group.target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6/bfd3d4ad324ca04f]
aws_subnet.public[1]: Refreshing state... [id=subnet-0ccd6f12831863744]
aws_security_group.custom_sg: Refreshing state... [id=sg-0aa0899fa57a4474f]
aws_security_group.endpoint-sg: Refreshing state... [id=sg-05930af064bcda15f]
aws_route_table.this_rt_private: Refreshing state... [id=rtb-0d1790cd2e8fc467b]
aws_subnet.public[0]: Refreshing state... [id=subnet-052b79dcfca7c2da8]
aws_subnet.private[0]: Refreshing state... [id=subnet-00b200da3736480b3]
aws_subnet.private[1]: Refreshing state... [id=subnet-0b115cd59ccee52cc]
aws_route_table.this_rt: Refreshing state... [id=rtb-0146905b2ea976fac]
aws_default_security_group.default: Refreshing state... [id=sg-06e68bd9c87e44033]
aws_security_group_rule.ingress_load_balancer: Refreshing state... [id=sgrule-2328443206]
aws_security_group_rule.ingress_vpc_endpoint: Refreshing state... [id=sgrule-2232583338]
aws_security_group_rule.egress_load_balancer: Refreshing state... [id=sgrule-444283331]
aws_lb.app_lb: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:loadbalancer/app/app-6/75a4b6466f16b98e]
aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-00a083e0f972936f5]
aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-01dcc22686bbd490d]
aws_route_table_association.private[1]: Refreshing state... [id=rtbassoc-0162c61432d3d4ff0]
aws_route_table_association.private[0]: Refreshing state... [id=rtbassoc-080ae5df228a0a3eb]
aws_vpc_endpoint.ecr: Refreshing state... [id=vpce-0b59563ce67422eb4]
aws_route.internet_route: Refreshing state... [id=r-rtb-0146905b2ea976fac1080289494]
aws_route_table_association.public[0]: Refreshing state... [id=rtbassoc-01dd8f540f25af285]
aws_route_table_association.public[1]: Refreshing state... [id=rtbassoc-0242b8bd7cdbfc57d]
aws_ssm_parameter.infra_output: Refreshing state... [id=/app-6/output]
aws_vpc_endpoint_route_table_association.s3_association: Refreshing state... [id=a-vpce-02f0ebcaad8ca09ab950437006]
aws_alb_listener.listener: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:listener/app/app-6/75a4b6466f16b98e/1adac489bfe99a5a]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

Pushed by: @kunduso, Action: pull_request

Copy link

github-actions bot commented May 3, 2024

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.infra_output: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
data.aws_ssm_parameter.infra_output: Read complete after 0s [id=/app-6/output]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_ecs_service.service will be created
  + resource "aws_ecs_service" "service" {
      + cluster                            = (sensitive value)
      + deployment_maximum_percent         = 200
      + deployment_minimum_healthy_percent = 100
      + desired_count                      = 2
      + enable_ecs_managed_tags            = false
      + enable_execute_command             = false
      + force_new_deployment               = true
      + iam_role                           = (known after apply)
      + id                                 = (known after apply)
      + launch_type                        = "FARGATE"
      + name                               = "web-app"
      + platform_version                   = (known after apply)
      + scheduling_strategy                = "REPLICA"
      + tags_all                           = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + task_definition                    = (known after apply)
      + triggers                           = (known after apply)
      + wait_for_steady_state              = false

      + load_balancer {
          # At least one attribute in this block is (or was) sensitive,
          # so its contents will not be displayed.
        }

      + network_configuration {
          + assign_public_ip = false
          + security_groups  = (sensitive value)
          + subnets          = (sensitive value)
        }
    }

  # aws_ecs_task_definition.web_app will be created
  + resource "aws_ecs_task_definition" "web_app" {
      + arn                      = (known after apply)
      + arn_without_revision     = (known after apply)
      + container_definitions    = (sensitive value)
      + cpu                      = "1024"
      + execution_role_arn       = (known after apply)
      + family                   = "web_app"
      + id                       = (known after apply)
      + memory                   = "3072"
      + network_mode             = "awsvpc"
      + requires_compatibilities = [
          + "FARGATE",
        ]
      + revision                 = (known after apply)
      + skip_destroy             = false
      + tags_all                 = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + task_role_arn            = (known after apply)
      + track_latest             = false

      + runtime_platform {
          + cpu_architecture        = "X86_64"
          + operating_system_family = "LINUX"
        }
    }

  # aws_iam_role.ecs_task_execution_role will be created
  + resource "aws_iam_role" "ecs_task_execution_role" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "ecs-tasks.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "app-6-task-execution-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + unique_id             = (known after apply)
    }

  # aws_iam_role.ecs_task_role will be created
  + resource "aws_iam_role" "ecs_task_role" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Condition = {
                          + ArnLike      = {
                              + "aws:SourceArn" = "arn:aws:ecs:us-east-2:743794601996:*"
                            }
                          + StringEquals = {
                              + "aws:SourceAccount" = "743794601996"
                            }
                        }
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "ecs-tasks.amazonaws.com"
                        }
                      + Sid       = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = false
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "app-6-task-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags_all              = {
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + unique_id             = (known after apply)
    }

  # aws_iam_role_policy_attachment.custom will be created
  + resource "aws_iam_role_policy_attachment" "custom" {
      + id         = (known after apply)
      + policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
      + role       = "app-6-task-execution-role"
    }

Plan: 5 to add, 0 to change, 0 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 a127545 into main May 3, 2024
8 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
1 participant