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

feat: tear down old instance #255

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Conversation

alexander-jackson
Copy link
Owner

Now that the other instance has started up and the DNS has been flipped over, let's tear down the old one.

This change:

  • Destroys the instance and database access

Now that the other instance has started up and the DNS has been flipped
over, let's tear down the old one.

This change:
* Destroys the instance and database access
Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
Running plan in HCP Terraform. Output will stream here. Pressing Ctrl-C
will stop streaming the logs, but will not stop the plan running remotely.

Preparing the remote plan...

To view this run in a browser, visit:
https://app.terraform.io/app/blackboards/infrastructure/runs/run-uby5924xv5f7ExMB

Waiting for the plan to start...

Terraform v1.5.7
on linux_amd64
Initializing plugins and modules...
module.bucket.random_id.this: Refreshing state... [id=csAJ]
module.remote_state_bucket.random_id.this: Refreshing state... [id=WvCN]
module.logging_bucket.random_id.this: Refreshing state... [id=SssY]
module.postgres_backups_bucket.random_id.this: Refreshing state... [id=Ze9c]
module.config_bucket.random_id.this: Refreshing state... [id=aPbH]
module.secondary.aws_iam_policy.this: Refreshing state... [id=arn:aws:iam::558855412466:policy/secondary-policy]
module.secondary.aws_security_group_rule.allow_outbound_http: Refreshing state... [id=sgrule-4183418626]
module.secondary.aws_security_group_rule.allow_inbound_https: Refreshing state... [id=sgrule-3667874110]
module.secondary.aws_security_group_rule.allow_inbound_ssh: Refreshing state... [id=sgrule-3665774122]
module.secondary.aws_security_group_rule.allow_outbound_ssh: Refreshing state... [id=sgrule-355036989]
module.secondary.aws_eip.this: Refreshing state... [id=eipalloc-00b8a37f228be09f5]
module.secondary.aws_iam_role.this: Refreshing state... [id=secondary-role]
module.secondary.aws_security_group.this: Refreshing state... [id=sg-0c8555944e9d1962b]
module.secondary.aws_instance.this: Refreshing state... [id=i-03677c446f95a626b]
module.secondary.aws_security_group_rule.allow_outbound_subnet_postgres: Refreshing state... [id=sgrule-2600445723]
module.secondary.aws_security_group_rule.allow_outbound_https: Refreshing state... [id=sgrule-4114512701]
module.secondary.aws_iam_role_policy_attachment.this: Refreshing state... [id=secondary-role-20241103184117186500000001]
module.secondary.aws_iam_instance_profile.this: Refreshing state... [id=secondary-instance-profile]
aws_security_group_rule.allow_inbound_connections_from_secondary: Refreshing state... [id=sgrule-3926806608]
module.secondary.aws_security_group_rule.allow_outbound_postgres: Refreshing state... [id=sgrule-3146639608]
aws_iam_user.configuration_deployer: Refreshing state... [id=configuration.deployer]
module.repositories["ticket-tracker"].aws_iam_user.builder: Refreshing state... [id=ticket-tracker-builder]
module.bucket.aws_s3_bucket.this: Refreshing state... [id=uptime-72c009]
module.database.data.aws_iam_policy_document.ec2_assume_role: Refreshing...
module.database.data.aws_iam_policy_document.ec2_assume_role: Refresh complete after 0s [id=2851119427]
aws_route53_zone.opentracker: Refreshing state... [id=Z03017682LQ8TW5YUFGE0]
module.postgres_backups_bucket.aws_s3_bucket.this: Refreshing state... [id=postgres-backups-65ef5c]
aws_iam_role.iac_deployer: Refreshing state... [id=iac-deployer]
module.remote_state_bucket.aws_s3_bucket.this: Refreshing state... [id=terraform-remote-state-5af08d]
module.config_bucket.aws_s3_bucket.this: Refreshing state... [id=configuration-68f6c7]
aws_sns_topic.outages: Refreshing state... [id=arn:aws:sns:eu-west-1:558855412466:outages]
module.repositories["ticket-tracker"].aws_ecr_repository.this: Refreshing state... [id=ticket-tracker]
module.primary.data.aws_iam_policy_document.ec2_assume_role: Refreshing...
module.primary.data.aws_iam_policy_document.ec2_assume_role: Refresh complete after 0s [id=2851119427]
aws_iam_user.postgres_backups: Refreshing state... [id=postgres.backups]
aws_iam_policy.iac_deployer: Refreshing state... [id=arn:aws:iam::558855412466:policy/iac-deployer-policy]
aws_vpc.main: Refreshing state... [id=vpc-0d1ab7c53aec22955]
aws_iam_user.github_actions: Refreshing state... [id=github.actions]
module.database.aws_iam_policy.this: Refreshing state... [id=arn:aws:iam::558855412466:policy/database-policy]
aws_key_pair.main: Refreshing state... [id=macbook-m2-pro]
module.logging_bucket.aws_s3_bucket.this: Refreshing state... [id=logging-4acb18]
module.personal.aws_iam_user.this: Refreshing state... [id=alex.jackson]
module.database.aws_iam_role.this: Refreshing state... [id=database-role]
aws_iam_access_key.configuration_deployer: Refreshing state... [id=AKIAYEHTA3LZKXOXWTYC]
module.repositories["ticket-tracker"].aws_iam_access_key.builder: Refreshing state... [id=AKIAYEHTA3LZAHS7ZJVQ]
module.primary.aws_iam_role.this: Refreshing state... [id=primary-role]
aws_iam_access_key.postgres_backups: Refreshing state... [id=AKIAYEHTA3LZFDVAEC42]
aws_iam_access_key.github_actions: Refreshing state... [id=AKIAYEHTA3LZK6JIHCYE]
aws_iam_user_policy.github_actions: Refreshing state... [id=github.actions:github.actions.policy]
aws_iam_role_policy_attachment.iac_deployer: Refreshing state... [id=iac-deployer-20230421061924179000000001]
module.personal.aws_iam_user_policy.this: Refreshing state... [id=alex.jackson:alex.jackson.policy]
module.personal.aws_iam_access_key.this: Refreshing state... [id=AKIAYEHTA3LZCH5CBE4Y]
module.personal.aws_iam_user_login_profile.this: Refreshing state... [id=alex.jackson]
aws_sns_topic_subscription.outages: Refreshing state... [id=arn:aws:sns:eu-west-1:558855412466:outages:c15a0919-9e06-484e-bef6-08ab63e662d8]
module.database.aws_iam_instance_profile.this: Refreshing state... [id=database-instance-profile]
module.database.aws_iam_role_policy_attachment.this: Refreshing state... [id=database-role-20231230120447701700000002]
module.primary.aws_iam_policy.this: Refreshing state... [id=arn:aws:iam::558855412466:policy/primary-policy]
module.repositories["ticket-tracker"].aws_iam_user_policy.builder: Refreshing state... [id=ticket-tracker-builder:ticket-tracker-builder-policy]
module.primary.aws_iam_instance_profile.this: Refreshing state... [id=primary-instance-profile]
module.primary.aws_iam_role_policy_attachment.this: Refreshing state... [id=primary-role-20241227085051547300000001]
aws_internet_gateway.main: Refreshing state... [id=igw-0aa2c09bec52493fc]
aws_subnet.main: Refreshing state... [id=subnet-07936cc0e5c7d83b1]
module.bucket.aws_s3_bucket_versioning.this: Refreshing state... [id=uptime-72c009]
module.bucket.aws_s3_bucket_lifecycle_configuration.this[0]: Refreshing state... [id=uptime-72c009]
module.postgres_backups_bucket.aws_s3_bucket_versioning.this: Refreshing state... [id=postgres-backups-65ef5c]
aws_iam_user_policy.postgres_backups: Refreshing state... [id=postgres.backups:postgres.backups.policy]
module.config_bucket.aws_s3_bucket_versioning.this: Refreshing state... [id=configuration-68f6c7]
aws_iam_user_policy.configuration_deployer: Refreshing state... [id=configuration.deployer:configuration.deployer.policy]
aws_route_table.gateway: Refreshing state... [id=rtb-0881a403738fea9c7]
module.primary.data.aws_subnet.self: Refreshing...
module.database.data.aws_subnet.self: Refreshing...
module.database.aws_security_group.this: Refreshing state... [id=sg-0998f7db6e1ffb7eb]
module.database.aws_ebs_volume.this: Refreshing state... [id=vol-0ac43ea68879b3895]
module.primary.aws_security_group.this: Refreshing state... [id=sg-05e1eef6a01d93a38]
module.database.data.aws_subnet.self: Refresh complete after 0s [id=subnet-07936cc0e5c7d83b1]
module.primary.data.aws_subnet.self: Refresh complete after 0s [id=subnet-07936cc0e5c7d83b1]
module.remote_state_bucket.aws_s3_bucket_versioning.this: Refreshing state... [id=terraform-remote-state-5af08d]
aws_route_table_association.gateway: Refreshing state... [id=rtbassoc-041dbac3ebba9c5ca]
module.database.aws_instance.this: Refreshing state... [id=i-0e48bcc2a0d16252e]
module.database.aws_security_group_rule.allow_outbound_https: Refreshing state... [id=sgrule-1306823711]
module.database.aws_security_group_rule.allow_inbound_postgres: Refreshing state... [id=sgrule-3465932672]
module.database.aws_security_group_rule.allow_inbound_ssh: Refreshing state... [id=sgrule-3173870365]
module.database.aws_security_group_rule.allow_outbound_http: Refreshing state... [id=sgrule-1983782041]
module.logging_bucket.aws_s3_bucket_versioning.this: Refreshing state... [id=logging-4acb18]
module.primary.aws_security_group_rule.allow_outbound_subnet_postgres: Refreshing state... [id=sgrule-3848927527]
module.primary.aws_security_group_rule.allow_outbound_https: Refreshing state... [id=sgrule-3806605142]
module.primary.aws_security_group_rule.allow_outbound_postgres: Refreshing state... [id=sgrule-2780259477]
module.primary.aws_security_group_rule.allow_inbound_ssh: Refreshing state... [id=sgrule-3080023732]
module.primary.aws_instance.this: Refreshing state... [id=i-05d1af9f4a4c10af6]
module.primary.aws_security_group_rule.allow_outbound_ssh: Refreshing state... [id=sgrule-585439784]
module.primary.aws_security_group_rule.allow_inbound_https: Refreshing state... [id=sgrule-15217594]
module.primary.aws_security_group_rule.allow_outbound_http: Refreshing state... [id=sgrule-3465908759]
aws_security_group_rule.allow_inbound_connections_from_primary: Refreshing state... [id=sgrule-3142298734]
module.database.aws_volume_attachment.this: Refreshing state... [id=vai-3516952077]
module.primary.aws_eip.this: Refreshing state... [id=eipalloc-03efe809ec3322587]
aws_route53_record.records[""]: Refreshing state... [id=Z03017682LQ8TW5YUFGE0__A]
aws_route53_record.records["today"]: Refreshing state... [id=Z03017682LQ8TW5YUFGE0_today_A]
aws_route53_record.records["uptime"]: Refreshing state... [id=Z03017682LQ8TW5YUFGE0_uptime_A]
aws_route53_record.records["tags"]: Refreshing state... [id=Z03017682LQ8TW5YUFGE0_tags_A]
module.database.aws_security_group.this: Drift detected (update)
module.primary.aws_iam_instance_profile.this: Drift detected (update)
module.primary.aws_iam_role.this: Drift detected (update)
module.primary.aws_security_group_rule.allow_outbound_https: Drift detected (update)
module.primary.aws_security_group.this: Drift detected (update)
module.primary.aws_instance.this: Drift detected (update)
module.primary.aws_iam_policy.this: Drift detected (update)
module.primary.aws_eip.this: Drift detected (update)

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

Terraform will perform the following actions:

  # aws_security_group_rule.allow_inbound_connections_from_secondary will be destroyed
  - resource "aws_security_group_rule" "allow_inbound_connections_from_secondary" {
      - description              = "Allow inbound connections from sg-0c8555944e9d1962b" -> null
      - from_port                = 5432 -> null
      - id                       = "sgrule-3926806608" -> null
      - protocol                 = "tcp" -> null
      - security_group_id        = "sg-0998f7db6e1ffb7eb" -> null
      - security_group_rule_id   = "sgr-0d0c2bc1879a44296" -> null
      - self                     = false -> null
      - source_security_group_id = "sg-0c8555944e9d1962b" -> null
      - to_port                  = 5432 -> null
      - type                     = "ingress" -> null
    }

  # module.secondary.aws_eip.this will be destroyed
  - resource "aws_eip" "this" {
      - allocation_id            = "eipalloc-00b8a37f228be09f5" -> null
      - association_id           = "eipassoc-0a8a121cbecf5a6d5" -> null
      - domain                   = "vpc" -> null
      - id                       = "eipalloc-00b8a37f228be09f5" -> null
      - instance                 = "i-03677c446f95a626b" -> null
      - network_border_group     = "eu-west-1" -> null
      - network_interface        = "eni-0609885a03beeed39" -> null
      - private_dns              = "ip-10-0-0-145.eu-west-1.compute.internal" -> null
      - private_ip               = "10.0.0.145" -> null
      - public_dns               = "ec2-18-202-4-126.eu-west-1.compute.amazonaws.com" -> null
      - public_ip                = "18.202.4.126" -> null
      - public_ipv4_pool         = "amazon" -> null
      - tags                     = {} -> null
      - tags_all                 = {} -> null
      - vpc                      = true -> null
        # (3 unchanged attributes hidden)
    }

  # module.secondary.aws_iam_instance_profile.this will be destroyed
  - resource "aws_iam_instance_profile" "this" {
      - arn         = "arn:aws:iam::558855412466:instance-profile/secondary-instance-profile" -> null
      - create_date = "2024-11-03T18:41:17Z" -> null
      - id          = "secondary-instance-profile" -> null
      - name        = "secondary-instance-profile" -> null
      - path        = "/" -> null
      - role        = "secondary-role" -> null
      - tags        = {} -> null
      - tags_all    = {} -> null
      - unique_id   = "AIPAYEHTA3LZD7ME2H6UL" -> null
        # (1 unchanged attribute hidden)
    }

  # module.secondary.aws_iam_policy.this will be destroyed
  - resource "aws_iam_policy" "this" {
      - arn         = "arn:aws:iam::558855412466:policy/secondary-policy" -> null
      - description = "Policy for secondary-role" -> null
      - id          = "arn:aws:iam::558855412466:policy/secondary-policy" -> null
      - name        = "secondary-policy" -> null
      - path        = "/" -> null
      - policy      = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = [
                          - "s3:ListBucket",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:s3:::configuration-68f6c7"
                    },
                  - {
                      - Action   = [
                          - "s3:GetObject",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:s3:::configuration-68f6c7/*"
                    },
                  - {
                      - Action   = [
                          - "route53:ListHostedZones",
                          - "route53:GetChange",
                        ]
                      - Effect   = "Allow"
                      - Resource = "*"
                    },
                  - {
                      - Action   = [
                          - "route53:ChangeResourceRecordSets",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:route53:::hostedzone/Z03017682LQ8TW5YUFGE0"
                    },
                  - {
                      - Action   = [
                          - "s3:ListBucket",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:s3:::logging-4acb18"
                    },
                  - {
                      - Action   = [
                          - "s3:PutObject",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:s3:::logging-4acb18/*"
                    },
                  - {
                      - Action   = [
                          - "s3:PutObject",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:s3:::postgres-backups-65ef5c/*"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - policy_id   = "ANPAYEHTA3LZDXUE5RQHU" -> null
      - tags        = {} -> null
      - tags_all    = {} -> null
        # (1 unchanged attribute hidden)
    }

  # module.secondary.aws_iam_role.this will be destroyed
  - resource "aws_iam_role" "this" {
      - arn                   = "arn:aws:iam::558855412466:role/secondary-role" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRole"
                      - Effect    = "Allow"
                      - Principal = {
                          - Service = "ec2.amazonaws.com"
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2024-11-03T18:41:16Z" -> null
      - description           = "Role for the secondary instance" -> null
      - force_detach_policies = false -> null
      - id                    = "secondary-role" -> null
      - managed_policy_arns   = [
          - "arn:aws:iam::558855412466:policy/secondary-policy",
        ] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "secondary-role" -> null
      - path                  = "/" -> null
      - tags                  = {} -> null
      - tags_all              = {} -> null
      - unique_id             = "AROAYEHTA3LZAGZ2MSFGX" -> null
        # (2 unchanged attributes hidden)
    }

  # module.secondary.aws_iam_role_policy_attachment.this will be destroyed
  - resource "aws_iam_role_policy_attachment" "this" {
      - id         = "secondary-role-20241103184117186500000001" -> null
      - policy_arn = "arn:aws:iam::558855412466:policy/secondary-policy" -> null
      - role       = "secondary-role" -> null
    }

  # module.secondary.aws_instance.this will be destroyed
  - resource "aws_instance" "this" {
      - ami                                  = "ami-0ab14756db2442499" -> null
      - arn                                  = "arn:aws:ec2:eu-west-1:558855412466:instance/i-03677c446f95a626b" -> null
      - associate_public_ip_address          = true -> null
      - availability_zone                    = "eu-west-1a" -> null
      - cpu_core_count                       = 1 -> null
      - cpu_threads_per_core                 = 1 -> null
      - disable_api_stop                     = false -> null
      - disable_api_termination              = false -> null
      - ebs_optimized                        = false -> null
      - get_password_data                    = false -> null
      - hibernation                          = false -> null
      - iam_instance_profile                 = "secondary-instance-profile" -> null
      - id                                   = "i-03677c446f95a626b" -> null
      - instance_initiated_shutdown_behavior = "stop" -> null
      - instance_state                       = "running" -> null
      - instance_type                        = "t2.nano" -> null
      - ipv6_address_count                   = 0 -> null
      - ipv6_addresses                       = [] -> null
      - key_name                             = "macbook-m2-pro" -> null
      - monitoring                           = false -> null
      - placement_partition_number           = 0 -> null
      - primary_network_interface_id         = "eni-0609885a03beeed39" -> null
      - private_dns                          = "ip-10-0-0-145.eu-west-1.compute.internal" -> null
      - private_ip                           = "10.0.0.145" -> null
      - public_dns                           = "ec2-18-202-4-126.eu-west-1.compute.amazonaws.com" -> null
      - public_ip                            = "18.202.4.126" -> null
      - secondary_private_ips                = [] -> null
      - security_groups                      = [] -> null
      - source_dest_check                    = true -> null
      - subnet_id                            = "subnet-07936cc0e5c7d83b1" -> null
      - tags                                 = {} -> null
      - tags_all                             = {} -> null
      - tenancy                              = "default" -> null
      - user_data                            = "da98451c9200c93119ababe67370800c0ec4b05f" -> null
      - user_data_replace_on_change          = false -> null
      - vpc_security_group_ids               = [
          - "sg-0c8555944e9d1962b",
        ] -> null
        # (6 unchanged attributes hidden)

      - capacity_reservation_specification {
          - capacity_reservation_preference = "open" -> null
        }

      - cpu_options {
          - core_count       = 1 -> null
          - threads_per_core = 1 -> null
            # (1 unchanged attribute hidden)
        }

      - credit_specification {
          - cpu_credits = "standard" -> null
        }

      - enclave_options {
          - enabled = false -> null
        }

      - maintenance_options {
          - auto_recovery = "default" -> null
        }

      - metadata_options {
          - http_endpoint               = "enabled" -> null
          - http_protocol_ipv6          = "disabled" -> null
          - http_put_response_hop_limit = 2 -> null
          - http_tokens                 = "optional" -> null
          - instance_metadata_tags      = "disabled" -> null
        }

      - private_dns_name_options {
          - enable_resource_name_dns_a_record    = false -> null
          - enable_resource_name_dns_aaaa_record = false -> null
          - hostname_type                        = "ip-name" -> null
        }

      - root_block_device {
          - delete_on_termination = true -> null
          - device_name           = "/dev/sda1" -> null
          - encrypted             = false -> null
          - iops                  = 100 -> null
          - tags                  = {} -> null
          - throughput            = 0 -> null
          - volume_id             = "vol-0c17bb6a8f3444f92" -> null
          - volume_size           = 8 -> null
          - volume_type           = "gp2" -> null
            # (1 unchanged attribute hidden)
        }
    }

  # module.secondary.aws_security_group.this will be destroyed
  - resource "aws_security_group" "this" {
      - arn                    = "arn:aws:ec2:eu-west-1:558855412466:security-group/sg-0c8555944e9d1962b" -> null
      - description            = "Security group for the secondary f2-instance" -> null
      - egress                 = [
          - {
              - cidr_blocks      = [
                  - "0.0.0.0/0",
                ]
              - description      = "Allow outbound HTTP to anywhere"
              - from_port        = 80
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = []
              - self             = false
              - to_port          = 80
            },
          - {
              - cidr_blocks      = [
                  - "0.0.0.0/0",
                ]
              - description      = "Allow outbound HTTPS to anywhere"
              - from_port        = 443
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = []
              - self             = false
              - to_port          = 443
            },
          - {
              - cidr_blocks      = [
                  - "0.0.0.0/0",
                ]
              - description      = "Allow outbound SSH to anywhere"
              - from_port        = 22
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = []
              - self             = false
              - to_port          = 22
            },
          - {
              - cidr_blocks      = [
                  - "10.0.0.0/24",
                ]
              - description      = "Allow outbound Postgres to the subnet"
              - from_port        = 5432
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = []
              - self             = false
              - to_port          = 5432
            },
          - {
              - cidr_blocks      = [
                  - "64.227.33.121/32",
                ]
              - description      = "Allow outbound Postgres to the Digital Ocean instance"
              - from_port        = 5432
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = []
              - self             = false
              - to_port          = 5432
            },
        ] -> null
      - id                     = "sg-0c8555944e9d1962b" -> null
      - ingress                = [
          - {
              - cidr_blocks      = [
                  - "0.0.0.0/0",
                ]
              - description      = "Allow inbound HTTPS from anywhere"
              - from_port        = 443
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = []
              - self             = false
              - to_port          = 443
            },
          - {
              - cidr_blocks      = [
                  - "0.0.0.0/0",
                ]
              - description      = "Allow inbound SSH from anywhere"
              - from_port        = 22
              - ipv6_cidr_blocks = []
              - prefix_list_ids  = []
              - protocol         = "tcp"
              - security_groups  = []
              - self             = false
              - to_port          = 22
            },
        ] -> null
      - name                   = "secondary-f2-instance" -> null
      - owner_id               = "558855412466" -> null
      - revoke_rules_on_delete = false -> null
      - tags                   = {} -> null
      - tags_all               = {} -> null
      - vpc_id                 = "vpc-0d1ab7c53aec22955" -> null
        # (1 unchanged attribute hidden)
    }

  # module.secondary.aws_security_group_rule.allow_inbound_https will be destroyed
  - resource "aws_security_group_rule" "allow_inbound_https" {
      - cidr_blocks            = [
          - "0.0.0.0/0",
        ] -> null
      - description            = "Allow inbound HTTPS from anywhere" -> null
      - from_port              = 443 -> null
      - id                     = "sgrule-3667874110" -> null
      - protocol               = "tcp" -> null
      - security_group_id      = "sg-0c8555944e9d1962b" -> null
      - security_group_rule_id = "sgr-0db7b961e3eedb8b5" -> null
      - self                   = false -> null
      - to_port                = 443 -> null
      - type                   = "ingress" -> null
    }

  # module.secondary.aws_security_group_rule.allow_inbound_ssh will be destroyed
  - resource "aws_security_group_rule" "allow_inbound_ssh" {
      - cidr_blocks            = [
          - "0.0.0.0/0",
        ] -> null
      - description            = "Allow inbound SSH from anywhere" -> null
      - from_port              = 22 -> null
      - id                     = "sgrule-3665774122" -> null
      - protocol               = "tcp" -> null
      - security_group_id      = "sg-0c8555944e9d1962b" -> null
      - security_group_rule_id = "sgr-0587585cd50d52bb3" -> null
      - self                   = false -> null
      - to_port                = 22 -> null
      - type                   = "ingress" -> null
    }

  # module.secondary.aws_security_group_rule.allow_outbound_http will be destroyed
  - resource "aws_security_group_rule" "allow_outbound_http" {
      - cidr_blocks            = [
          - "0.0.0.0/0",
        ] -> null
      - description            = "Allow outbound HTTP to anywhere" -> null
      - from_port              = 80 -> null
      - id                     = "sgrule-4183418626" -> null
      - protocol               = "tcp" -> null
      - security_group_id      = "sg-0c8555944e9d1962b" -> null
      - security_group_rule_id = "sgr-0faf4e5d88eeef5ff" -> null
      - self                   = false -> null
      - to_port                = 80 -> null
      - type                   = "egress" -> null
    }

  # module.secondary.aws_security_group_rule.allow_outbound_https will be destroyed
  - resource "aws_security_group_rule" "allow_outbound_https" {
      - cidr_blocks            = [
          - "0.0.0.0/0",
        ] -> null
      - description            = "Allow outbound HTTPS to anywhere" -> null
      - from_port              = 443 -> null
      - id                     = "sgrule-4114512701" -> null
      - protocol               = "tcp" -> null
      - security_group_id      = "sg-0c8555944e9d1962b" -> null
      - security_group_rule_id = "sgr-03c4483b740467158" -> null
      - self                   = false -> null
      - to_port                = 443 -> null
      - type                   = "egress" -> null
    }

  # module.secondary.aws_security_group_rule.allow_outbound_postgres will be destroyed
  - resource "aws_security_group_rule" "allow_outbound_postgres" {
      - cidr_blocks            = [
          - "64.227.33.121/32",
        ] -> null
      - description            = "Allow outbound Postgres to the Digital Ocean instance" -> null
      - from_port              = 5432 -> null
      - id                     = "sgrule-3146639608" -> null
      - protocol               = "tcp" -> null
      - security_group_id      = "sg-0c8555944e9d1962b" -> null
      - security_group_rule_id = "sgr-043ca4abccca188db" -> null
      - self                   = false -> null
      - to_port                = 5432 -> null
      - type                   = "egress" -> null
    }

  # module.secondary.aws_security_group_rule.allow_outbound_ssh will be destroyed
  - resource "aws_security_group_rule" "allow_outbound_ssh" {
      - cidr_blocks            = [
          - "0.0.0.0/0",
        ] -> null
      - description            = "Allow outbound SSH to anywhere" -> null
      - from_port              = 22 -> null
      - id                     = "sgrule-355036989" -> null
      - protocol               = "tcp" -> null
      - security_group_id      = "sg-0c8555944e9d1962b" -> null
      - security_group_rule_id = "sgr-086e01a41372a0e8e" -> null
      - self                   = false -> null
      - to_port                = 22 -> null
      - type                   = "egress" -> null
    }

  # module.secondary.aws_security_group_rule.allow_outbound_subnet_postgres will be destroyed
  - resource "aws_security_group_rule" "allow_outbound_subnet_postgres" {
      - cidr_blocks            = [
          - "10.0.0.0/24",
        ] -> null
      - description            = "Allow outbound Postgres to the subnet" -> null
      - from_port              = 5432 -> null
      - id                     = "sgrule-2600445723" -> null
      - protocol               = "tcp" -> null
      - security_group_id      = "sg-0c8555944e9d1962b" -> null
      - security_group_rule_id = "sgr-02ea84ee90c97df86" -> null
      - self                   = false -> null
      - to_port                = 5432 -> null
      - type                   = "egress" -> null
    }

Plan: 0 to add, 0 to change, 15 to destroy.

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

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

@alexander-jackson alexander-jackson merged commit 5a2a56a into master Dec 27, 2024
1 check passed
@alexander-jackson alexander-jackson deleted the feat/tear-down-old-instance branch December 27, 2024 09:03
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