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

Fix issues #40

Merged
merged 2 commits into from
May 3, 2024
Merged

Fix issues #40

merged 2 commits into from
May 3, 2024

Conversation

kunduso
Copy link
Owner

@kunduso kunduso commented May 3, 2024

The changes in the PR close #38 and close #39

@kunduso kunduso self-assigned this May 3, 2024
Copy link

github-actions bot commented May 3, 2024

Infracost report

💰 Monthly cost will not change

Cost details
──────────────────────────────────
The following projects have no cost estimate changes: kunduso/add-aws-ecr-ecs-fargate/infra/TFplan.JSON
Run the following command to see their breakdown: infracost breakdown --path=/path/to/code

──────────────────────────────────
35 cloud resources were detected:
∙ 7 were estimated
∙ 26 were free
∙ 2 are not supported yet, see https://infracost.io/requested-resources:
  ∙ 1 x aws_kms_key_policy
  ∙ 1 x aws_service_discovery_http_namespace
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
aws_service_discovery_http_namespace.namespace: Refreshing state... [id=ns-cc5i7ykaj67ppst3]
aws_vpc.this: Refreshing state... [id=vpc-0c25adbecbb690848]
aws_security_group.endpoint-sg: Refreshing state... [id=sg-05930af064bcda15f]
aws_kms_key.custom_kms_key: Refreshing state... [id=d01608ec-6fe5-4e78-985f-73ae43aaeabf]
data.aws_caller_identity.current: Reading...
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_route_table.this_rt: Refreshing state... [id=rtb-0146905b2ea976fac]
aws_default_security_group.default: Refreshing state... [id=sg-06e68bd9c87e44033]
aws_internet_gateway.this_igw: Refreshing state... [id=igw-0881aaa1abff279c3]
aws_lb_target_group.target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-2:743794601996:targetgroup/app-6/bfd3d4ad324ca04f]
aws_subnet.public[0]: Refreshing state... [id=subnet-052b79dcfca7c2da8]
aws_route_table.this_rt_private: Refreshing state... [id=rtb-0d1790cd2e8fc467b]
aws_subnet.public[1]: Refreshing state... [id=subnet-0ccd6f12831863744]
aws_vpc_endpoint.s3: Refreshing state... [id=vpce-02f0ebcaad8ca09ab]
aws_security_group.custom_sg: Refreshing state... [id=sg-0aa0899fa57a4474f]
aws_subnet.private[0]: Refreshing state... [id=subnet-00b200da3736480b3]
aws_subnet.private[1]: Refreshing state... [id=subnet-0b115cd59ccee52cc]
aws_security_group_rule.ingress_vpc_endpoint: Refreshing state... [id=sgrule-2232583338]
aws_vpc_endpoint.ecr_api: Refreshing state... [id=vpce-01dcc22686bbd490d]
aws_route_table_association.private[0]: Refreshing state... [id=rtbassoc-080ae5df228a0a3eb]
aws_vpc_endpoint.cloudwatch: Refreshing state... [id=vpce-00a083e0f972936f5]
aws_vpc_endpoint.ecr: Refreshing state... [id=vpce-0b59563ce67422eb4]
aws_route.internet_route: Refreshing state... [id=r-rtb-0146905b2ea976fac1080289494]
aws_route_table_association.private[1]: Refreshing state... [id=rtbassoc-0162c61432d3d4ff0]
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_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]

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

Terraform will perform the following actions:

  # aws_security_group.endpoint-sg will be destroyed
  # (because aws_security_group.endpoint-sg is not in configuration)
  - resource "aws_security_group" "endpoint-sg" {
      - arn                    = "arn:aws:ec2:us-east-2:743794601996:security-group/sg-05930af064bcda15f" -> null
      - description            = "allow inbound traffic" -> null
      - egress                 = [] -> null
      - id                     = "sg-05930af064bcda15f" -> null
      - ingress                = [] -> null
      - name                   = "endpoint_access" -> null
      - owner_id               = "743794601996" -> null
      - revoke_rules_on_delete = false -> null
      - tags                   = {
          - "Name" = "app-5-endpoint-sg"
        } -> null
      - tags_all               = {
          - "Name"   = "app-5-endpoint-sg"
          - "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        } -> null
      - vpc_id                 = "vpc-0c25adbecbb690848" -> null
        # (1 unchanged attribute hidden)
    }

  # aws_security_group.endpoint_sg will be created
  + resource "aws_security_group" "endpoint_sg" {
      + arn                    = (known after apply)
      + description            = "allow inbound traffic"
      + egress                 = (known after apply)
      + id                     = (known after apply)
      + ingress                = (known after apply)
      + name                   = "endpoint_access"
      + name_prefix            = (known after apply)
      + owner_id               = (known after apply)
      + revoke_rules_on_delete = false
      + tags                   = {
          + "Name" = "app-6-endpoint-sg"
        }
      + tags_all               = {
          + "Name"   = "app-6-endpoint-sg"
          + "Source" = "https://github.com/kunduso/add-aws-ecr-ecs-fargate"
        }
      + vpc_id                 = "vpc-0c25adbecbb690848"
    }

  # aws_security_group_rule.ingress_vpc_endpoint must be replaced
-/+ resource "aws_security_group_rule" "ingress_vpc_endpoint" {
      ~ id                       = "sgrule-2232583338" -> (known after apply)
      ~ security_group_id        = "sg-0aa0899fa57a4474f" # forces replacement -> (known after apply) # forces replacement
      ~ security_group_rule_id   = "sgr-0906d6bbd82e71bd3" -> (known after apply)
      + source_security_group_id = (known after apply)
        # (7 unchanged attributes hidden)
    }

  # aws_vpc_endpoint.cloudwatch will be updated in-place
  ~ resource "aws_vpc_endpoint" "cloudwatch" {
        id                    = "vpce-00a083e0f972936f5"
      ~ security_group_ids    = [
          - "sg-05930af064bcda15f",
        ] -> (known after apply)
        tags                  = {
            "Name" = "app-6-logs"
        }
        # (16 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # aws_vpc_endpoint.ecr will be updated in-place
  ~ resource "aws_vpc_endpoint" "ecr" {
        id                    = "vpce-0b59563ce67422eb4"
      ~ security_group_ids    = [
          - "sg-05930af064bcda15f",
        ] -> (known after apply)
        tags                  = {
            "Name" = "app-6-ecr"
        }
        # (16 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # aws_vpc_endpoint.ecr_api will be updated in-place
  ~ resource "aws_vpc_endpoint" "ecr_api" {
        id                    = "vpce-01dcc22686bbd490d"
      ~ security_group_ids    = [
          - "sg-05930af064bcda15f",
        ] -> (known after apply)
        tags                  = {
            "Name" = "app-6-ecr-api"
        }
        # (16 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 2 to add, 3 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 312e6c9 into main May 3, 2024
5 checks passed
@kunduso kunduso deleted the add-scaffolding branch May 7, 2024 01:17
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.

Associate aws_security_group_rule to the correct aws_security_group Correct aws_ssm_parameter value
1 participant