diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg index 3151b4ea..8761883c 100755 --- a/.git-hooks/commit-msg +++ b/.git-hooks/commit-msg @@ -1,8 +1,8 @@ -conventional_commits_regex="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-zA-Z0-9_-]+\))?: .+" +CONVENTIONAL_COMMITS_REGEX="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-zA-Z0-9_-]+\))?: .+" commit_message=$(cat "$1") -if [[ "$commit_message" =~ $conventional_commits_regex ]]; then +if [[ $commit_message =~ $CONVENTIONAL_COMMITS_REGEX ]]; then echo "[commit-msg] Pass." echo "" exit 0 diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index 7eedb7bd..5fec24d6 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -1,9 +1,9 @@ # Files changed in the current commit. -# For example, "frontend/src/app/page.tsx". +# For example, "services/web/src/app/page.tsx". changed_files=$(git diff --cached --name-only) # Target directories to run pre-commit hooks in. -# For example, "frontend". +# For example, "services/web". # A directory is qualified as a target, if it meets the following conditions: # 1. It contains at least one changed file. # 2. It contains a ".git-hooks/pre-commit" file. diff --git a/.github/workflows/build-deploy.yaml b/.github/workflows/build-deploy.yaml index feb86e7d..e308e356 100644 --- a/.github/workflows/build-deploy.yaml +++ b/.github/workflows/build-deploy.yaml @@ -9,16 +9,12 @@ on: inputs: build: required: true - default: 'false' + default: false type: boolean deploy: required: true - default: 'false' + default: false type: boolean - # - main - #paths: - # - 'frontend/**' - # - 'backend/**' jobs: build: @@ -35,32 +31,32 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push frontend + - name: Build and push web service uses: docker/build-push-action@v6 with: build-args: | NEXT_PUBLIC_API_BASE_URL=${{ secrets.NEXT_PUBLIC_API_BASE_URL }} - context: ./frontend + context: ./services/web push: true - tags: z1yoon/nus-secondhand-market-frontend:latest + tags: z1yoon/nus-secondhand-market-web:latest - - name: Build and push backend + - name: Build and push account service uses: docker/build-push-action@v6 with: - context: ./backend + context: ./services/account push: true - tags: z1yoon/nus-secondhand-market-backend:latest + tags: z1yoon/nus-secondhand-market-account:latest - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: - aws-access-key-id: '${{ secrets.AWS_ACCESS_KEY_ID }}' - aws-secret-access-key: '${{ secrets.AWS_SECRET_ACCESS_KEY }}' + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" aws-region: ap-southeast-1 deploy: if: ${{ github.event.inputs.deploy == 'true' }} runs-on: ubuntu-latest - #needs: build + #needs: build steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/ci-frontend.yaml b/.github/workflows/ci-web-service.yaml similarity index 74% rename from .github/workflows/ci-frontend.yaml rename to .github/workflows/ci-web-service.yaml index f1a9b126..78597549 100644 --- a/.github/workflows/ci-frontend.yaml +++ b/.github/workflows/ci-web-service.yaml @@ -1,16 +1,16 @@ -name: CI for frontend +name: CI for web service on: push: branches: - main paths: - - frontend/** + - services/web/** pull_request: branches: - main paths: - - frontend/** + - services/web/** jobs: lint: @@ -18,7 +18,7 @@ jobs: defaults: run: - working-directory: frontend + working-directory: services/web steps: - name: Check out repository @@ -27,14 +27,14 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 with: - package_json_file: frontend/package.json + package_json_file: services/web/package.json - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: lts/* cache: pnpm - cache-dependency-path: frontend/pnpm-lock.yaml + cache-dependency-path: services/web/pnpm-lock.yaml - name: Install dependencies run: pnpm install @@ -50,7 +50,7 @@ jobs: defaults: run: - working-directory: frontend + working-directory: services/web steps: - name: Check out repository @@ -59,19 +59,19 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 with: - package_json_file: frontend/package.json + package_json_file: services/web/package.json - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: lts/* cache: pnpm - cache-dependency-path: frontend/pnpm-lock.yaml + cache-dependency-path: services/web/pnpm-lock.yaml - name: Install dependencies run: pnpm install - - name: Format + - name: Check format run: pnpm prettier . --check build: @@ -79,7 +79,7 @@ jobs: defaults: run: - working-directory: frontend + working-directory: services/web steps: - name: Check out repository @@ -88,14 +88,14 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 with: - package_json_file: frontend/package.json + package_json_file: services/web/package.json - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: lts/* cache: pnpm - cache-dependency-path: frontend/pnpm-lock.yaml + cache-dependency-path: services/web/pnpm-lock.yaml - name: Install dependencies run: pnpm install diff --git a/.gitignore b/.gitignore index 5df25729..d1a2de32 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ temp/ .DS_Store *.pem .env -nshm.passphrase +*.passphrase diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 63d45057..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,13 +0,0 @@ -# Contributing Guidelines - -## Install Git hooks - -```sh -git config set core.hooksPath .git-hooks -``` - -If Git hooks are not working, you can unset this setting by: - -```sh -git config unset core.hooksPath -``` diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 086f8065..0bcac3ed 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -1,43 +1,43 @@ services: - frontend: + web: build: - context: frontend - dockerfile: Dockerfile - args: - NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL} + context: services/web + dockerfile: Dockerfile.dev ports: - - "80:3000" - restart: always + - 3000:3000 environment: + - NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL} - API_BASE_URL=${API_BASE_URL} - user: root + volumes: + - ./services/web:/app + - /app/node_modules + restart: always - backend: + account: build: - context: backend + context: services/account dockerfile: Dockerfile ports: - - "8081:8081" - restart: always + - 8081:8081 environment: - POSTGRES_URL=${POSTGRES_URL} - POSTGRES_USERNAME=${POSTGRES_USERNAME} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + restart: always depends_on: - postgres postgres: - image: postgres:latest - user: root + image: postgres ports: - - "5432:5432" + - 5432:5432 environment: - POSTGRES_USER=${POSTGRES_USERNAME} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_DB=${POSTGRES_DB} volumes: - pgdata:/var/lib/postgresql/data - - ./init:/docker-entrypoint-initdb.d + - ./services/account/database:/docker-entrypoint-initdb.d volumes: pgdata: diff --git a/docker-compose.yaml b/docker-compose.yaml index 2bb84fc8..7b64946e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,6 +1,6 @@ services: - frontend: - image: z1yoon/nus-secondhand-market-frontend:latest + web: + image: z1yoon/nus-secondhand-market-web:latest ports: - "80:3000" restart: always @@ -8,8 +8,8 @@ services: - API_BASE_URL=${API_BASE_URL} user: root - backend: - image: z1yoon/nus-secondhand-market-backend:latest + account: + image: z1yoon/nus-secondhand-market-account:latest ports: - "8081:8081" restart: always @@ -32,7 +32,7 @@ services: - POSTGRES_DB=${POSTGRES_DB} volumes: - pgdata:/var/lib/postgresql/data - - ./init:/docker-entrypoint-initdb.d + - ./services/account/database:/docker-entrypoint-initdb.d volumes: pgdata: diff --git a/frontend/.env.example b/frontend/.env.example deleted file mode 100644 index 1fdf2adb..00000000 --- a/frontend/.env.example +++ /dev/null @@ -1,3 +0,0 @@ -# The base URL of backend API entrypoint. -# For example, "http://localhost:8080", -NEXT_PUBLIC_API_BASE_URL= diff --git a/run b/run index 8f1593d9..91fd0dcc 100755 --- a/run +++ b/run @@ -1,5 +1,3 @@ -#!/bin/sh - DOCKER_COMPOSE_FILE=docker-compose.dev.yaml if [[ ! -f .env ]] && [[ -f .env.gpg ]]; then @@ -10,7 +8,7 @@ if [[ ! -f .env ]] && [[ -f .env.gpg ]]; then echo ".env file created successfully" fi -if [ "$(docker ps -q -f name=backend)" ] || [ "$(docker ps -q -f name=frontend)" ]; then +if [ "$(docker ps -q -f name=account)" ] || [ "$(docker ps -q -f name=web)" ]; then echo "Stopping running containers..." docker compose -f $DOCKER_COMPOSE_FILE down fi diff --git a/backend/.gitignore b/services/account/.gitignore similarity index 100% rename from backend/.gitignore rename to services/account/.gitignore diff --git a/backend/.mvn/wrapper/maven-wrapper.properties b/services/account/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from backend/.mvn/wrapper/maven-wrapper.properties rename to services/account/.mvn/wrapper/maven-wrapper.properties diff --git a/backend/Dockerfile b/services/account/Dockerfile similarity index 100% rename from backend/Dockerfile rename to services/account/Dockerfile diff --git a/init/1-schema.sql b/services/account/database/1-schema.sql similarity index 100% rename from init/1-schema.sql rename to services/account/database/1-schema.sql diff --git a/init/2-seed.sql b/services/account/database/2-seed.sql similarity index 100% rename from init/2-seed.sql rename to services/account/database/2-seed.sql diff --git a/backend/mvnw b/services/account/mvnw similarity index 100% rename from backend/mvnw rename to services/account/mvnw diff --git a/backend/mvnw.cmd b/services/account/mvnw.cmd similarity index 100% rename from backend/mvnw.cmd rename to services/account/mvnw.cmd diff --git a/backend/pom.xml b/services/account/pom.xml similarity index 100% rename from backend/pom.xml rename to services/account/pom.xml diff --git a/backend/src/main/java/edu/nus/market/MarketApplication.java b/services/account/src/main/java/edu/nus/market/MarketApplication.java similarity index 100% rename from backend/src/main/java/edu/nus/market/MarketApplication.java rename to services/account/src/main/java/edu/nus/market/MarketApplication.java diff --git a/backend/src/main/java/edu/nus/market/config/GlobalCors.java b/services/account/src/main/java/edu/nus/market/config/GlobalCors.java similarity index 100% rename from backend/src/main/java/edu/nus/market/config/GlobalCors.java rename to services/account/src/main/java/edu/nus/market/config/GlobalCors.java diff --git a/backend/src/main/java/edu/nus/market/config/SecurityConfig.java b/services/account/src/main/java/edu/nus/market/config/SecurityConfig.java similarity index 100% rename from backend/src/main/java/edu/nus/market/config/SecurityConfig.java rename to services/account/src/main/java/edu/nus/market/config/SecurityConfig.java diff --git a/backend/src/main/java/edu/nus/market/controller/AccountController.java b/services/account/src/main/java/edu/nus/market/controller/AccountController.java similarity index 100% rename from backend/src/main/java/edu/nus/market/controller/AccountController.java rename to services/account/src/main/java/edu/nus/market/controller/AccountController.java diff --git a/backend/src/main/java/edu/nus/market/dao/AccountDao.java b/services/account/src/main/java/edu/nus/market/dao/AccountDao.java similarity index 100% rename from backend/src/main/java/edu/nus/market/dao/AccountDao.java rename to services/account/src/main/java/edu/nus/market/dao/AccountDao.java diff --git a/backend/src/main/java/edu/nus/market/dao/DepartmentDao.java b/services/account/src/main/java/edu/nus/market/dao/DepartmentDao.java similarity index 100% rename from backend/src/main/java/edu/nus/market/dao/DepartmentDao.java rename to services/account/src/main/java/edu/nus/market/dao/DepartmentDao.java diff --git a/backend/src/main/java/edu/nus/market/pojo/Account.java b/services/account/src/main/java/edu/nus/market/pojo/Account.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/Account.java rename to services/account/src/main/java/edu/nus/market/pojo/Account.java diff --git a/backend/src/main/java/edu/nus/market/pojo/DeleteAccountRequirement.java b/services/account/src/main/java/edu/nus/market/pojo/DeleteAccountRequirement.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/DeleteAccountRequirement.java rename to services/account/src/main/java/edu/nus/market/pojo/DeleteAccountRequirement.java diff --git a/backend/src/main/java/edu/nus/market/pojo/Department.java b/services/account/src/main/java/edu/nus/market/pojo/Department.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/Department.java rename to services/account/src/main/java/edu/nus/market/pojo/Department.java diff --git a/backend/src/main/java/edu/nus/market/pojo/ErrorMsg.java b/services/account/src/main/java/edu/nus/market/pojo/ErrorMsg.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/ErrorMsg.java rename to services/account/src/main/java/edu/nus/market/pojo/ErrorMsg.java diff --git a/backend/src/main/java/edu/nus/market/pojo/ErrorMsgEnum.java b/services/account/src/main/java/edu/nus/market/pojo/ErrorMsgEnum.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/ErrorMsgEnum.java rename to services/account/src/main/java/edu/nus/market/pojo/ErrorMsgEnum.java diff --git a/backend/src/main/java/edu/nus/market/pojo/ForgotPasswordReq.java b/services/account/src/main/java/edu/nus/market/pojo/ForgotPasswordReq.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/ForgotPasswordReq.java rename to services/account/src/main/java/edu/nus/market/pojo/ForgotPasswordReq.java diff --git a/backend/src/main/java/edu/nus/market/pojo/LoginReq.java b/services/account/src/main/java/edu/nus/market/pojo/LoginReq.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/LoginReq.java rename to services/account/src/main/java/edu/nus/market/pojo/LoginReq.java diff --git a/backend/src/main/java/edu/nus/market/pojo/RegisterReq.java b/services/account/src/main/java/edu/nus/market/pojo/RegisterReq.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/RegisterReq.java rename to services/account/src/main/java/edu/nus/market/pojo/RegisterReq.java diff --git a/backend/src/main/java/edu/nus/market/pojo/ResEntity/ResAccount.java b/services/account/src/main/java/edu/nus/market/pojo/ResEntity/ResAccount.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/ResEntity/ResAccount.java rename to services/account/src/main/java/edu/nus/market/pojo/ResEntity/ResAccount.java diff --git a/backend/src/main/java/edu/nus/market/pojo/Response.java b/services/account/src/main/java/edu/nus/market/pojo/Response.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/Response.java rename to services/account/src/main/java/edu/nus/market/pojo/Response.java diff --git a/backend/src/main/java/edu/nus/market/pojo/ResponseCode.java b/services/account/src/main/java/edu/nus/market/pojo/ResponseCode.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/ResponseCode.java rename to services/account/src/main/java/edu/nus/market/pojo/ResponseCode.java diff --git a/backend/src/main/java/edu/nus/market/pojo/UpdPswReq.java b/services/account/src/main/java/edu/nus/market/pojo/UpdPswReq.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/UpdPswReq.java rename to services/account/src/main/java/edu/nus/market/pojo/UpdPswReq.java diff --git a/backend/src/main/java/edu/nus/market/pojo/UpdateProfileReq.java b/services/account/src/main/java/edu/nus/market/pojo/UpdateProfileReq.java similarity index 100% rename from backend/src/main/java/edu/nus/market/pojo/UpdateProfileReq.java rename to services/account/src/main/java/edu/nus/market/pojo/UpdateProfileReq.java diff --git a/backend/src/main/java/edu/nus/market/security/CookieManager.java b/services/account/src/main/java/edu/nus/market/security/CookieManager.java similarity index 100% rename from backend/src/main/java/edu/nus/market/security/CookieManager.java rename to services/account/src/main/java/edu/nus/market/security/CookieManager.java diff --git a/backend/src/main/java/edu/nus/market/security/JwtTokenManager.java b/services/account/src/main/java/edu/nus/market/security/JwtTokenManager.java similarity index 100% rename from backend/src/main/java/edu/nus/market/security/JwtTokenManager.java rename to services/account/src/main/java/edu/nus/market/security/JwtTokenManager.java diff --git a/backend/src/main/java/edu/nus/market/security/PasswordHasher.java b/services/account/src/main/java/edu/nus/market/security/PasswordHasher.java similarity index 100% rename from backend/src/main/java/edu/nus/market/security/PasswordHasher.java rename to services/account/src/main/java/edu/nus/market/security/PasswordHasher.java diff --git a/backend/src/main/java/edu/nus/market/security/SaltGenerator.java b/services/account/src/main/java/edu/nus/market/security/SaltGenerator.java similarity index 100% rename from backend/src/main/java/edu/nus/market/security/SaltGenerator.java rename to services/account/src/main/java/edu/nus/market/security/SaltGenerator.java diff --git a/backend/src/main/java/edu/nus/market/service/AccountService.java b/services/account/src/main/java/edu/nus/market/service/AccountService.java similarity index 100% rename from backend/src/main/java/edu/nus/market/service/AccountService.java rename to services/account/src/main/java/edu/nus/market/service/AccountService.java diff --git a/backend/src/main/java/edu/nus/market/service/AccountServiceImpl.java b/services/account/src/main/java/edu/nus/market/service/AccountServiceImpl.java similarity index 100% rename from backend/src/main/java/edu/nus/market/service/AccountServiceImpl.java rename to services/account/src/main/java/edu/nus/market/service/AccountServiceImpl.java diff --git a/backend/src/main/resources/application.yml b/services/account/src/main/resources/application.yml similarity index 100% rename from backend/src/main/resources/application.yml rename to services/account/src/main/resources/application.yml diff --git a/backend/src/test/java/edu/nus/market/GetAccountServiceTest.java b/services/account/src/test/java/edu/nus/market/GetAccountServiceTest.java similarity index 100% rename from backend/src/test/java/edu/nus/market/GetAccountServiceTest.java rename to services/account/src/test/java/edu/nus/market/GetAccountServiceTest.java diff --git a/backend/src/test/java/edu/nus/market/LoginServiceTest.java b/services/account/src/test/java/edu/nus/market/LoginServiceTest.java similarity index 100% rename from backend/src/test/java/edu/nus/market/LoginServiceTest.java rename to services/account/src/test/java/edu/nus/market/LoginServiceTest.java diff --git a/backend/src/test/java/edu/nus/market/MarketApplicationTests.java b/services/account/src/test/java/edu/nus/market/MarketApplicationTests.java similarity index 100% rename from backend/src/test/java/edu/nus/market/MarketApplicationTests.java rename to services/account/src/test/java/edu/nus/market/MarketApplicationTests.java diff --git a/backend/src/test/java/edu/nus/market/RegisterServiceTest.java b/services/account/src/test/java/edu/nus/market/RegisterServiceTest.java similarity index 100% rename from backend/src/test/java/edu/nus/market/RegisterServiceTest.java rename to services/account/src/test/java/edu/nus/market/RegisterServiceTest.java diff --git a/frontend/.dockerignore b/services/web/.dockerignore similarity index 100% rename from frontend/.dockerignore rename to services/web/.dockerignore diff --git a/services/web/.env.example b/services/web/.env.example new file mode 100644 index 00000000..b448d004 --- /dev/null +++ b/services/web/.env.example @@ -0,0 +1,9 @@ +# How user browser accesses API. +# For example, "https://nshm.mrcai.dev/api", +# Note: Do not include a trailing slash. +NEXT_PUBLIC_API_BASE_URL= + +# How web service accesses other services. +# For example, "http://service-registry:8761". +# Note: Do not include a trailing slash. +API_BASE_URL= diff --git a/frontend/.git-hooks/pre-commit b/services/web/.git-hooks/pre-commit similarity index 100% rename from frontend/.git-hooks/pre-commit rename to services/web/.git-hooks/pre-commit diff --git a/frontend/.gitignore b/services/web/.gitignore similarity index 74% rename from frontend/.gitignore rename to services/web/.gitignore index 5df81858..fe5ec9a9 100644 --- a/frontend/.gitignore +++ b/services/web/.gitignore @@ -1,7 +1,5 @@ .next/ coverage/ node_modules/ -.env* -!.env.example next-env.d.ts *.tsbuildinfo diff --git a/frontend/.prettierignore b/services/web/.prettierignore similarity index 100% rename from frontend/.prettierignore rename to services/web/.prettierignore diff --git a/frontend/Dockerfile b/services/web/Dockerfile similarity index 70% rename from frontend/Dockerfile rename to services/web/Dockerfile index 4d95d490..32123912 100644 --- a/frontend/Dockerfile +++ b/services/web/Dockerfile @@ -4,7 +4,7 @@ FROM node:lts-alpine AS build WORKDIR /app -RUN apk add --no-cache libc6-compat curl +RUN apk add --no-cache libc6-compat RUN corepack enable pnpm @@ -25,12 +25,7 @@ FROM node:lts-alpine AS production WORKDIR /app -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 nextjs - -COPY --from=build --chown=nextjs:nodejs /app/.next/standalone . - -USER nextjs +COPY --from=build /app/.next/standalone . ENV HOSTNAME=0.0.0.0 ENV PORT=3000 diff --git a/services/web/Dockerfile.dev b/services/web/Dockerfile.dev new file mode 100644 index 00000000..72944d79 --- /dev/null +++ b/services/web/Dockerfile.dev @@ -0,0 +1,21 @@ +# docker build -f Dockerfile.dev -t web:dev . +# docker run -d -p 3000:3000 --name web --env-file .env -v .:/app -v /app/node_modules web:dev + +FROM node:lts-alpine + +WORKDIR /app + +RUN apk add --no-cache libc6-compat + +RUN corepack enable pnpm + +COPY package.json pnpm-lock.yaml ./ + +RUN pnpm install --frozen-lockfile + +ENV HOSTNAME=0.0.0.0 +ENV PORT=3000 + +EXPOSE 3000 + +CMD ["pnpm", "run", "dev"] diff --git a/frontend/README.md b/services/web/README.md similarity index 100% rename from frontend/README.md rename to services/web/README.md diff --git a/frontend/components.json b/services/web/components.json similarity index 100% rename from frontend/components.json rename to services/web/components.json diff --git a/frontend/eslint.config.js b/services/web/eslint.config.js similarity index 100% rename from frontend/eslint.config.js rename to services/web/eslint.config.js diff --git a/frontend/lint-staged.config.js b/services/web/lint-staged.config.js similarity index 100% rename from frontend/lint-staged.config.js rename to services/web/lint-staged.config.js diff --git a/frontend/next.config.js b/services/web/next.config.js similarity index 100% rename from frontend/next.config.js rename to services/web/next.config.js diff --git a/frontend/package.json b/services/web/package.json similarity index 98% rename from frontend/package.json rename to services/web/package.json index 8d29e515..2ec541c9 100644 --- a/frontend/package.json +++ b/services/web/package.json @@ -1,5 +1,5 @@ { - "name": "frontend", + "name": "web-service", "private": true, "type": "module", "packageManager": "pnpm@9.11.0", diff --git a/frontend/pnpm-lock.yaml b/services/web/pnpm-lock.yaml similarity index 100% rename from frontend/pnpm-lock.yaml rename to services/web/pnpm-lock.yaml diff --git a/frontend/postcss.config.js b/services/web/postcss.config.js similarity index 100% rename from frontend/postcss.config.js rename to services/web/postcss.config.js diff --git a/frontend/prettier.config.js b/services/web/prettier.config.js similarity index 100% rename from frontend/prettier.config.js rename to services/web/prettier.config.js diff --git a/frontend/public/.gitkeep b/services/web/public/.gitkeep similarity index 100% rename from frontend/public/.gitkeep rename to services/web/public/.gitkeep diff --git a/frontend/src/app/api/auth/me/route.ts b/services/web/src/app/api/auth/me/route.ts similarity index 100% rename from frontend/src/app/api/auth/me/route.ts rename to services/web/src/app/api/auth/me/route.ts diff --git a/frontend/src/app/api/auth/token/route.ts b/services/web/src/app/api/auth/token/route.ts similarity index 100% rename from frontend/src/app/api/auth/token/route.ts rename to services/web/src/app/api/auth/token/route.ts diff --git a/frontend/src/app/globals.css b/services/web/src/app/globals.css similarity index 100% rename from frontend/src/app/globals.css rename to services/web/src/app/globals.css diff --git a/frontend/src/app/icon.svg b/services/web/src/app/icon.svg similarity index 100% rename from frontend/src/app/icon.svg rename to services/web/src/app/icon.svg diff --git a/frontend/src/app/layout.tsx b/services/web/src/app/layout.tsx similarity index 100% rename from frontend/src/app/layout.tsx rename to services/web/src/app/layout.tsx diff --git a/frontend/src/app/login/form.tsx b/services/web/src/app/login/form.tsx similarity index 100% rename from frontend/src/app/login/form.tsx rename to services/web/src/app/login/form.tsx diff --git a/frontend/src/app/login/page.tsx b/services/web/src/app/login/page.tsx similarity index 100% rename from frontend/src/app/login/page.tsx rename to services/web/src/app/login/page.tsx diff --git a/frontend/src/app/page.tsx b/services/web/src/app/page.tsx similarity index 100% rename from frontend/src/app/page.tsx rename to services/web/src/app/page.tsx diff --git a/frontend/src/app/register/form.tsx b/services/web/src/app/register/form.tsx similarity index 100% rename from frontend/src/app/register/form.tsx rename to services/web/src/app/register/form.tsx diff --git a/frontend/src/app/register/page.tsx b/services/web/src/app/register/page.tsx similarity index 100% rename from frontend/src/app/register/page.tsx rename to services/web/src/app/register/page.tsx diff --git a/frontend/src/app/settings/cards/delete-account-card.tsx b/services/web/src/app/settings/cards/delete-account-card.tsx similarity index 100% rename from frontend/src/app/settings/cards/delete-account-card.tsx rename to services/web/src/app/settings/cards/delete-account-card.tsx diff --git a/frontend/src/app/settings/cards/update-avatar-card.tsx b/services/web/src/app/settings/cards/update-avatar-card.tsx similarity index 100% rename from frontend/src/app/settings/cards/update-avatar-card.tsx rename to services/web/src/app/settings/cards/update-avatar-card.tsx diff --git a/frontend/src/app/settings/cards/update-email-card.tsx b/services/web/src/app/settings/cards/update-email-card.tsx similarity index 100% rename from frontend/src/app/settings/cards/update-email-card.tsx rename to services/web/src/app/settings/cards/update-email-card.tsx diff --git a/frontend/src/app/settings/cards/update-nickname-card.tsx b/services/web/src/app/settings/cards/update-nickname-card.tsx similarity index 100% rename from frontend/src/app/settings/cards/update-nickname-card.tsx rename to services/web/src/app/settings/cards/update-nickname-card.tsx diff --git a/frontend/src/app/settings/cards/update-password-card.tsx b/services/web/src/app/settings/cards/update-password-card.tsx similarity index 100% rename from frontend/src/app/settings/cards/update-password-card.tsx rename to services/web/src/app/settings/cards/update-password-card.tsx diff --git a/frontend/src/app/settings/cards/update-whatsapp-card.tsx b/services/web/src/app/settings/cards/update-whatsapp-card.tsx similarity index 100% rename from frontend/src/app/settings/cards/update-whatsapp-card.tsx rename to services/web/src/app/settings/cards/update-whatsapp-card.tsx diff --git a/frontend/src/app/settings/contacts/page.tsx b/services/web/src/app/settings/contacts/page.tsx similarity index 100% rename from frontend/src/app/settings/contacts/page.tsx rename to services/web/src/app/settings/contacts/page.tsx diff --git a/frontend/src/app/settings/display/page.tsx b/services/web/src/app/settings/display/page.tsx similarity index 100% rename from frontend/src/app/settings/display/page.tsx rename to services/web/src/app/settings/display/page.tsx diff --git a/frontend/src/app/settings/layout.tsx b/services/web/src/app/settings/layout.tsx similarity index 100% rename from frontend/src/app/settings/layout.tsx rename to services/web/src/app/settings/layout.tsx diff --git a/frontend/src/app/settings/nav-link.tsx b/services/web/src/app/settings/nav-link.tsx similarity index 100% rename from frontend/src/app/settings/nav-link.tsx rename to services/web/src/app/settings/nav-link.tsx diff --git a/frontend/src/app/settings/page.tsx b/services/web/src/app/settings/page.tsx similarity index 100% rename from frontend/src/app/settings/page.tsx rename to services/web/src/app/settings/page.tsx diff --git a/frontend/src/components/framework/header.tsx b/services/web/src/components/framework/header.tsx similarity index 100% rename from frontend/src/components/framework/header.tsx rename to services/web/src/components/framework/header.tsx diff --git a/frontend/src/components/framework/index.ts b/services/web/src/components/framework/index.ts similarity index 100% rename from frontend/src/components/framework/index.ts rename to services/web/src/components/framework/index.ts diff --git a/frontend/src/components/framework/logo.tsx b/services/web/src/components/framework/logo.tsx similarity index 100% rename from frontend/src/components/framework/logo.tsx rename to services/web/src/components/framework/logo.tsx diff --git a/frontend/src/components/framework/me-card/index.ts b/services/web/src/components/framework/me-card/index.ts similarity index 100% rename from frontend/src/components/framework/me-card/index.ts rename to services/web/src/components/framework/me-card/index.ts diff --git a/frontend/src/components/framework/me-card/join-now-card.tsx b/services/web/src/components/framework/me-card/join-now-card.tsx similarity index 100% rename from frontend/src/components/framework/me-card/join-now-card.tsx rename to services/web/src/components/framework/me-card/join-now-card.tsx diff --git a/frontend/src/components/framework/me-card/log-out-button.tsx b/services/web/src/components/framework/me-card/log-out-button.tsx similarity index 100% rename from frontend/src/components/framework/me-card/log-out-button.tsx rename to services/web/src/components/framework/me-card/log-out-button.tsx diff --git a/frontend/src/components/framework/me-card/me-card-client.tsx b/services/web/src/components/framework/me-card/me-card-client.tsx similarity index 100% rename from frontend/src/components/framework/me-card/me-card-client.tsx rename to services/web/src/components/framework/me-card/me-card-client.tsx diff --git a/frontend/src/components/framework/me-card/me-card-server.tsx b/services/web/src/components/framework/me-card/me-card-server.tsx similarity index 100% rename from frontend/src/components/framework/me-card/me-card-server.tsx rename to services/web/src/components/framework/me-card/me-card-server.tsx diff --git a/frontend/src/components/framework/nav-link.tsx b/services/web/src/components/framework/nav-link.tsx similarity index 100% rename from frontend/src/components/framework/nav-link.tsx rename to services/web/src/components/framework/nav-link.tsx diff --git a/frontend/src/components/framework/nav.tsx b/services/web/src/components/framework/nav.tsx similarity index 100% rename from frontend/src/components/framework/nav.tsx rename to services/web/src/components/framework/nav.tsx diff --git a/frontend/src/components/framework/sidebar.tsx b/services/web/src/components/framework/sidebar.tsx similarity index 100% rename from frontend/src/components/framework/sidebar.tsx rename to services/web/src/components/framework/sidebar.tsx diff --git a/frontend/src/components/framework/theme-initializer.tsx b/services/web/src/components/framework/theme-initializer.tsx similarity index 100% rename from frontend/src/components/framework/theme-initializer.tsx rename to services/web/src/components/framework/theme-initializer.tsx diff --git a/frontend/src/components/framework/theme-toggle.tsx b/services/web/src/components/framework/theme-toggle.tsx similarity index 100% rename from frontend/src/components/framework/theme-toggle.tsx rename to services/web/src/components/framework/theme-toggle.tsx diff --git a/frontend/src/components/ui/alert-dialog.tsx b/services/web/src/components/ui/alert-dialog.tsx similarity index 100% rename from frontend/src/components/ui/alert-dialog.tsx rename to services/web/src/components/ui/alert-dialog.tsx diff --git a/frontend/src/components/ui/avatar.tsx b/services/web/src/components/ui/avatar.tsx similarity index 100% rename from frontend/src/components/ui/avatar.tsx rename to services/web/src/components/ui/avatar.tsx diff --git a/frontend/src/components/ui/button.tsx b/services/web/src/components/ui/button.tsx similarity index 100% rename from frontend/src/components/ui/button.tsx rename to services/web/src/components/ui/button.tsx diff --git a/frontend/src/components/ui/card.tsx b/services/web/src/components/ui/card.tsx similarity index 100% rename from frontend/src/components/ui/card.tsx rename to services/web/src/components/ui/card.tsx diff --git a/frontend/src/components/ui/dropdown-menu.tsx b/services/web/src/components/ui/dropdown-menu.tsx similarity index 100% rename from frontend/src/components/ui/dropdown-menu.tsx rename to services/web/src/components/ui/dropdown-menu.tsx diff --git a/frontend/src/components/ui/input.tsx b/services/web/src/components/ui/input.tsx similarity index 100% rename from frontend/src/components/ui/input.tsx rename to services/web/src/components/ui/input.tsx diff --git a/frontend/src/components/ui/label.tsx b/services/web/src/components/ui/label.tsx similarity index 100% rename from frontend/src/components/ui/label.tsx rename to services/web/src/components/ui/label.tsx diff --git a/frontend/src/components/ui/sheet.tsx b/services/web/src/components/ui/sheet.tsx similarity index 100% rename from frontend/src/components/ui/sheet.tsx rename to services/web/src/components/ui/sheet.tsx diff --git a/frontend/src/components/ui/toast.tsx b/services/web/src/components/ui/toast.tsx similarity index 100% rename from frontend/src/components/ui/toast.tsx rename to services/web/src/components/ui/toast.tsx diff --git a/frontend/src/components/ui/toaster.tsx b/services/web/src/components/ui/toaster.tsx similarity index 100% rename from frontend/src/components/ui/toaster.tsx rename to services/web/src/components/ui/toaster.tsx diff --git a/frontend/src/components/ui/utils.ts b/services/web/src/components/ui/utils.ts similarity index 100% rename from frontend/src/components/ui/utils.ts rename to services/web/src/components/ui/utils.ts diff --git a/frontend/src/hooks/use-toast.ts b/services/web/src/hooks/use-toast.ts similarity index 100% rename from frontend/src/hooks/use-toast.ts rename to services/web/src/hooks/use-toast.ts diff --git a/frontend/src/middleware.ts b/services/web/src/middleware.ts similarity index 100% rename from frontend/src/middleware.ts rename to services/web/src/middleware.ts diff --git a/frontend/src/types.ts b/services/web/src/types.ts similarity index 100% rename from frontend/src/types.ts rename to services/web/src/types.ts diff --git a/frontend/src/utils/requester/client-fetcher.ts b/services/web/src/utils/requester/client-fetcher.ts similarity index 100% rename from frontend/src/utils/requester/client-fetcher.ts rename to services/web/src/utils/requester/client-fetcher.ts diff --git a/frontend/src/utils/requester/client.ts b/services/web/src/utils/requester/client.ts similarity index 100% rename from frontend/src/utils/requester/client.ts rename to services/web/src/utils/requester/client.ts diff --git a/frontend/src/utils/requester/fetcher.ts b/services/web/src/utils/requester/fetcher.ts similarity index 100% rename from frontend/src/utils/requester/fetcher.ts rename to services/web/src/utils/requester/fetcher.ts diff --git a/frontend/src/utils/requester/requester.ts b/services/web/src/utils/requester/requester.ts similarity index 100% rename from frontend/src/utils/requester/requester.ts rename to services/web/src/utils/requester/requester.ts diff --git a/frontend/src/utils/requester/server-fetcher.ts b/services/web/src/utils/requester/server-fetcher.ts similarity index 100% rename from frontend/src/utils/requester/server-fetcher.ts rename to services/web/src/utils/requester/server-fetcher.ts diff --git a/frontend/src/utils/requester/server.ts b/services/web/src/utils/requester/server.ts similarity index 100% rename from frontend/src/utils/requester/server.ts rename to services/web/src/utils/requester/server.ts diff --git a/frontend/tailwind.config.ts b/services/web/tailwind.config.ts similarity index 100% rename from frontend/tailwind.config.ts rename to services/web/tailwind.config.ts diff --git a/frontend/tsconfig.json b/services/web/tsconfig.json similarity index 100% rename from frontend/tsconfig.json rename to services/web/tsconfig.json diff --git a/terraform/.gitignore b/terraform/.gitignore index 14f78c29..9b5533c5 100644 --- a/terraform/.gitignore +++ b/terraform/.gitignore @@ -1,2 +1,2 @@ -terraform.tfstate* -terraform/.terraform +.terraform/ +*.tfstate* diff --git a/terraform/backup/build-deploy.yaml b/terraform/backup/build-deploy.yaml index e5e28a89..5b6ab5f3 100644 --- a/terraform/backup/build-deploy.yaml +++ b/terraform/backup/build-deploy.yaml @@ -8,16 +8,12 @@ on: inputs: build: required: true - default: 'false' + default: "false" type: boolean deploy: required: true - default: 'false' + default: "false" type: boolean - # - main - #paths: - # - 'frontend/**' - # - 'backend/**' jobs: build: @@ -34,30 +30,30 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push frontend + - name: Build and push web service uses: docker/build-push-action@v6 with: - context: ./frontend + context: ./services/web push: true - tags: z1yoon/nus-secondhand-market-frontend:latest + tags: z1yoon/nus-secondhand-market-web:latest - - name: Build and push backend + - name: Build and push account service uses: docker/build-push-action@v6 with: - context: ./backend + context: ./services/account push: true - tags: z1yoon/nus-secondhand-market-backend:latest + tags: z1yoon/nus-secondhand-market-account:latest - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: - aws-access-key-id: '${{ secrets.AWS_ACCESS_KEY_ID }}' - aws-secret-access-key: '${{ secrets.AWS_SECRET_ACCESS_KEY }}' + aws-access-key-id: "${{ secrets.AWS_ACCESS_KEY_ID }}" + aws-secret-access-key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" aws-region: ap-southeast-1 deploy: if: ${{ github.event.inputs.deploy == 'true' }} runs-on: ubuntu-latest - #needs: build + #needs: build steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/terraform/errored.tfstate b/terraform/errored.tfstate deleted file mode 100644 index 3efe30c1..00000000 --- a/terraform/errored.tfstate +++ /dev/null @@ -1,1331 +0,0 @@ -{ - "version": 4, - "terraform_version": "1.9.6", - "serial": 38, - "lineage": "46c80e5f-0574-4091-fa79-288cd36ad186", - "outputs": { - "alb_dns_name": { - "value": "nshm-alb-1094330103.ap-southeast-1.elb.amazonaws.com", - "type": "string" - }, - "eks_cluster_endpoint": { - "value": "https://598DBCECD51D2202FCD362054A78FAC4.gr7.ap-southeast-1.eks.amazonaws.com", - "type": "string" - } - }, - "resources": [ - { - "module": "module.alb", - "mode": "managed", - "type": "aws_acm_certificate", - "name": "alb_cert", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "status": "tainted", - "schema_version": 0, - "attributes": { - "arn": null, - "certificate_authority_arn": null, - "certificate_body": null, - "certificate_chain": null, - "domain_name": "nshm-alb-1094330103.ap-southeast-1.elb.amazonaws.com", - "domain_validation_options": [ - { - "domain_name": "nshm-alb-1094330103.ap-southeast-1.elb.amazonaws.com", - "resource_record_name": "", - "resource_record_type": "", - "resource_record_value": "" - } - ], - "early_renewal_duration": null, - "id": "arn:aws:acm:ap-southeast-1:985539788320:certificate/d2874ded-e7f2-42ca-af85-215cf148440a", - "key_algorithm": null, - "not_after": null, - "not_before": null, - "options": null, - "pending_renewal": null, - "private_key": null, - "renewal_eligibility": null, - "renewal_summary": null, - "status": null, - "subject_alternative_names": [ - "nshm-alb-1094330103.ap-southeast-1.elb.amazonaws.com" - ], - "tags": null, - "tags_all": null, - "type": null, - "validation_emails": null, - "validation_method": "DNS", - "validation_option": [] - }, - "sensitive_attributes": [ - [ - { - "type": "get_attr", - "value": "private_key" - } - ] - ], - "private": "bnVsbA==", - "dependencies": [ - "module.alb.aws_lb.nshm_alb", - "module.alb.aws_security_group.alb_sg", - "module.vpc.aws_subnet.public", - "module.vpc.aws_vpc.nus-secondhand-market" - ], - "create_before_destroy": true - } - ] - }, - { - "module": "module.alb", - "mode": "managed", - "type": "aws_lb", - "name": "nshm_alb", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "access_logs": [ - { - "bucket": "", - "enabled": false, - "prefix": "" - } - ], - "arn": "arn:aws:elasticloadbalancing:ap-southeast-1:985539788320:loadbalancer/app/nshm-alb/7896a722e1996e0a", - "arn_suffix": "app/nshm-alb/7896a722e1996e0a", - "client_keep_alive": 3600, - "connection_logs": [ - { - "bucket": "", - "enabled": false, - "prefix": "" - } - ], - "customer_owned_ipv4_pool": "", - "desync_mitigation_mode": "defensive", - "dns_name": "nshm-alb-1094330103.ap-southeast-1.elb.amazonaws.com", - "dns_record_client_routing_policy": null, - "drop_invalid_header_fields": false, - "enable_cross_zone_load_balancing": true, - "enable_deletion_protection": false, - "enable_http2": true, - "enable_tls_version_and_cipher_suite_headers": false, - "enable_waf_fail_open": false, - "enable_xff_client_port": false, - "enforce_security_group_inbound_rules_on_private_link_traffic": "", - "id": "arn:aws:elasticloadbalancing:ap-southeast-1:985539788320:loadbalancer/app/nshm-alb/7896a722e1996e0a", - "idle_timeout": 60, - "internal": false, - "ip_address_type": "ipv4", - "load_balancer_type": "application", - "name": "nshm-alb", - "name_prefix": "", - "preserve_host_header": false, - "security_groups": [ - "sg-0496af1b626c880e7" - ], - "subnet_mapping": [ - { - "allocation_id": "", - "ipv6_address": "", - "outpost_id": "", - "private_ipv4_address": "", - "subnet_id": "subnet-006bc2a3ad9abca2b" - }, - { - "allocation_id": "", - "ipv6_address": "", - "outpost_id": "", - "private_ipv4_address": "", - "subnet_id": "subnet-0f788325d8bd0b944" - } - ], - "subnets": [ - "subnet-006bc2a3ad9abca2b", - "subnet-0f788325d8bd0b944" - ], - "tags": { - "Name": "nshm-alb" - }, - "tags_all": { - "Name": "nshm-alb" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2", - "xff_header_processing_mode": "append", - "zone_id": "Z1LMS91P8CMLE5" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19", - "dependencies": [ - "module.alb.aws_security_group.alb_sg", - "module.vpc.aws_subnet.public", - "module.vpc.aws_vpc.nus-secondhand-market" - ], - "create_before_destroy": true - } - ] - }, - { - "module": "module.alb", - "mode": "managed", - "type": "aws_lb_listener", - "name": "http_listener", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "alpn_policy": null, - "arn": "arn:aws:elasticloadbalancing:ap-southeast-1:985539788320:listener/app/nshm-alb/7896a722e1996e0a/eec230297e43a1b9", - "certificate_arn": null, - "default_action": [ - { - "authenticate_cognito": [], - "authenticate_oidc": [], - "fixed_response": [], - "forward": [], - "order": 1, - "redirect": [ - { - "host": "#{host}", - "path": "/#{path}", - "port": "443", - "protocol": "HTTPS", - "query": "#{query}", - "status_code": "HTTP_301" - } - ], - "target_group_arn": "", - "type": "redirect" - } - ], - "id": "arn:aws:elasticloadbalancing:ap-southeast-1:985539788320:listener/app/nshm-alb/7896a722e1996e0a/eec230297e43a1b9", - "load_balancer_arn": "arn:aws:elasticloadbalancing:ap-southeast-1:985539788320:loadbalancer/app/nshm-alb/7896a722e1996e0a", - "mutual_authentication": [], - "port": 80, - "protocol": "HTTP", - "ssl_policy": "", - "tags": null, - "tags_all": {}, - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "module.alb.aws_lb.nshm_alb", - "module.alb.aws_security_group.alb_sg", - "module.vpc.aws_subnet.public", - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.alb", - "mode": "managed", - "type": "aws_lb_target_group", - "name": "nshm_target_group", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "arn": "arn:aws:elasticloadbalancing:ap-southeast-1:985539788320:targetgroup/nshm-target-group/1f66cd317636b826", - "arn_suffix": "targetgroup/nshm-target-group/1f66cd317636b826", - "connection_termination": null, - "deregistration_delay": "300", - "health_check": [ - { - "enabled": true, - "healthy_threshold": 2, - "interval": 30, - "matcher": "200", - "path": "/", - "port": "traffic-port", - "protocol": "HTTP", - "timeout": 5, - "unhealthy_threshold": 2 - } - ], - "id": "arn:aws:elasticloadbalancing:ap-southeast-1:985539788320:targetgroup/nshm-target-group/1f66cd317636b826", - "ip_address_type": "ipv4", - "lambda_multi_value_headers_enabled": false, - "load_balancer_arns": [], - "load_balancing_algorithm_type": "round_robin", - "load_balancing_anomaly_mitigation": "off", - "load_balancing_cross_zone_enabled": "use_load_balancer_configuration", - "name": "nshm-target-group", - "name_prefix": "", - "port": 80, - "preserve_client_ip": null, - "protocol": "HTTP", - "protocol_version": "HTTP1", - "proxy_protocol_v2": false, - "slow_start": 0, - "stickiness": [ - { - "cookie_duration": 86400, - "cookie_name": "", - "enabled": false, - "type": "lb_cookie" - } - ], - "tags": null, - "tags_all": {}, - "target_failover": [ - { - "on_deregistration": null, - "on_unhealthy": null - } - ], - "target_group_health": [ - { - "dns_failover": [ - { - "minimum_healthy_targets_count": "1", - "minimum_healthy_targets_percentage": "off" - } - ], - "unhealthy_state_routing": [ - { - "minimum_healthy_targets_count": 1, - "minimum_healthy_targets_percentage": "off" - } - ] - } - ], - "target_health_state": [ - { - "enable_unhealthy_connection_termination": null, - "unhealthy_draining_interval": null - } - ], - "target_type": "instance", - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.alb", - "mode": "managed", - "type": "aws_security_group", - "name": "alb_sg", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 1, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:security-group/sg-0496af1b626c880e7", - "description": "Managed by Terraform", - "egress": [ - { - "cidr_blocks": [ - "0.0.0.0/0" - ], - "description": "", - "from_port": 0, - "ipv6_cidr_blocks": [], - "prefix_list_ids": [], - "protocol": "-1", - "security_groups": [], - "self": false, - "to_port": 0 - } - ], - "id": "sg-0496af1b626c880e7", - "ingress": [ - { - "cidr_blocks": [ - "0.0.0.0/0" - ], - "description": "", - "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": "", - "from_port": 80, - "ipv6_cidr_blocks": [], - "prefix_list_ids": [], - "protocol": "tcp", - "security_groups": [], - "self": false, - "to_port": 80 - } - ], - "name": "alb-security-group", - "name_prefix": "", - "owner_id": "985539788320", - "revoke_rules_on_delete": false, - "tags": null, - "tags_all": {}, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ], - "create_before_destroy": true - } - ] - }, - { - "module": "module.eks", - "mode": "data", - "type": "aws_iam_policy_document", - "name": "eks_assume_role_policy", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "3552664922", - "json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": \"sts:AssumeRole\",\n \"Principal\": {\n \"Service\": \"eks.amazonaws.com\"\n }\n }\n ]\n}", - "minified_json": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"sts:AssumeRole\",\"Principal\":{\"Service\":\"eks.amazonaws.com\"}}]}", - "override_json": null, - "override_policy_documents": null, - "policy_id": null, - "source_json": null, - "source_policy_documents": null, - "statement": [ - { - "actions": [ - "sts:AssumeRole" - ], - "condition": [], - "effect": "Allow", - "not_actions": [], - "not_principals": [], - "not_resources": [], - "principals": [ - { - "identifiers": [ - "eks.amazonaws.com" - ], - "type": "Service" - } - ], - "resources": [], - "sid": "" - } - ], - "version": "2012-10-17" - }, - "sensitive_attributes": [] - } - ] - }, - { - "module": "module.eks", - "mode": "data", - "type": "aws_iam_policy_document", - "name": "eks_node_assume_role_policy", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "2851119427", - "json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": \"sts:AssumeRole\",\n \"Principal\": {\n \"Service\": \"ec2.amazonaws.com\"\n }\n }\n ]\n}", - "minified_json": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":\"sts:AssumeRole\",\"Principal\":{\"Service\":\"ec2.amazonaws.com\"}}]}", - "override_json": null, - "override_policy_documents": null, - "policy_id": null, - "source_json": null, - "source_policy_documents": null, - "statement": [ - { - "actions": [ - "sts:AssumeRole" - ], - "condition": [], - "effect": "Allow", - "not_actions": [], - "not_principals": [], - "not_resources": [], - "principals": [ - { - "identifiers": [ - "ec2.amazonaws.com" - ], - "type": "Service" - } - ], - "resources": [], - "sid": "" - } - ], - "version": "2012-10-17" - }, - "sensitive_attributes": [] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_cloudwatch_log_group", - "name": "eks_log_group", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "arn": "arn:aws:logs:ap-southeast-1:985539788320:log-group:/aws/eks/nus-secondhand-market-eks", - "id": "/aws/eks/nus-secondhand-market-eks", - "kms_key_id": "", - "log_group_class": "STANDARD", - "name": "/aws/eks/nus-secondhand-market-eks", - "name_prefix": "", - "retention_in_days": 30, - "skip_destroy": false, - "tags": null, - "tags_all": {} - }, - "sensitive_attributes": [], - "private": "bnVsbA==" - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_eks_cluster", - "name": "nshm_cluster", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 1, - "attributes": { - "access_config": [ - { - "authentication_mode": "CONFIG_MAP", - "bootstrap_cluster_creator_admin_permissions": true - } - ], - "arn": "arn:aws:eks:ap-southeast-1:985539788320:cluster/nshm-eks", - "bootstrap_self_managed_addons": true, - "certificate_authority": [ - { - "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJTEZLWFZ1V1J1Y2d3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TkRFd01ESXlNelEzTkRsYUZ3MHpOREE1TXpBeU16VXlORGxhTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUUNteTdhdVJJRStyc25BLzUvc2wrZUF3eGpZTXUrL0E3eVFPdGRhLzJJQSsxcjd5UWVETkEzZWo1U28KOXVFNFFYUGJJUDN0N0pzRlNYTk9UUjZSdXkrU1dtUC9HdzBBa1J4Mmpld2VQaEhzNkpBbjhWcTJxMlhMbytrZgphUjRMLzVUWitScHV0TldxblVIZWlwSzFRU3RXcDJ2Y2phVnVqVnVtRk1rNW53VCtVcVVQcTVJVVB3aFRVem9QCmY0WThSaURpMW5TY1VIVmwxdzFXbDJKNnlXWFBvSGx0cXBodTNWcWcvcjVreVpVZnJYWm14Qmt6T05zT0RPajAKRGMvbmhjS3J3aWFnOXgycEVmdEx3WThIWkgvU0tMZHVhVEZWM1lhaVZDWk9LQ3NHK1dUb0RhZng1VkxjVUhSUgpEZk1TVjhSakZKZUsxNUJWY3ZzRm1RM25zamx0QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJSWTBjeUVZUTUrUzI3NGxoTmNMQTZ0MDhHenJEQVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQmo2KzUrUzRKVwptZVZFNWcyaHhneG9OUUZrRXNDRWo2VDZselZBOUx0KzVPYTFPRGJZSTdwcVVQVWhMR290bVk2NmJaSGFoby9FCktSU205STVEcGRrQ29uRHR0VUdOM21wUDZRODdTZFBRUkdXNzNvb25uLzV1SklpdWtGS1prREQ3cXU4bDRwS3cKOVZNaEg1ZVFTakdiblhBeTFZNkg1cDQ3cEtwRFRlUDIxMEc3RGNhZUIwbzZVZjhXSU8yV1VocVljbTBNL1gzMgo0Q25WTGVibzdxdEQ1SmwxSUgrS0VNT3lrM09IbWRQZWx5S0xpcUx0YklNYTg1c2RGenNsZFBzSVF3dkpSSkVDCnVxb0JQekQ3ZWZublBiMlhqSFpuSWc0NUlBT1hNSCtFN0VsSEpsVkltK2lrVlBtMGZxU3NsUFZYbDBpMGZzemIKbWhXakt5ZHhlN0RkCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" - } - ], - "cluster_id": null, - "created_at": "2024-10-02T23:49:08Z", - "enabled_cluster_log_types": [ - "api", - "audit", - "authenticator", - "controllerManager", - "scheduler" - ], - "encryption_config": [], - "endpoint": "https://598DBCECD51D2202FCD362054A78FAC4.gr7.ap-southeast-1.eks.amazonaws.com", - "id": "nshm-eks", - "identity": [ - { - "oidc": [ - { - "issuer": "https://oidc.eks.ap-southeast-1.amazonaws.com/id/598DBCECD51D2202FCD362054A78FAC4" - } - ] - } - ], - "kubernetes_network_config": [ - { - "ip_family": "ipv4", - "service_ipv4_cidr": "172.20.0.0/16", - "service_ipv6_cidr": "" - } - ], - "name": "nshm-eks", - "outpost_config": [], - "platform_version": "eks.11", - "role_arn": "arn:aws:iam::985539788320:role/eks-cluster-role", - "status": "ACTIVE", - "tags": { - "Created": "EKS", - "Environment": "production" - }, - "tags_all": { - "Created": "EKS", - "Environment": "production" - }, - "timeouts": null, - "upgrade_policy": [ - { - "support_type": "EXTENDED" - } - ], - "version": "1.30", - "vpc_config": [ - { - "cluster_security_group_id": "sg-0ce86d4605a4ae8ce", - "endpoint_private_access": true, - "endpoint_public_access": false, - "public_access_cidrs": [], - "security_group_ids": [ - "sg-07b0c5e480023345b" - ], - "subnet_ids": [ - "subnet-006bc2a3ad9abca2b", - "subnet-038e79a626ee0912f", - "subnet-0e24b0144c0092c47", - "subnet-0f788325d8bd0b944" - ], - "vpc_id": "vpc-05448d5001b6a4cb2" - } - ] - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjkwMDAwMDAwMDAwMCwidXBkYXRlIjozNjAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=", - "dependencies": [ - "module.eks.aws_iam_role.eks_cluster_role", - "module.eks.aws_iam_role_policy_attachment.eks_cluster_policy_attachment", - "module.eks.data.aws_iam_policy_document.eks_assume_role_policy", - "module.vpc.aws_security_group.nus-secondhand-market", - "module.vpc.aws_subnet.private", - "module.vpc.aws_subnet.public", - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_eks_node_group", - "name": "nshm_node_group", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "status": "tainted", - "schema_version": 0, - "attributes": { - "ami_type": null, - "arn": null, - "capacity_type": "SPOT", - "cluster_name": "nshm-eks", - "disk_size": 20, - "force_update_version": null, - "id": "nshm-eks:nshm-eks-workers-30", - "instance_types": [ - "t2.micro", - "t3.micro" - ], - "labels": { - "role": "worker" - }, - "launch_template": [], - "node_group_name": "nshm-eks-workers-30", - "node_group_name_prefix": null, - "node_role_arn": "arn:aws:iam::985539788320:role/eks-node-role", - "release_version": null, - "remote_access": [], - "resources": null, - "scaling_config": [ - { - "desired_size": 2, - "max_size": 2, - "min_size": 0 - } - ], - "status": null, - "subnet_ids": [ - "subnet-038e79a626ee0912f", - "subnet-0e24b0144c0092c47" - ], - "tags": { - "Created": "EKS", - "Environment": "production" - }, - "tags_all": { - "Created": "EKS", - "Environment": "production" - }, - "taint": [], - "timeouts": null, - "update_config": null, - "version": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInVwZGF0ZSI6MzYwMDAwMDAwMDAwMH19", - "dependencies": [ - "module.eks.aws_eks_cluster.nshm_cluster", - "module.eks.aws_iam_role.eks_cluster_role", - "module.eks.aws_iam_role.eks_node_role", - "module.eks.aws_iam_role_policy_attachment.eks_cluster_policy_attachment", - "module.eks.data.aws_iam_policy_document.eks_assume_role_policy", - "module.eks.data.aws_iam_policy_document.eks_node_assume_role_policy", - "module.vpc.aws_security_group.nus-secondhand-market", - "module.vpc.aws_subnet.private", - "module.vpc.aws_subnet.public", - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_iam_role", - "name": "eks_cluster_role", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "arn": "arn:aws:iam::985539788320:role/eks-cluster-role", - "assume_role_policy": "{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"eks.amazonaws.com\"}}],\"Version\":\"2012-10-17\"}", - "create_date": "2024-10-02T23:48:54Z", - "description": "", - "force_detach_policies": false, - "id": "eks-cluster-role", - "inline_policy": [], - "managed_policy_arns": [], - "max_session_duration": 3600, - "name": "eks-cluster-role", - "name_prefix": "", - "path": "/", - "permissions_boundary": "", - "tags": null, - "tags_all": {}, - "unique_id": "AROA6K5V7XYQDNRM5DPZ3" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "module.eks.data.aws_iam_policy_document.eks_assume_role_policy" - ] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_iam_role", - "name": "eks_node_role", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "arn": "arn:aws:iam::985539788320:role/eks-node-role", - "assume_role_policy": "{\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"ec2.amazonaws.com\"}}],\"Version\":\"2012-10-17\"}", - "create_date": "2024-10-02T23:48:54Z", - "description": "", - "force_detach_policies": false, - "id": "eks-node-role", - "inline_policy": [], - "managed_policy_arns": [], - "max_session_duration": 3600, - "name": "eks-node-role", - "name_prefix": "", - "path": "/", - "permissions_boundary": "", - "tags": null, - "tags_all": {}, - "unique_id": "AROA6K5V7XYQJZKLNHH6C" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "module.eks.data.aws_iam_policy_document.eks_node_assume_role_policy" - ] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_iam_role_policy_attachment", - "name": "eks_cluster_policy_attachment", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "eks-cluster-role-20241002234855607000000002", - "policy_arn": "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy", - "role": "eks-cluster-role" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "module.eks.aws_iam_role.eks_cluster_role", - "module.eks.data.aws_iam_policy_document.eks_assume_role_policy" - ] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_iam_role_policy_attachment", - "name": "eks_cni_policy_attachment", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "eks-node-role-20241002234855709600000003", - "policy_arn": "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", - "role": "eks-node-role" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "module.eks.aws_iam_role.eks_node_role", - "module.eks.data.aws_iam_policy_document.eks_node_assume_role_policy" - ] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_iam_role_policy_attachment", - "name": "eks_ecr_readonly_policy_attachment", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "eks-node-role-20241002234855924500000004", - "policy_arn": "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", - "role": "eks-node-role" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "module.eks.aws_iam_role.eks_node_role", - "module.eks.data.aws_iam_policy_document.eks_node_assume_role_policy" - ] - } - ] - }, - { - "module": "module.eks", - "mode": "managed", - "type": "aws_iam_role_policy_attachment", - "name": "eks_worker_node_policy_attachment", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "id": "eks-node-role-20241002234856014800000005", - "policy_arn": "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", - "role": "eks-node-role" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "module.eks.aws_iam_role.eks_node_role", - "module.eks.data.aws_iam_policy_document.eks_node_assume_role_policy" - ] - } - ] - }, - { - "module": "module.s3", - "mode": "managed", - "type": "aws_s3_bucket", - "name": "bucket", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "acceleration_status": "", - "acl": "private", - "arn": "arn:aws:s3:::nus-secondhand-market", - "bucket": "nus-secondhand-market", - "bucket_domain_name": "nus-secondhand-market.s3.amazonaws.com", - "bucket_prefix": "", - "bucket_regional_domain_name": "nus-secondhand-market.s3.ap-southeast-1.amazonaws.com", - "cors_rule": [], - "force_destroy": false, - "grant": [ - { - "id": "997b2b420e6636c5a222324abb9bc30adf0024d14924a592d66db9453a1d3625", - "permissions": [ - "FULL_CONTROL" - ], - "type": "CanonicalUser", - "uri": "" - } - ], - "hosted_zone_id": "Z3O0J2DXBE1FTB", - "id": "nus-secondhand-market", - "lifecycle_rule": [], - "logging": [], - "object_lock_configuration": [], - "object_lock_enabled": false, - "policy": "", - "region": "ap-southeast-1", - "replication_configuration": [], - "request_payer": "BucketOwner", - "server_side_encryption_configuration": [ - { - "rule": [ - { - "apply_server_side_encryption_by_default": [ - { - "kms_master_key_id": "", - "sse_algorithm": "AES256" - } - ], - "bucket_key_enabled": false - } - ] - } - ], - "tags": null, - "tags_all": {}, - "timeouts": null, - "versioning": [ - { - "enabled": false, - "mfa_delete": false - } - ], - "website": [], - "website_domain": null, - "website_endpoint": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInJlYWQiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19" - } - ] - }, - { - "module": "module.vpc", - "mode": "managed", - "type": "aws_internet_gateway", - "name": "nus-secondhand-market", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:internet-gateway/igw-05d53ce7b85de97c9", - "id": "igw-05d53ce7b85de97c9", - "owner_id": "985539788320", - "tags": { - "Name": "nus-secondhand-market-igw" - }, - "tags_all": { - "Name": "nus-secondhand-market-igw" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.vpc", - "mode": "managed", - "type": "aws_route_table", - "name": "public", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:route-table/rtb-04a81d2c1b1d37d8e", - "id": "rtb-04a81d2c1b1d37d8e", - "owner_id": "985539788320", - "propagating_vgws": [], - "route": [ - { - "carrier_gateway_id": "", - "cidr_block": "0.0.0.0/0", - "core_network_arn": "", - "destination_prefix_list_id": "", - "egress_only_gateway_id": "", - "gateway_id": "igw-05d53ce7b85de97c9", - "ipv6_cidr_block": "", - "local_gateway_id": "", - "nat_gateway_id": "", - "network_interface_id": "", - "transit_gateway_id": "", - "vpc_endpoint_id": "", - "vpc_peering_connection_id": "" - } - ], - "tags": { - "Name": "nus-secondhand-market-public-route-table" - }, - "tags_all": { - "Name": "nus-secondhand-market-public-route-table" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", - "dependencies": [ - "module.vpc.aws_internet_gateway.nus-secondhand-market", - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.vpc", - "mode": "managed", - "type": "aws_route_table_association", - "name": "public", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "index_key": 0, - "schema_version": 0, - "attributes": { - "gateway_id": "", - "id": "rtbassoc-0b8942383fd5a6554", - "route_table_id": "rtb-04a81d2c1b1d37d8e", - "subnet_id": "subnet-0f788325d8bd0b944", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", - "dependencies": [ - "module.vpc.aws_internet_gateway.nus-secondhand-market", - "module.vpc.aws_route_table.public", - "module.vpc.aws_subnet.public", - "module.vpc.aws_vpc.nus-secondhand-market" - ] - }, - { - "index_key": 1, - "schema_version": 0, - "attributes": { - "gateway_id": "", - "id": "rtbassoc-0bb7580e2e9c47865", - "route_table_id": "rtb-04a81d2c1b1d37d8e", - "subnet_id": "subnet-006bc2a3ad9abca2b", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", - "dependencies": [ - "module.vpc.aws_internet_gateway.nus-secondhand-market", - "module.vpc.aws_route_table.public", - "module.vpc.aws_subnet.public", - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.vpc", - "mode": "managed", - "type": "aws_security_group", - "name": "nus-secondhand-market", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 1, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:security-group/sg-07b0c5e480023345b", - "description": "Managed by Terraform", - "egress": [ - { - "cidr_blocks": [ - "0.0.0.0/0" - ], - "description": "", - "from_port": 0, - "ipv6_cidr_blocks": [], - "prefix_list_ids": [], - "protocol": "-1", - "security_groups": [], - "self": false, - "to_port": 0 - } - ], - "id": "sg-07b0c5e480023345b", - "ingress": [ - { - "cidr_blocks": [ - "10.0.0.0/24" - ], - "description": "", - "from_port": 5432, - "ipv6_cidr_blocks": [], - "prefix_list_ids": [], - "protocol": "tcp", - "security_groups": [], - "self": false, - "to_port": 5432 - } - ], - "name": "nus-secondhand-market-sg", - "name_prefix": "", - "owner_id": "985539788320", - "revoke_rules_on_delete": false, - "tags": { - "Name": "nus-secondhand-market-sg" - }, - "tags_all": { - "Name": "nus-secondhand-market-sg" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.vpc", - "mode": "managed", - "type": "aws_subnet", - "name": "private", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "index_key": 0, - "schema_version": 1, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:subnet/subnet-0e24b0144c0092c47", - "assign_ipv6_address_on_creation": false, - "availability_zone": "ap-southeast-1a", - "availability_zone_id": "apse1-az2", - "cidr_block": "10.0.3.0/24", - "customer_owned_ipv4_pool": "", - "enable_dns64": false, - "enable_lni_at_device_index": 0, - "enable_resource_name_dns_a_record_on_launch": false, - "enable_resource_name_dns_aaaa_record_on_launch": false, - "id": "subnet-0e24b0144c0092c47", - "ipv6_cidr_block": "", - "ipv6_cidr_block_association_id": "", - "ipv6_native": false, - "map_customer_owned_ip_on_launch": false, - "map_public_ip_on_launch": false, - "outpost_arn": "", - "owner_id": "985539788320", - "private_dns_hostname_type_on_launch": "ip-name", - "tags": { - "Name": "nus-secondhand-market-private-subnet-1" - }, - "tags_all": { - "Name": "nus-secondhand-market-private-subnet-1" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ] - }, - { - "index_key": 1, - "schema_version": 1, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:subnet/subnet-038e79a626ee0912f", - "assign_ipv6_address_on_creation": false, - "availability_zone": "ap-southeast-1c", - "availability_zone_id": "apse1-az3", - "cidr_block": "10.0.4.0/24", - "customer_owned_ipv4_pool": "", - "enable_dns64": false, - "enable_lni_at_device_index": 0, - "enable_resource_name_dns_a_record_on_launch": false, - "enable_resource_name_dns_aaaa_record_on_launch": false, - "id": "subnet-038e79a626ee0912f", - "ipv6_cidr_block": "", - "ipv6_cidr_block_association_id": "", - "ipv6_native": false, - "map_customer_owned_ip_on_launch": false, - "map_public_ip_on_launch": false, - "outpost_arn": "", - "owner_id": "985539788320", - "private_dns_hostname_type_on_launch": "ip-name", - "tags": { - "Name": "nus-secondhand-market-private-subnet-2" - }, - "tags_all": { - "Name": "nus-secondhand-market-private-subnet-2" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ] - } - ] - }, - { - "module": "module.vpc", - "mode": "managed", - "type": "aws_subnet", - "name": "public", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "index_key": 0, - "schema_version": 1, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:subnet/subnet-0f788325d8bd0b944", - "assign_ipv6_address_on_creation": false, - "availability_zone": "ap-southeast-1a", - "availability_zone_id": "apse1-az2", - "cidr_block": "10.0.1.0/24", - "customer_owned_ipv4_pool": "", - "enable_dns64": false, - "enable_lni_at_device_index": 0, - "enable_resource_name_dns_a_record_on_launch": false, - "enable_resource_name_dns_aaaa_record_on_launch": false, - "id": "subnet-0f788325d8bd0b944", - "ipv6_cidr_block": "", - "ipv6_cidr_block_association_id": "", - "ipv6_native": false, - "map_customer_owned_ip_on_launch": false, - "map_public_ip_on_launch": true, - "outpost_arn": "", - "owner_id": "985539788320", - "private_dns_hostname_type_on_launch": "ip-name", - "tags": { - "Name": "nus-secondhand-market-public-subnet-1" - }, - "tags_all": { - "Name": "nus-secondhand-market-public-subnet-1" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ], - "create_before_destroy": true - }, - { - "index_key": 1, - "schema_version": 1, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:subnet/subnet-006bc2a3ad9abca2b", - "assign_ipv6_address_on_creation": false, - "availability_zone": "ap-southeast-1c", - "availability_zone_id": "apse1-az3", - "cidr_block": "10.0.2.0/24", - "customer_owned_ipv4_pool": "", - "enable_dns64": false, - "enable_lni_at_device_index": 0, - "enable_resource_name_dns_a_record_on_launch": false, - "enable_resource_name_dns_aaaa_record_on_launch": false, - "id": "subnet-006bc2a3ad9abca2b", - "ipv6_cidr_block": "", - "ipv6_cidr_block_association_id": "", - "ipv6_native": false, - "map_customer_owned_ip_on_launch": false, - "map_public_ip_on_launch": true, - "outpost_arn": "", - "owner_id": "985539788320", - "private_dns_hostname_type_on_launch": "ip-name", - "tags": { - "Name": "nus-secondhand-market-public-subnet-2" - }, - "tags_all": { - "Name": "nus-secondhand-market-public-subnet-2" - }, - "timeouts": null, - "vpc_id": "vpc-05448d5001b6a4cb2" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", - "dependencies": [ - "module.vpc.aws_vpc.nus-secondhand-market" - ], - "create_before_destroy": true - } - ] - }, - { - "module": "module.vpc", - "mode": "managed", - "type": "aws_vpc", - "name": "nus-secondhand-market", - "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]", - "instances": [ - { - "schema_version": 1, - "attributes": { - "arn": "arn:aws:ec2:ap-southeast-1:985539788320:vpc/vpc-05448d5001b6a4cb2", - "assign_generated_ipv6_cidr_block": false, - "cidr_block": "10.0.0.0/16", - "default_network_acl_id": "acl-04c92734b7ea32d98", - "default_route_table_id": "rtb-09b2f9634a77d5048", - "default_security_group_id": "sg-03dae0596e759d08d", - "dhcp_options_id": "dopt-05d775bcfb205a258", - "enable_dns_hostnames": false, - "enable_dns_support": true, - "enable_network_address_usage_metrics": false, - "id": "vpc-05448d5001b6a4cb2", - "instance_tenancy": "default", - "ipv4_ipam_pool_id": null, - "ipv4_netmask_length": null, - "ipv6_association_id": "", - "ipv6_cidr_block": "", - "ipv6_cidr_block_network_border_group": "", - "ipv6_ipam_pool_id": "", - "ipv6_netmask_length": 0, - "main_route_table_id": "rtb-09b2f9634a77d5048", - "owner_id": "985539788320", - "tags": { - "Name": "nus-secondhand-market" - }, - "tags_all": { - "Name": "nus-secondhand-market" - } - }, - "sensitive_attributes": [], - "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==", - "create_before_destroy": true - } - ] - } - ], - "check_results": null -}