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: add local refresh script #198

Merged
merged 16 commits into from
Aug 15, 2024
Merged

feat: add local refresh script #198

merged 16 commits into from
Aug 15, 2024

Conversation

JoshuaLicense
Copy link
Contributor

@JoshuaLicense JoshuaLicense commented Jul 31, 2024

Description

Adds a local refresh script that will let the user choose which part of the local environment to refresh with consistent data.

The main aim of this script is to automate some of the onboarding steps. It also aims to provide a base to add new commands. This will be as simple as adding a class that implements the ActionInterface.

@JoshuaLicense JoshuaLicense self-assigned this Jul 31, 2024
packages/local-refresh/index.ts Dismissed Show dismissed Hide dismissed
Copy link
Contributor

github-actions bot commented Aug 6, 2024

Terraform plan for environment: int

Commit: f481cc1

API version: 672b160
CLI version: a66abc4
Selfserve version: a66abc4
Internal version: a66abc4

Plan summary

1 to add, 2 to change, 0 to destroy

🆕 Creates

module.service.module.ecs_service["api"].aws_ecs_task_definition.this[0]

📖 Reads

module.service.module.ecs_service["api"].data.aws_ecs_task_definition.this[0]

🔄 Updates

module.service.module.cloudfront.aws_cloudfront_distribution.this[0]
module.service.module.ecs_service["api"].aws_ecs_service.this[0]

Show full plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place
+/- create replacement and then destroy
 <= read (data resources)

Terraform will perform the following actions:

  # module.service.module.cloudfront.aws_cloudfront_distribution.this[0] will be updated in-place
  ~ resource "aws_cloudfront_distribution" "this" {
        id                              = "E1GZYPKGUFNMP4"
        tags                            = {}
        # (22 unchanged attributes hidden)

      - origin {
          - connection_attempts      = 3 -> null
          - connection_timeout       = 10 -> null
          - domain_name              = "vol-app-assets.s3.eu-west-1.amazonaws.com" -> null
          - origin_access_control_id = "EPZSCA6LNS9ZN" -> null
          - origin_id                = "s3_oac_int" -> null
          - origin_path              = "/8c2320a" -> null
        }
      + origin {
          + connection_attempts      = 3
          + connection_timeout       = 10
          + domain_name              = "vol-app-assets.s3.eu-west-1.amazonaws.com"
          + origin_access_control_id = "EPZSCA6LNS9ZN"
          + origin_id                = "s3_oac_int"
          + origin_path              = "/0da2aa8"
        }

        # (5 unchanged blocks hidden)
    }

  # module.service.module.ecs_service["api"].data.aws_ecs_task_definition.this[0] will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_ecs_task_definition" "this" {
      + arn                  = (known after apply)
      + arn_without_revision = (known after apply)
      + execution_role_arn   = (known after apply)
      + family               = (known after apply)
      + id                   = (known after apply)
      + network_mode         = (known after apply)
      + revision             = (known after apply)
      + status               = (known after apply)
      + task_definition      = "vol-app-int-api-service"
      + task_role_arn        = (known after apply)
    }

  # module.service.module.ecs_service["api"].aws_ecs_service.this[0] will be updated in-place
  ~ resource "aws_ecs_service" "this" {
        id                                 = "arn:aws:ecs:eu-west-1:054614622558:service/vol-app-int-api-cluster/vol-app-int-api-service"
        name                               = "vol-app-int-api-service"
        tags                               = {}
      ~ task_definition                    = "vol-app-int-api-service:4" -> (known after apply)
        # (16 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

  # module.service.module.ecs_service["api"].aws_ecs_task_definition.this[0] must be replaced
+/- resource "aws_ecs_task_definition" "this" {
      ~ arn                      = "arn:aws:ecs:eu-west-1:054614622558:task-definition/vol-app-int-api-service:4" -> (known after apply)
      ~ arn_without_revision     = "arn:aws:ecs:eu-west-1:054614622558:task-definition/vol-app-int-api-service" -> (known after apply)
      ~ container_definitions    = jsonencode(
          ~ [
              ~ {
                  ~ environment            = [
                      ~ {
                            name  = "APP_VERSION"
                          ~ value = "a66abc4" -> "672b160"
                        },
                        {
                            name  = "ENVIRONMENT_NAME"
                            value = "QA"
                        },
                    ]
                  ~ image                  = "054614622558.dkr.ecr.eu-west-1.amazonaws.com/vol-app/api:a66abc4" -> "054614622558.dkr.ecr.eu-west-1.amazonaws.com/vol-app/api:672b160"
                    name                   = "api"
                    # (13 unchanged attributes hidden)
                },
            ] # forces replacement
        )
      ~ id                       = "vol-app-int-api-service" -> (known after apply)
      ~ revision                 = 4 -> (known after apply)
      - tags                     = {} -> null
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Terraform plan for environment: dev

Commit: f481cc1

API version: 672b160
CLI version: a66abc4
Selfserve version: a66abc4
Internal version: a66abc4

Plan summary

1 to add, 2 to change, 0 to destroy

🆕 Creates

module.service.module.ecs_service["api"].aws_ecs_task_definition.this[0]

📖 Reads

module.service.module.ecs_service["api"].data.aws_ecs_task_definition.this[0]

🔄 Updates

module.service.module.cloudfront.aws_cloudfront_distribution.this[0]
module.service.module.ecs_service["api"].aws_ecs_service.this[0]

Show full plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place
+/- create replacement and then destroy
 <= read (data resources)

Terraform will perform the following actions:

  # module.service.module.cloudfront.aws_cloudfront_distribution.this[0] will be updated in-place
  ~ resource "aws_cloudfront_distribution" "this" {
        id                              = "E3R9S2AKJG4ZTR"
        tags                            = {}
        # (22 unchanged attributes hidden)

      - origin {
          - connection_attempts      = 3 -> null
          - connection_timeout       = 10 -> null
          - domain_name              = "vol-app-assets.s3.eu-west-1.amazonaws.com" -> null
          - origin_access_control_id = "E36O3W59HN75PX" -> null
          - origin_id                = "s3_oac_dev" -> null
          - origin_path              = "/8c2320a" -> null
        }
      + origin {
          + connection_attempts      = 3
          + connection_timeout       = 10
          + domain_name              = "vol-app-assets.s3.eu-west-1.amazonaws.com"
          + origin_access_control_id = "E36O3W59HN75PX"
          + origin_id                = "s3_oac_dev"
          + origin_path              = "/0da2aa8"
        }

        # (5 unchanged blocks hidden)
    }

  # module.service.module.ecs_service["api"].data.aws_ecs_task_definition.this[0] will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "aws_ecs_task_definition" "this" {
      + arn                  = (known after apply)
      + arn_without_revision = (known after apply)
      + execution_role_arn   = (known after apply)
      + family               = (known after apply)
      + id                   = (known after apply)
      + network_mode         = (known after apply)
      + revision             = (known after apply)
      + status               = (known after apply)
      + task_definition      = "vol-app-dev-api-service"
      + task_role_arn        = (known after apply)
    }

  # module.service.module.ecs_service["api"].aws_ecs_service.this[0] will be updated in-place
  ~ resource "aws_ecs_service" "this" {
        id                                 = "arn:aws:ecs:eu-west-1:054614622558:service/vol-app-dev-api-cluster/vol-app-dev-api-service"
        name                               = "vol-app-dev-api-service"
        tags                               = {}
      ~ task_definition                    = "vol-app-dev-api-service:30" -> (known after apply)
        # (16 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

  # module.service.module.ecs_service["api"].aws_ecs_task_definition.this[0] must be replaced
+/- resource "aws_ecs_task_definition" "this" {
      ~ arn                      = "arn:aws:ecs:eu-west-1:054614622558:task-definition/vol-app-dev-api-service:30" -> (known after apply)
      ~ arn_without_revision     = "arn:aws:ecs:eu-west-1:054614622558:task-definition/vol-app-dev-api-service" -> (known after apply)
      ~ container_definitions    = jsonencode(
          ~ [
              ~ {
                  ~ environment            = [
                      ~ {
                            name  = "APP_VERSION"
                          ~ value = "a66abc4" -> "672b160"
                        },
                        {
                            name  = "ENVIRONMENT_NAME"
                            value = "DEV"
                        },
                    ]
                  ~ image                  = "054614622558.dkr.ecr.eu-west-1.amazonaws.com/vol-app/api:a66abc4" -> "054614622558.dkr.ecr.eu-west-1.amazonaws.com/vol-app/api:672b160"
                    name                   = "api"
                    # (13 unchanged attributes hidden)
                },
            ] # forces replacement
        )
      ~ id                       = "vol-app-dev-api-service" -> (known after apply)
      ~ revision                 = 30 -> (known after apply)
      - tags                     = {} -> null
        # (12 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

Copy link
Contributor

Terraform plan for account: nonprod

Commit: f481cc1

Plan summary

0 to add, 0 to change, 0 to destroy


Show full plan
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.

@JoshuaLicense JoshuaLicense marked this pull request as ready for review August 14, 2024 15:04
@JoshuaLicense JoshuaLicense merged commit 4c597f5 into main Aug 15, 2024
20 checks passed
@JoshuaLicense JoshuaLicense deleted the add-local-refresh-script branch August 15, 2024 14:25
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.

2 participants