Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

fix: add CORS configuration to enable queries from browsers. #58

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

xav
Copy link
Contributor

@xav xav commented Jul 7, 2023

Description

Simplifies the CORS configuration since there are no cases yet where we need restrictions and the dynamic way seems broken.

Resolves #57

How Has This Been Tested?

cargo test

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@xav xav linked an issue Jul 7, 2023 that may be closed by this pull request
1 task
@xav xav temporarily deployed to infra/staging July 7, 2023 15:14 — with GitHub Actions Inactive
@xav xav temporarily deployed to infra/prod July 7, 2023 15:14 — with GitHub Actions Inactive
@xav xav requested review from arein and Rakowskiii July 7, 2023 15:15
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

Show Plan

[command]/home/runner/work/_temp/2e24f93b-126b-42fb-9923-5edba182ba38/terraform-bin -chdir=terraform show -no-color /tmp/plan.tfplan

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

Terraform will perform the following actions:

  # module.ecs.aws_ecs_service.app_service will be updated in-place
  ~ resource "aws_ecs_service" "app_service" {
        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-prod-history/walletconnect-prod-history-service"
        name                               = "walletconnect-prod-history-service"
      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)
        # (14 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced
-/+ resource "aws_ecs_task_definition" "app_task_definition" {
      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)
      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history" -> (known after apply)
      ~ container_definitions    = (sensitive value) # forces replacement
      ~ id                       = "walletconnect-prod-history" -> (known after apply)
      ~ revision                 = 15 -> (known after apply)
      - tags                     = {} -> null
        # (9 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 1 to change, 1 to destroy.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  ~ update in-place%0A-/+ destroy and then create replacement%0A%0ATerraform will perform the following actions:%0A%0A  # module.ecs.aws_ecs_service.app_service will be updated in-place%0A  ~ resource "aws_ecs_service" "app_service" {%0A        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-prod-history/walletconnect-prod-history-service"%0A        name                               = "walletconnect-prod-history-service"%0A      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"%0A        tags                               = {}%0A      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)%0A        # (14 unchanged attributes hidden)%0A%0A        # (4 unchanged blocks hidden)%0A    }%0A%0A  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced%0A-/+ resource "aws_ecs_task_definition" "app_task_definition" {%0A      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)%0A      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history" -> (known after apply)%0A      ~ container_definitions    = (sensitive value) # forces replacement%0A      ~ id                       = "walletconnect-prod-history" -> (known after apply)%0A      ~ revision                 = 15 -> (known after apply)%0A      - tags                     = {} -> null%0A        # (9 unchanged attributes hidden)%0A%0A        # (1 unchanged block hidden)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

Action: pull_request

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

Show Plan

[command]/home/runner/work/_temp/a8c2e99d-5936-4040-94dd-b98b8735aab0/terraform-bin -chdir=terraform show -no-color /tmp/plan.tfplan

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

Terraform will perform the following actions:

  # module.ecs.aws_ecs_service.app_service will be updated in-place
  ~ resource "aws_ecs_service" "app_service" {
        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-staging-history/walletconnect-staging-history-service"
        name                               = "walletconnect-staging-history-service"
      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)
        # (14 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced
-/+ resource "aws_ecs_task_definition" "app_task_definition" {
      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)
      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history" -> (known after apply)
      ~ container_definitions    = (sensitive value) # forces replacement
      ~ id                       = "walletconnect-staging-history" -> (known after apply)
      ~ revision                 = 18 -> (known after apply)
      - tags                     = {} -> null
        # (9 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 1 to change, 1 to destroy.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  ~ update in-place%0A-/+ destroy and then create replacement%0A%0ATerraform will perform the following actions:%0A%0A  # module.ecs.aws_ecs_service.app_service will be updated in-place%0A  ~ resource "aws_ecs_service" "app_service" {%0A        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-staging-history/walletconnect-staging-history-service"%0A        name                               = "walletconnect-staging-history-service"%0A      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"%0A        tags                               = {}%0A      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)%0A        # (14 unchanged attributes hidden)%0A%0A        # (4 unchanged blocks hidden)%0A    }%0A%0A  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced%0A-/+ resource "aws_ecs_task_definition" "app_task_definition" {%0A      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)%0A      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history" -> (known after apply)%0A      ~ container_definitions    = (sensitive value) # forces replacement%0A      ~ id                       = "walletconnect-staging-history" -> (known after apply)%0A      ~ revision                 = 18 -> (known after apply)%0A      - tags                     = {} -> null%0A        # (9 unchanged attributes hidden)%0A%0A        # (1 unchanged block hidden)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

Action: pull_request

@xav xav force-pushed the 57-cors-headers-are-misconfiguredmissing branch from 7d11232 to 5a8e62e Compare July 7, 2023 15:44
@xav xav temporarily deployed to infra/prod July 7, 2023 15:45 — with GitHub Actions Inactive
@xav xav temporarily deployed to infra/staging July 7, 2023 15:45 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

Show Plan

[command]/home/runner/work/_temp/8bd12fe8-37cf-4b1f-8ba0-70c4eb869321/terraform-bin -chdir=terraform show -no-color /tmp/plan.tfplan

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

Terraform will perform the following actions:

  # module.ecs.aws_ecs_service.app_service will be updated in-place
  ~ resource "aws_ecs_service" "app_service" {
        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-staging-history/walletconnect-staging-history-service"
        name                               = "walletconnect-staging-history-service"
      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)
        # (14 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced
-/+ resource "aws_ecs_task_definition" "app_task_definition" {
      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)
      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history" -> (known after apply)
      ~ container_definitions    = (sensitive value) # forces replacement
      ~ id                       = "walletconnect-staging-history" -> (known after apply)
      ~ revision                 = 18 -> (known after apply)
      - tags                     = {} -> null
        # (9 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 1 to change, 1 to destroy.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  ~ update in-place%0A-/+ destroy and then create replacement%0A%0ATerraform will perform the following actions:%0A%0A  # module.ecs.aws_ecs_service.app_service will be updated in-place%0A  ~ resource "aws_ecs_service" "app_service" {%0A        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-staging-history/walletconnect-staging-history-service"%0A        name                               = "walletconnect-staging-history-service"%0A      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"%0A        tags                               = {}%0A      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)%0A        # (14 unchanged attributes hidden)%0A%0A        # (4 unchanged blocks hidden)%0A    }%0A%0A  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced%0A-/+ resource "aws_ecs_task_definition" "app_task_definition" {%0A      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history:18" -> (known after apply)%0A      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-staging-history" -> (known after apply)%0A      ~ container_definitions    = (sensitive value) # forces replacement%0A      ~ id                       = "walletconnect-staging-history" -> (known after apply)%0A      ~ revision                 = 18 -> (known after apply)%0A      - tags                     = {} -> null%0A        # (9 unchanged attributes hidden)%0A%0A        # (1 unchanged block hidden)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

Action: pull_request

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

Show Plan

[command]/home/runner/work/_temp/d2be9f0a-5011-42ac-b67d-3bede9b01470/terraform-bin -chdir=terraform show -no-color /tmp/plan.tfplan

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

Terraform will perform the following actions:

  # module.ecs.aws_ecs_service.app_service will be updated in-place
  ~ resource "aws_ecs_service" "app_service" {
        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-prod-history/walletconnect-prod-history-service"
        name                               = "walletconnect-prod-history-service"
      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)
        # (14 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced
-/+ resource "aws_ecs_task_definition" "app_task_definition" {
      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)
      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history" -> (known after apply)
      ~ container_definitions    = (sensitive value) # forces replacement
      ~ id                       = "walletconnect-prod-history" -> (known after apply)
      ~ revision                 = 15 -> (known after apply)
      - tags                     = {} -> null
        # (9 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 1 to change, 1 to destroy.
::debug::Terraform exited with code 0.
::debug::stdout: %0ATerraform used the selected providers to generate the following execution%0Aplan. Resource actions are indicated with the following symbols:%0A  ~ update in-place%0A-/+ destroy and then create replacement%0A%0ATerraform will perform the following actions:%0A%0A  # module.ecs.aws_ecs_service.app_service will be updated in-place%0A  ~ resource "aws_ecs_service" "app_service" {%0A        id                                 = "arn:aws:ecs:eu-central-1:898587786287:service/walletconnect-prod-history/walletconnect-prod-history-service"%0A        name                               = "walletconnect-prod-history-service"%0A      ~ propagate_tags                     = "NONE" -> "TASK_DEFINITION"%0A        tags                               = {}%0A      ~ task_definition                    = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)%0A        # (14 unchanged attributes hidden)%0A%0A        # (4 unchanged blocks hidden)%0A    }%0A%0A  # module.ecs.aws_ecs_task_definition.app_task_definition must be replaced%0A-/+ resource "aws_ecs_task_definition" "app_task_definition" {%0A      ~ arn                      = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history:15" -> (known after apply)%0A      ~ arn_without_revision     = "arn:aws:ecs:eu-central-1:898587786287:task-definition/walletconnect-prod-history" -> (known after apply)%0A      ~ container_definitions    = (sensitive value) # forces replacement%0A      ~ id                       = "walletconnect-prod-history" -> (known after apply)%0A      ~ revision                 = 15 -> (known after apply)%0A      - tags                     = {} -> null%0A        # (9 unchanged attributes hidden)%0A%0A        # (1 unchanged block hidden)%0A    }%0A%0APlan: 1 to add, 1 to change, 1 to destroy.%0A
::debug::stderr: 
::debug::exitcode: 0

Action: pull_request

Copy link
Member

@arein arein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take a note for when you re-enable the integ tests to cover this there to prevent regressions?

@xav
Copy link
Contributor Author

xav commented Jul 10, 2023

Can you take a note for when you re-enable the integ tests to cover this there to prevent regressions?

#59

@xav xav added this pull request to the merge queue Jul 10, 2023
Merged via the queue into main with commit 02b668f Jul 10, 2023
@xav xav deleted the 57-cors-headers-are-misconfiguredmissing branch July 10, 2023 06:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CORS headers are misconfigured/missing
2 participants