-
Notifications
You must be signed in to change notification settings - Fork 0
feat(api): setup core api #6
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
Open
LancelotP
wants to merge
14
commits into
main
Choose a base branch
from
feat/core-api-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added .nx/cache and .nx/workspace-data to .gitignore for improved repository cleanliness. - Introduced nx.json for Nx workspace configuration. - Updated package.json to include Nx and NestJS schematics as development dependencies. - Created pnpm-workspace.yaml to define workspace settings for Nx.
- Introduced .npmrc for npm configuration settings. - Added .prettierignore and .prettierrc for code formatting preferences. - Created eslint.config.mjs for ESLint configuration. - Added jest.config.ts and jest.preset.js for Jest testing setup. - Updated nx.json for Nx workspace configuration. - Created tsconfig.base.json and tsconfig.json for TypeScript configuration. - Added Dockerfile for API service deployment. - Introduced initial API module with controller, service, and tests. - Set up API end-to-end tests with axios for integration testing.
- Introduced pull-request.yml to automate linting, testing, and deployment processes for pull requests. - Configured jobs for linting, testing, and building the application, along with determining actions based on pull request context. - Added deployment and cleanup steps for managing preview environments using Tofu. - Enhanced workflow clarity and maintainability by structuring jobs and steps effectively.
- Introduced new Terraform files for the API module, including container, database, outputs, registry, storage, variables, and versions. - Enhanced infrastructure management by defining project-specific variables and outputs for Scaleway resources. - Established a clear structure for API deployment within the infrastructure setup.
- Removed outdated GitHub provider configurations from .terraform.lock.hcl files across dev, staging, preview, and prod environments. - Added Scaleway provider configurations with version 2.56.0 and updated hash values for consistency. - Ensured alignment of provider settings across all environment lock files for improved infrastructure management.
- Introduced new variables for environment name and GitHub repository name in variables.tf. - Added GitHub Actions environment variable configuration for API registry endpoint in registry.tf. - Updated main.tf to pass new variables to the API module for improved infrastructure management.
|
OpenTofu plan for Core Plan: 0 to add, 1 to change, 0 to destroy.OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
!~ update in-place
OpenTofu will perform the following actions:
# github_repository_ruleset.default_branch will be updated in-place
!~ resource "github_repository_ruleset" "default_branch" {
id = "6344556"
name = "default_branch_ruleset"
# (6 unchanged attributes hidden)
!~ bypass_actors {
!~ actor_id = 0 -> 1
# (2 unchanged attributes hidden)
}
# (2 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Warning: Multiple variable sources detected, please make sure the right credentials are used
with provider["registry.opentofu.org/scaleway/scaleway"],
on main.tf line 1, in provider "scaleway":
1: provider "scaleway" {
Variable AvailableSources Using
SCW_ACCESS_KEY Profile defined in provider{} block, Environment variable
Environment variable
SCW_SECRET_KEY Profile defined in provider{} block, Environment variable
Environment variable📝 Plan generated in Tofu - Plan #72 |
|
OpenTofu plan for prod Plan: 7 to add, 0 to change, 0 to destroy. Changes to Outputs.OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
OpenTofu will perform the following actions:
# module.environment.module.api.github_actions_environment_variable.api_registry_endpoint will be created
+ resource "github_actions_environment_variable" "api_registry_endpoint" {
+ created_at = (known after apply)
+ environment = "prod"
+ id = (known after apply)
+ repository = "toolbox"
+ updated_at = (known after apply)
+ value = (known after apply)
+ variable_name = "API_REGISTRY_ENDPOINT"
}
# module.environment.module.api.scaleway_container.api will be created
+ resource "scaleway_container" "api" {
+ cpu_limit = 70
+ cron_status = (known after apply)
+ deploy = true
+ domain_name = (known after apply)
+ environment_variables = (known after apply)
+ error_message = (known after apply)
+ http_option = "redirected"
+ id = (known after apply)
+ local_storage_limit = (known after apply)
+ max_concurrency = (known after apply)
+ max_scale = 1
+ memory_limit = 128
+ min_scale = 0
+ name = "prod-toolbox-api"
+ namespace_id = (known after apply)
+ port = 80
+ privacy = "public"
+ protocol = "http1"
+ region = (known after apply)
+ registry_image = "traefik/whoami:latest"
+ sandbox = (known after apply)
+ status = (known after apply)
+ timeout = (known after apply)
}
# module.environment.module.api.scaleway_container_namespace.api will be created
+ resource "scaleway_container_namespace" "api" {
+ activate_vpc_integration = false
+ destroy_registry = false
+ id = (known after apply)
+ name = "prod-toolbox-ns-api"
+ organization_id = (known after apply)
+ project_id = (known after apply)
+ region = (known after apply)
+ registry_endpoint = (known after apply)
+ registry_namespace_id = (known after apply)
}
# module.environment.module.api.scaleway_iam_application.api will be created
+ resource "scaleway_iam_application" "api" {
+ created_at = (known after apply)
+ description = "IAM application for the API"
+ editable = (known after apply)
+ id = (known after apply)
+ name = "prod-toolbox-api"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
}
# module.environment.module.api.scaleway_iam_policy.main_rw will be created
+ resource "scaleway_iam_policy" "main_rw" {
+ application_id = (known after apply)
+ created_at = (known after apply)
+ description = "Policy to allow read and write access to the main database"
+ editable = (known after apply)
+ id = (known after apply)
+ name = "prod-toolbox-db-main-rw-policy"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
+ rule {
+ permission_set_names = [
+ "ServerlessSQLDatabaseReadWrite",
]
+ project_ids = (known after apply)
}
}
# module.environment.module.api.scaleway_sdb_sql_database.main will be created
+ resource "scaleway_sdb_sql_database" "main" {
+ endpoint = (known after apply)
+ id = (known after apply)
+ max_cpu = 1
+ min_cpu = 0
+ name = "prod-toolbox-db-main"
+ project_id = (known after apply)
+ region = (known after apply)
}
# module.environment.module.scaleway_project.scaleway_account_project.project will be created
+ resource "scaleway_account_project" "project" {
+ created_at = (known after apply)
+ id = (known after apply)
+ name = "prod-toolbox"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
}
Plan: 7 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ api_container_endpoint = (known after apply)📝 Plan generated in Tofu - Plan #72 |
|
🤖 Preview Environment Status
|
|
OpenTofu plan for dev Plan: 7 to add, 0 to change, 0 to destroy. Changes to Outputs.OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
OpenTofu will perform the following actions:
# module.environment.module.api.github_actions_environment_variable.api_registry_endpoint will be created
+ resource "github_actions_environment_variable" "api_registry_endpoint" {
+ created_at = (known after apply)
+ environment = "dev"
+ id = (known after apply)
+ repository = "toolbox"
+ updated_at = (known after apply)
+ value = (known after apply)
+ variable_name = "API_REGISTRY_ENDPOINT"
}
# module.environment.module.api.scaleway_container.api will be created
+ resource "scaleway_container" "api" {
+ cpu_limit = 70
+ cron_status = (known after apply)
+ deploy = true
+ domain_name = (known after apply)
+ environment_variables = (known after apply)
+ error_message = (known after apply)
+ http_option = "redirected"
+ id = (known after apply)
+ local_storage_limit = (known after apply)
+ max_concurrency = (known after apply)
+ max_scale = 1
+ memory_limit = 128
+ min_scale = 0
+ name = "dev-toolbox-api"
+ namespace_id = (known after apply)
+ port = 80
+ privacy = "public"
+ protocol = "http1"
+ region = (known after apply)
+ registry_image = "traefik/whoami:latest"
+ sandbox = (known after apply)
+ status = (known after apply)
+ timeout = (known after apply)
}
# module.environment.module.api.scaleway_container_namespace.api will be created
+ resource "scaleway_container_namespace" "api" {
+ activate_vpc_integration = false
+ destroy_registry = false
+ id = (known after apply)
+ name = "dev-toolbox-ns-api"
+ organization_id = (known after apply)
+ project_id = (known after apply)
+ region = (known after apply)
+ registry_endpoint = (known after apply)
+ registry_namespace_id = (known after apply)
}
# module.environment.module.api.scaleway_iam_application.api will be created
+ resource "scaleway_iam_application" "api" {
+ created_at = (known after apply)
+ description = "IAM application for the API"
+ editable = (known after apply)
+ id = (known after apply)
+ name = "dev-toolbox-api"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
}
# module.environment.module.api.scaleway_iam_policy.main_rw will be created
+ resource "scaleway_iam_policy" "main_rw" {
+ application_id = (known after apply)
+ created_at = (known after apply)
+ description = "Policy to allow read and write access to the main database"
+ editable = (known after apply)
+ id = (known after apply)
+ name = "dev-toolbox-db-main-rw-policy"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
+ rule {
+ permission_set_names = [
+ "ServerlessSQLDatabaseReadWrite",
]
+ project_ids = (known after apply)
}
}
# module.environment.module.api.scaleway_sdb_sql_database.main will be created
+ resource "scaleway_sdb_sql_database" "main" {
+ endpoint = (known after apply)
+ id = (known after apply)
+ max_cpu = 1
+ min_cpu = 0
+ name = "dev-toolbox-db-main"
+ project_id = (known after apply)
+ region = (known after apply)
}
# module.environment.module.scaleway_project.scaleway_account_project.project will be created
+ resource "scaleway_account_project" "project" {
+ created_at = (known after apply)
+ id = (known after apply)
+ name = "dev-toolbox"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
}
Plan: 7 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ api_container_endpoint = (known after apply)📝 Plan generated in Tofu - Plan #72 |
|
OpenTofu plan for staging Plan: 7 to add, 0 to change, 0 to destroy. Changes to Outputs.OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
OpenTofu will perform the following actions:
# module.environment.module.api.github_actions_environment_variable.api_registry_endpoint will be created
+ resource "github_actions_environment_variable" "api_registry_endpoint" {
+ created_at = (known after apply)
+ environment = "staging"
+ id = (known after apply)
+ repository = "toolbox"
+ updated_at = (known after apply)
+ value = (known after apply)
+ variable_name = "API_REGISTRY_ENDPOINT"
}
# module.environment.module.api.scaleway_container.api will be created
+ resource "scaleway_container" "api" {
+ cpu_limit = 70
+ cron_status = (known after apply)
+ deploy = true
+ domain_name = (known after apply)
+ environment_variables = (known after apply)
+ error_message = (known after apply)
+ http_option = "redirected"
+ id = (known after apply)
+ local_storage_limit = (known after apply)
+ max_concurrency = (known after apply)
+ max_scale = 1
+ memory_limit = 128
+ min_scale = 0
+ name = "staging-toolbox-api"
+ namespace_id = (known after apply)
+ port = 80
+ privacy = "public"
+ protocol = "http1"
+ region = (known after apply)
+ registry_image = "traefik/whoami:latest"
+ sandbox = (known after apply)
+ status = (known after apply)
+ timeout = (known after apply)
}
# module.environment.module.api.scaleway_container_namespace.api will be created
+ resource "scaleway_container_namespace" "api" {
+ activate_vpc_integration = false
+ destroy_registry = false
+ id = (known after apply)
+ name = "staging-toolbox-ns-api"
+ organization_id = (known after apply)
+ project_id = (known after apply)
+ region = (known after apply)
+ registry_endpoint = (known after apply)
+ registry_namespace_id = (known after apply)
}
# module.environment.module.api.scaleway_iam_application.api will be created
+ resource "scaleway_iam_application" "api" {
+ created_at = (known after apply)
+ description = "IAM application for the API"
+ editable = (known after apply)
+ id = (known after apply)
+ name = "staging-toolbox-api"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
}
# module.environment.module.api.scaleway_iam_policy.main_rw will be created
+ resource "scaleway_iam_policy" "main_rw" {
+ application_id = (known after apply)
+ created_at = (known after apply)
+ description = "Policy to allow read and write access to the main database"
+ editable = (known after apply)
+ id = (known after apply)
+ name = "staging-toolbox-db-main-rw-policy"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
+ rule {
+ permission_set_names = [
+ "ServerlessSQLDatabaseReadWrite",
]
+ project_ids = (known after apply)
}
}
# module.environment.module.api.scaleway_sdb_sql_database.main will be created
+ resource "scaleway_sdb_sql_database" "main" {
+ endpoint = (known after apply)
+ id = (known after apply)
+ max_cpu = 1
+ min_cpu = 0
+ name = "staging-toolbox-db-main"
+ project_id = (known after apply)
+ region = (known after apply)
}
# module.environment.module.scaleway_project.scaleway_account_project.project will be created
+ resource "scaleway_account_project" "project" {
+ created_at = (known after apply)
+ id = (known after apply)
+ name = "staging-toolbox"
+ organization_id = (known after apply)
+ updated_at = (known after apply)
}
Plan: 7 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ api_container_endpoint = (known after apply)📝 Plan generated in Tofu - Plan #72 |
- Changed resource type from `scaleway_project` to `scaleway_account_project` for improved clarity and alignment with Scaleway's API. - Ensured consistency in resource naming conventions within the Terraform setup.
- Updated the output value from `scaleway_project.project.id` to `scaleway_account_project.project.id` for accurate resource referencing. - Ensured consistency with the latest Scaleway API specifications.
- Introduced new variables for Scaleway access key, secret key, and organization ID in multiple Terraform files. - Updated provider configurations to utilize these new variables for improved security and flexibility in infrastructure management. - Ensured consistency across environment configurations for better maintainability.
- Introduced new environment variables for Scaleway access key, secret key, and organization ID in the iac-plan.yml workflow. - Enhanced security and flexibility in infrastructure management by utilizing these credentials.
…ider - Removed outdated Scaleway provider configurations from .terraform.lock.hcl. - Added new versions.tf file to specify required providers for Scaleway with version 2.56.0. - Ensured consistency in provider settings across Terraform configurations for improved infrastructure management.
- Introduced new Terraform files for API module, including container, database, and IAM configurations. - Defined local variables and resources for Scaleway container and database management. - Enhanced infrastructure setup with policies for database access and application IAM configuration. - Established a foundation for scalable API deployment within the infrastructure.
- Introduced new output definitions for `api_container_endpoint` in dev, preview, prod, staging, and environment modules. - Updated existing API module output to reflect the correct endpoint for the Scaleway container. - Enhanced infrastructure visibility by providing essential endpoint information for API deployment.
- Added API endpoint information to the PR state comment for better visibility. - Updated the pull request workflow to include the API container endpoint from Terraform outputs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.