docs: update MFE infra docs with api-gateway-mfe-dev deployment
Document completed Terraform provisioning of api-gateway-mfe-dev (IP 10.110.198.250), VCN peering requirements, LB routing plan, updated Variable Group info, and checklist status. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
72cfe3edf1
commit
8da89ddd25
5 changed files with 307 additions and 191 deletions
|
|
@ -49,17 +49,105 @@
|
|||
|
||||
---
|
||||
|
||||
## Frontends Estáticos (Buckets)
|
||||
## Gateway 3: api-gateway-mfe-dev (Terraform-managed)
|
||||
|
||||
| Bucket | URL | Descrição |
|
||||
| Propriedade | Valor |
|
||||
|-------------|-------|
|
||||
| Nome | api-gateway-mfe-dev |
|
||||
| Tipo | PRIVATE |
|
||||
| OCID | `ocid1.apigateway.oc1.sa-saopaulo-1.amaaaaaasks3yliabdiquogy2pqyohas4wjopizv2xzgzrclmsvsh4x7ewea` |
|
||||
| Hostname | `guhal72tzyekzchzamhhi3lvgi.apigateway.sa-saopaulo-1.oci.customer-oci.com` |
|
||||
| IP | 10.110.198.250 |
|
||||
| VCN | vcn-oke (10.110.0.0/16) |
|
||||
| Subnet | sbn-api-gateway (10.110.192.0/20) |
|
||||
| Compartment | DEV (`ocid1.compartment.oc1..aaaaaaaa76x3nykkjwvctpr6px34dysu3pbg7p62h2r65fegt7fvbrioll3a`) |
|
||||
| Estado | ACTIVE |
|
||||
| Gerenciado por | Terraform (`tf_oci_clusters/modules/api_gateway_mfe`) |
|
||||
| Criado em | 2026-02-22 (pipeline build #5964) |
|
||||
|
||||
### Deployments
|
||||
|
||||
| Nome | Path | Backend | Descrição |
|
||||
|------|------|---------|-----------|
|
||||
| deploy-mfe-user-dev | / | Object Storage `nexus-mfe-user-development` | SPA Angular - index.html |
|
||||
| deploy-mfe-user-dev | /{path*} | Object Storage `nexus-mfe-user-development` | Arquivos estáticos (JS/CSS/assets) |
|
||||
|
||||
### Acesso
|
||||
|
||||
| Tipo | URL |
|
||||
|------|-----|
|
||||
| Direto (privado) | `https://guhal72tzyekzchzamhhi3lvgi.apigateway.sa-saopaulo-1.oci.customer-oci.com/` |
|
||||
| Planejado (DNS) | `https://mfe-user-dev.invista.com.br` (pendente VCN peering + LB + Cloudflare) |
|
||||
|
||||
### Terraform
|
||||
|
||||
```hcl
|
||||
# environments/dev/api_gateway_mfe.tf
|
||||
module "api_gateway_mfe" {
|
||||
source = "../../modules/api_gateway_mfe"
|
||||
compartment_id = local.compartment_id
|
||||
subnet_id = module.network.api_gateway_subnet_id
|
||||
env_name = var.env_name
|
||||
display_name = "api-gateway-mfe"
|
||||
mfe_deployments = [{
|
||||
name = "mfe-user"
|
||||
bucket_name = "nexus-mfe-user-development"
|
||||
region = "sa-saopaulo-1"
|
||||
object_namespace = var.mfe_object_namespace # grbb7qzeuoag
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
### Pendencias
|
||||
|
||||
- [ ] VCN Peering: Attach dev VCN ao DRG-Invista-Shared
|
||||
- [ ] Rota no LB Test_Crivo_Dev: backend set apontando para 10.110.198.250:443
|
||||
- [ ] Routing policy: hostname `mfe-user-dev.invista.com.br`
|
||||
- [ ] DNS Cloudflare: CNAME `mfe-user-dev` -> LB IP (via Cloudflare proxy)
|
||||
|
||||
---
|
||||
|
||||
## Frontends Estaticos (Buckets)
|
||||
|
||||
| Bucket | URL | Descricao |
|
||||
|--------|-----|-----------|
|
||||
| app-front-insign-teste | Cloudflare + OCI | Site estático de teste |
|
||||
| front | - | Ícones SVG |
|
||||
| app-front-insign-teste | Cloudflare + OCI | Site estatico de teste |
|
||||
| front | - | Icones SVG |
|
||||
| nexus-mfe-shell-development | - | Shell MFE Angular |
|
||||
| nexus-mfe-auth-development | - | MFE Auth |
|
||||
| nexus-mfe-user-development | - | MFE User |
|
||||
| nexus-mfe-user-development | API Gateway MFE dev | MFE User (servido via api-gateway-mfe-dev) |
|
||||
| nexus-mfe-person-development | - | MFE Person |
|
||||
|
||||
---
|
||||
|
||||
*Atualizado em: 2026-02-21*
|
||||
## Conectividade de Rede
|
||||
|
||||
### VCNs envolvidas
|
||||
|
||||
| VCN | CIDR | Componentes |
|
||||
|-----|------|-------------|
|
||||
| VCN-Shared | 10.8.0.0/16 | LB Test_Crivo_Dev (10.8.4.127) |
|
||||
| vcn-oke (dev) | 10.110.0.0/16 | API Gateway MFE (10.110.198.250), OKE clusters |
|
||||
|
||||
### DRG (Dynamic Routing Gateway)
|
||||
|
||||
| Propriedade | Valor |
|
||||
|-------------|-------|
|
||||
| Nome | DRG-Invista-Shared |
|
||||
| OCID | `ocid1.drg.oc1.sa-saopaulo-1.aaaaaaaazuiluiavm3zcrzelqs2f3k3sdy3fka5yytwjua37a2ksn446deza` |
|
||||
| VCN-Shared | Attached |
|
||||
| vcn-oke (dev) | **Pendente** - necessario para LB acessar API Gateway |
|
||||
|
||||
### Fluxo de rede planejado
|
||||
|
||||
```
|
||||
Browser -> Cloudflare (mfe-user-dev.invista.com.br)
|
||||
-> LB Test_Crivo_Dev (10.8.4.127, VCN-Shared)
|
||||
-> DRG-Invista-Shared (VCN peering)
|
||||
-> API Gateway MFE (10.110.198.250, vcn-oke)
|
||||
-> Object Storage (nexus-mfe-user-development)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
*Atualizado em: 2026-02-23*
|
||||
|
|
|
|||
|
|
@ -87,13 +87,31 @@ Total: **34 Load Balancers ativos**
|
|||
| Certificado | `*.invista.com.br` (Cloudflare Origin CA) |
|
||||
| Protocolo | HTTPS (TLS 1.2/1.3) |
|
||||
|
||||
**Domínios roteados:**
|
||||
**Dominios roteados (routing policy `crivo_routes`):**
|
||||
|
||||
| Domínio | Backend |
|
||||
| Dominio | Backend |
|
||||
|---------|---------|
|
||||
| crivo-dev.invista.com.br | 10.4.0.116:80 |
|
||||
| crivo-dev-adm.invista.com.br | 10.4.0.116:84 |
|
||||
|
||||
**Planejado (pendente VCN peering):**
|
||||
|
||||
| Dominio | Backend | Status |
|
||||
|---------|---------|--------|
|
||||
| mfe-user-dev.invista.com.br | 10.110.198.250:443 (api-gateway-mfe-dev) | Pendente DRG attachment |
|
||||
|
||||
### Requisito: VCN Peering
|
||||
|
||||
O LB `Test_Crivo_Dev` esta na VCN-Shared (10.8.0.0/16).
|
||||
O API Gateway MFE esta na vcn-oke dev (10.110.0.0/16).
|
||||
|
||||
Para o LB acessar o API Gateway, e necessario:
|
||||
1. Attach vcn-oke dev ao DRG `DRG-Invista-Shared`
|
||||
2. Configurar route tables em ambas VCNs
|
||||
3. Ajustar security lists
|
||||
|
||||
Ver detalhes em [API-GATEWAY.md](./API-GATEWAY.md#conectividade-de-rede).
|
||||
|
||||
---
|
||||
|
||||
## Comandos OCI CLI
|
||||
|
|
@ -111,4 +129,4 @@ oci lb certificate list --load-balancer-id "<OCID>" --region sa-saopaulo-1
|
|||
|
||||
---
|
||||
|
||||
*Atualizado em: 2026-02-21*
|
||||
*Atualizado em: 2026-02-23*
|
||||
|
|
|
|||
|
|
@ -97,48 +97,84 @@ routes:
|
|||
url: "https://grbb7qzeuoag.objectstorage.sa-saopaulo-1.oci.customer-oci.com/n/grbb7qzeuoag/b/nexus-mfe-user-dev/o/${request.path[req]}"
|
||||
```
|
||||
|
||||
## Configuração via Terraform
|
||||
## Configuracao via Terraform (Implementado)
|
||||
|
||||
### Módulo API Gateway
|
||||
O API Gateway MFE e provisionado via Terraform no repositorio `tf_oci_clusters`.
|
||||
|
||||
### Repositorio: `tf_oci_clusters`
|
||||
|
||||
```
|
||||
tf_oci_clusters/
|
||||
├── modules/
|
||||
│ ├── api_gateway_mfe/ # Modulo API Gateway MFE
|
||||
│ │ ├── main.tf # Gateway + Deployment (rotas SPA)
|
||||
│ │ ├── variables.tf # Inputs
|
||||
│ │ ├── outputs.tf # gateway_id, ip, hostname, endpoints
|
||||
│ │ └── versions.tf # oracle/oci ~> 7.0
|
||||
│ └── network/
|
||||
│ └── main.tf # Subnet sbn-api-gateway (condicional)
|
||||
├── environments/
|
||||
│ └── dev/
|
||||
│ ├── main.tf # enable_api_gateway_subnet
|
||||
│ ├── api_gateway_mfe.tf # Integracao do modulo
|
||||
│ └── terraform.ci.tfvars # enable_api_gateway_mfe = true
|
||||
```
|
||||
|
||||
### Uso do modulo
|
||||
|
||||
```hcl
|
||||
module "api_gateway" {
|
||||
source = "./modules/api_gateway"
|
||||
|
||||
compartment_id = var.compartment_id
|
||||
subnet_id = var.subnet_id
|
||||
name = "nexus-mfe-user"
|
||||
environment = "dev"
|
||||
}
|
||||
# environments/dev/api_gateway_mfe.tf
|
||||
module "api_gateway_mfe" {
|
||||
count = var.enable_api_gateway_mfe ? 1 : 0
|
||||
source = "../../modules/api_gateway_mfe"
|
||||
compartment_id = local.compartment_id
|
||||
subnet_id = module.network.api_gateway_subnet_id
|
||||
env_name = var.env_name
|
||||
display_name = "api-gateway-mfe"
|
||||
|
||||
module "api_gateway_deployment" {
|
||||
source = "./modules/api_gateway_deployment"
|
||||
|
||||
gateway_id = module.api_gateway.gateway_id
|
||||
bucket_name = "nexus-mfe-user-dev"
|
||||
namespace = "grbb7qzeuoag"
|
||||
region = "sa-saopaulo-1"
|
||||
mfe_deployments = [
|
||||
{
|
||||
name = "mfe-user"
|
||||
bucket_name = "nexus-mfe-user-development"
|
||||
region = "sa-saopaulo-1"
|
||||
object_namespace = var.mfe_object_namespace # grbb7qzeuoag
|
||||
},
|
||||
# Adicionar mais MFEs aqui:
|
||||
# { name = "mfe-shell", bucket_name = "nexus-mfe-shell-development", ... },
|
||||
# { name = "mfe-auth", bucket_name = "nexus-mfe-auth-development", ... },
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Pipeline Azure DevOps - Fluxo
|
||||
### Rotas SPA (Angular)
|
||||
|
||||
O deployment cria duas rotas para cada MFE:
|
||||
|
||||
1. **`/`** (GET) -> `index.html` no Object Storage (SPA entry point)
|
||||
2. **`/{path*}`** (GET) -> arquivos estaticos no Object Storage (JS, CSS, assets)
|
||||
|
||||
### Pipeline CI/CD
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ Build │ ─► │ Upload │ ─► │ CreatePAR │ ─► │ Deploy API │
|
||||
│ (npm build)│ │ (OCI OS) │ │ (OCI) │ │ (Gateway) │
|
||||
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
|
||||
Push to main (tf_oci_clusters)
|
||||
-> Bootstrap (init + validate)
|
||||
-> Detect Changes (diff por environment)
|
||||
-> Plan (terraform plan -var-file=terraform.ci.tfvars)
|
||||
-> Manual Approval
|
||||
-> Apply (terraform apply)
|
||||
```
|
||||
|
||||
Pipeline: `terraform-tf_oci_clusters` (ID 51)
|
||||
Variable Group: `oci-terraform` (ID 34)
|
||||
|
||||
## URLs de Acesso
|
||||
|
||||
### Por Ambiente
|
||||
### DEV
|
||||
|
||||
| Ambiente | URL API Gateway |
|
||||
|----------|----------------|
|
||||
| Dev | `https://gateway-ocid.apigateway.sa-saopaulo-1.oci.customer-oci.com` |
|
||||
| HML | `https://gateway-ocid.apigateway.sa-saopaulo-1.oci.customer-oci.com` |
|
||||
| PROD | `https://gateway-ocid.apigateway.sa-saopaulo-1.oci.customer-oci.com` |
|
||||
| Tipo | URL |
|
||||
|------|-----|
|
||||
| API Gateway (privado) | `https://guhal72tzyekzchzamhhi3lvgi.apigateway.sa-saopaulo-1.oci.customer-oci.com/` |
|
||||
| Planejado (publico) | `https://mfe-user-dev.invista.com.br` (pendente) |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
|
@ -188,3 +224,7 @@ oci os preauth-request delete \
|
|||
|
||||
- [OCI API Gateway Docs](https://docs.oracle.com/en-us/iaas/Content/APIGateway/apigateway.htm)
|
||||
- [Static Website Hosting](https://docs.oracle.com/en/learn/oci-api-gateway-web-hosting/index.html)
|
||||
|
||||
---
|
||||
|
||||
*Atualizado em: 2026-02-23*
|
||||
|
|
|
|||
|
|
@ -18,130 +18,105 @@
|
|||
|
||||
---
|
||||
|
||||
## Estado Atual da Infraestrutura OCI (verificado em 2026-02-17)
|
||||
## Estado Atual da Infraestrutura OCI (atualizado em 2026-02-23)
|
||||
|
||||
### VCNs Existentes (Dev)
|
||||
|
||||
| Nome | CIDR | OCID |
|
||||
|------|------|------|
|
||||
| VCN-Shared | 10.8.0.0/16 | (compartment cmp-shared-inv) |
|
||||
| vcn-oke (dev) | 10.110.0.0/16 | `ocid1.vcn.oc1.sa-saopaulo-1.amaaaaaasks3yliapqrmikfzagpgqohuzjqik3hx63w7r2uajiqv5krvxkda` |
|
||||
| vcn-oke | 10.120.0.0/16 | `ocid1.vcn.oc1.sa-saopaulo-1.amaaaaaasks3yliatayztbyd6doyk5oglrmrc57jekltu3xnnena6fvruwba` |
|
||||
| vcn-oke | 10.110.0.0/16 | (múltiplas) |
|
||||
|
||||
### Subnets Existentes (VCN 10.120.0.0/16)
|
||||
### Subnets - vcn-oke dev (10.110.0.0/16) - Terraform managed
|
||||
|
||||
| Nome | CIDR | Tipo | OCID |
|
||||
|------|------|------|------|
|
||||
| sbn-workers-1 | 10.120.0.0/20 | Workers | `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaazfomdghi4x4jpluyjooy7ajvsf5y57jq2xcqwf35guodkcn2wrwq` |
|
||||
| sbn-workers-2 | 10.120.16.0/20 | Workers | `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaahaqguwt67kzs2dad2vyz3zpjl5ac7ximeqg55gmsnd33c2qikija` |
|
||||
| sbn-workers-3 | 10.120.32.0/20 | Workers | `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaafzhmhvz2scr6sfsygixz2gjfnecggiirh3rvyhjcmfn3ohmohj6a` |
|
||||
| sbn-lb-1 | 10.120.128.0/20 | Load Balancer | `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaa2ezw57uocis6s2eioypdsnt2p4pwm4fwnjz5jdaqigrm6jaqexeq` |
|
||||
| sbn-lb-2 | 10.120.144.0/20 | Load Balancer | `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaav7qtnmgil2qdt3lz6fnqkdcbymjd2dtjjeyo6y7z3s2omq4uvcqa` |
|
||||
| sbn-workers-1 | 10.110.0.0/20 | Workers | (Terraform) |
|
||||
| sbn-workers-2 | 10.110.16.0/20 | Workers | (Terraform) |
|
||||
| sbn-workers-3 | 10.110.32.0/20 | Workers | (Terraform) |
|
||||
| sbn-lb-1 | 10.110.128.0/20 | Load Balancer | (Terraform) |
|
||||
| sbn-lb-2 | 10.110.144.0/20 | Load Balancer | (Terraform) |
|
||||
| sbn-api-gateway | 10.110.192.0/20 | API Gateway | `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaaooiy6bmikuaohtxyz2o3sjrjp2iqob3rim4j66vw4rzit7jcqjfa` |
|
||||
|
||||
### API Gateways
|
||||
|
||||
| Nome | Status |
|
||||
|------|--------|
|
||||
| - | ❌ Nenhum criado |
|
||||
| Nome | IP | Status | Gerenciado |
|
||||
|------|-----|--------|-----------|
|
||||
| api-gateway-mfe-dev | 10.110.198.250 | ACTIVE | Terraform (`tf_oci_clusters`) |
|
||||
|
||||
### Buckets (Object Storage)
|
||||
|
||||
| Nome | Status |
|
||||
|------|--------|
|
||||
| - | ❌ Nenhum criado |
|
||||
| Nome | Status | Uso |
|
||||
|------|--------|-----|
|
||||
| nexus-mfe-user-development | ACTIVE | MFE User (Angular SPA) |
|
||||
| nexus-mfe-shell-development | ACTIVE | Shell MFE Angular |
|
||||
| nexus-mfe-auth-development | ACTIVE | MFE Auth |
|
||||
| nexus-mfe-person-development | ACTIVE | MFE Person |
|
||||
|
||||
---
|
||||
|
||||
## Recomendação: Usar Subnet Existente
|
||||
## Infraestrutura Terraform (Concluido)
|
||||
|
||||
Para o API Gateway, podemos usar a subnet de Load Balancer existente:
|
||||
- **sbn-lb-1**: `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaa2ezw57uocis6s2eioypdsnt2p4pwm4fwnjz5jdaqigrm6jaqexeq`
|
||||
O API Gateway MFE e provisionado automaticamente via Terraform no repositorio `tf_oci_clusters`.
|
||||
|
||||
## Atividades Necessárias para Completar o Setup OCI
|
||||
### Modulo: `modules/api_gateway_mfe/`
|
||||
|
||||
### 🔴 Crítico - Infraestrutura OCI
|
||||
Arquivos:
|
||||
- `main.tf` - Gateway + Deployment com rotas SPA (index.html fallback + static files)
|
||||
- `variables.tf` - Inputs (compartment_id, subnet_id, env_name, mfe_deployments list)
|
||||
- `outputs.tf` - gateway_id, gateway_ip, gateway_hostname, deployment_endpoints
|
||||
- `versions.tf` - oracle/oci ~> 7.0
|
||||
|
||||
#### 1. Criar/Configurar VCN (Virtual Cloud Network)
|
||||
- **Descrição**: API Gateway precisa de uma VCN com subnets
|
||||
- **Status**: ❌ Precisa ser criado via Terraform
|
||||
- **Responsável**: Infraestrutura
|
||||
### Subnet dedicada (adicionada ao modulo network)
|
||||
|
||||
#### 2. Obter Subnet OCID para API Gateway
|
||||
- **Descrição**: Cada API Gateway precisa de uma subnet dedicada
|
||||
- **Status**: ❌ Variável `OCI_SUBNET_OCID` não existe no Variable Group
|
||||
A subnet `sbn-api-gateway` foi criada automaticamente pelo Terraform no modulo `network`:
|
||||
- CIDR: 10.110.192.0/20 (cidrsubnet index 12)
|
||||
- Route table: NAT + Service Gateway (privada)
|
||||
- Security list: ingress 80/443 da VCN, egress all
|
||||
- Toggle: `enable_api_gateway_subnet` (bool)
|
||||
|
||||
#### 3. Criar Variable Group `oci-terraform` no Azure DevOps
|
||||
- **Variáveis necessárias**:
|
||||
- `OCI_USER_OCID`
|
||||
- `OCI_TENANCY_OCID`
|
||||
- `OCI_REGION`
|
||||
- `OCI_FINGERPRINT`
|
||||
- `OCI_PRIVATE_KEY_B64`
|
||||
- `OCI_COMPARTMENT_OCID`
|
||||
- `OCI_SUBNET_OCID` ← **NOVO**
|
||||
### Pipeline CI/CD
|
||||
|
||||
---
|
||||
- **Pipeline**: `terraform-tf_oci_clusters` (definition ID 51)
|
||||
- **YAML**: `.azure/azure-pipelines-pr-selective.yml`
|
||||
- **Variable Group**: `oci-terraform` (ID 34)
|
||||
- **Build de sucesso**: #5964 (todas as stages passaram)
|
||||
|
||||
### 🟡 Pipeline - Melhorias Necessárias
|
||||
## Atividades Restantes
|
||||
|
||||
#### 4. Melhorar Routes do API Gateway (SPAs)
|
||||
### Conectividade de Rede (Pendente)
|
||||
|
||||
A pipeline atual usa rota única:
|
||||
```yaml
|
||||
routes:
|
||||
- path: /{req.*}
|
||||
methods: [GET]
|
||||
backend:
|
||||
type: HTTP
|
||||
url: "${PAR_URL}"
|
||||
```
|
||||
#### 1. VCN Peering via DRG
|
||||
|
||||
**Problema**: Não funciona bem para SPAs (Angular) que precisam de:
|
||||
- `/` → retorna `index.html`
|
||||
- `/route1` → retorna `index.html` (SPA routing)
|
||||
- `*.js` → retorna JavaScript
|
||||
- `*.css` → retorna CSS
|
||||
- `*.html` → retorna HTML
|
||||
O LB `Test_Crivo_Dev` esta na VCN-Shared (10.8.0.0/16) e o API Gateway esta na vcn-oke dev (10.110.0.0/16).
|
||||
Para que o LB consiga rotear trafego para o API Gateway, e necessario:
|
||||
|
||||
**Solução**: Implementar rotas múltiplas conforme documentação:
|
||||
1. **Attach vcn-oke dev ao DRG-Invista-Shared**
|
||||
- DRG OCID: `ocid1.drg.oc1.sa-saopaulo-1.aaaaaaaazuiluiavm3zcrzelqs2f3k3sdy3fka5yytwjua37a2ksn446deza`
|
||||
- VCN dev OCID: `ocid1.vcn.oc1.sa-saopaulo-1.amaaaaaasks3yliapqrmikfzagpgqohuzjqik3hx63w7r2uajiqv5krvxkda`
|
||||
|
||||
```yaml
|
||||
routes:
|
||||
# Rota default - index.html para SPA
|
||||
- path: /{req.*}
|
||||
methods: [GET]
|
||||
backend:
|
||||
type: HTTP
|
||||
url: "${PAR_URL}/${request.path[req]}"
|
||||
2. **Configurar Route Tables**
|
||||
- Na VCN-Shared: rota 10.110.0.0/16 -> DRG
|
||||
- Na vcn-oke dev: rota 10.8.0.0/16 -> DRG (para retorno)
|
||||
|
||||
# Regras específicas por tipo de arquivo
|
||||
- path: /{ext}.js
|
||||
methods: [GET]
|
||||
backend:
|
||||
type: HTTP
|
||||
url: "https://{namespace}.objectstorage.{region}.oci.customer-oci.com/n/{bucket}/o/${request.path[req]}"
|
||||
3. **Security Lists**
|
||||
- Permitir trafego entre 10.8.0.0/16 e 10.110.192.0/20 (subnet API GW)
|
||||
|
||||
# wildcard *.js, *.css, etc.
|
||||
```
|
||||
#### 2. Load Balancer - Backend e Routing
|
||||
|
||||
#### 5. Suporte a Múltiplos Ambientes
|
||||
No LB `Test_Crivo_Dev` (IP 10.8.4.127):
|
||||
|
||||
| Ambiente | Bucket | API Gateway |
|
||||
|----------|--------|-------------|
|
||||
| Dev | `nexus-{mfe}-dev` | `{mfe}-dev-gateway` |
|
||||
| HML | `nexus-{mfe}-hml` | `{mfe}-hml-gateway` |
|
||||
| PROD | `nexus-{mfe}-prod` | `{mfe}-prod-gateway` |
|
||||
1. **Criar backend set** `bs-mfe-user-dev` apontando para `10.110.198.250:443`
|
||||
2. **Adicionar routing rule** no routing policy `crivo_routes` para hostname `mfe-user-dev.invista.com.br`
|
||||
3. **Health check** na rota `/` do API Gateway
|
||||
|
||||
#### 6. Tratar Variáveis por Ambiente
|
||||
#### 3. DNS Cloudflare
|
||||
|
||||
```yaml
|
||||
parameters:
|
||||
- name: environment
|
||||
type: string
|
||||
values:
|
||||
- dev
|
||||
- hml
|
||||
- prod
|
||||
```
|
||||
Criar registro DNS em `invista.com.br`:
|
||||
- Tipo: CNAME (proxied)
|
||||
- Nome: `mfe-user-dev`
|
||||
- Target: endpoint Cloudflare tunnel ou A record para IP do LB
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -158,83 +133,68 @@ parameters:
|
|||
|
||||
---
|
||||
|
||||
## 🔧 Variable Group `oci-terraform`
|
||||
## Variable Group `oci-terraform` (ID 34)
|
||||
|
||||
O Variable Group **`oci-terraform`** no Azure DevOps contém as credenciais OCI usadas tanto pelo Terraform (para criar infraestrutura) quanto pelas pipelines de deploy MFE.
|
||||
O Variable Group **`oci-terraform`** no Azure DevOps contem as credenciais OCI usadas pelo Terraform e pipelines MFE.
|
||||
|
||||
### Variáveis Existentes (usadas pelo Terraform)
|
||||
**Ultima atualizacao**: 2026-02-22 (S3 credentials atualizadas para usuario `danilo.duarte`)
|
||||
|
||||
| Variável | Tipo | Descrição |
|
||||
### Variaveis
|
||||
|
||||
| Variavel | Tipo | Descricao |
|
||||
|----------|------|-----------|
|
||||
| `OCI_TENANCY_OCID` | Secret | OCID da Tenancy OCI |
|
||||
| `OCI_USER_OCID` | Secret | OCID do Usuário OCI |
|
||||
| `OCI_FINGERPRINT` | Secret | Fingerprint da chave pública (~47 chars) |
|
||||
| `OCI_PRIVATE_KEY_B64` | Secret | Chave privada (Base64 ou PEM) |
|
||||
| `OCI_REGION` |普通 | Região OCI (ex: sa-saopaulo-1) |
|
||||
| `COMPARTMENT_PARENT_OCID` | Secret | OCID do compartment pai |
|
||||
| `OCI_TENANCY_OCID` | Plain | OCID da Tenancy OCI |
|
||||
| `OCI_USER_OCID` | Plain | OCID do Usuario OCI (danilo.duarte) |
|
||||
| `OCI_FINGERPRINT` | Plain | Fingerprint da chave publica |
|
||||
| `OCI_PRIVATE_KEY_B64` | Plain | Chave privada Base64 |
|
||||
| `OCI_REGION` | Plain | sa-saopaulo-1 |
|
||||
| `OCI_PRIVATE_KEY_PATH` | Plain | ./config/oci_api_key.pem |
|
||||
| `TF_STATE_ACCESS_KEY` | Secret | S3-compatible access key (danilo.duarte) |
|
||||
| `TF_STATE_SECRET_KEY` | Secret | S3-compatible secret key (danilo.duarte) |
|
||||
| `TF_VAR_compartment_parent_ocid` | Secret | OCID do compartment pai |
|
||||
| `EXISTING_COMPARTMENT_ID` | Plain | Compartment DEV |
|
||||
| `ARGOCD_REPO_PAT` | Secret | PAT para ArgoCD |
|
||||
| `CLOUDFLARE_API_TOKEN` | Secret | Token Cloudflare |
|
||||
| `SSH_PUBLIC_KEY` / `SSH_PUBLIC_KEY_B64` | Secret | Chave SSH para nodes/bastion |
|
||||
| `TLS_CERT_B64` / `TLS_KEY_B64` | Secret | Certificados TLS |
|
||||
|
||||
### Variáveis FALTANDO para API Gateway (precisam ser adicionadas)
|
||||
### Historico de problemas
|
||||
|
||||
| Variável | Tipo | Descrição |
|
||||
|----------|------|-----------|
|
||||
| `OCI_SUBNET_OCID` | Secret | **OCID da Subnet** para API Gateway |
|
||||
|
||||
### Onde o `oci-terraform` é usado
|
||||
|
||||
1. **Terraform OCI** (`tf_oci_clusters`):
|
||||
- Criar VCNs, Subnets, OKE Clusters
|
||||
- Criar Buckets (se necessário via Terraform)
|
||||
|
||||
2. **Pipelines MFE OCI**:
|
||||
- `mfe-user/azure-pipelines-oci.yml` ← usa este grupo
|
||||
- Upload de arquivos para Object Storage
|
||||
- Criar PAR (Pre-Authenticated Request)
|
||||
- Deploy no API Gateway
|
||||
|
||||
### Fluxo Completo
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ 1. Terraform (tf_oci_clusters) usa oci-terraform │
|
||||
│ └── Cria: VCN, Subnets, OKE Clusters, Buckets │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ 2. Pipeline MFE usa oci-terraform │
|
||||
│ └── Upload → Object Storage │
|
||||
│ └── Create PAR │
|
||||
│ └── Deploy → API Gateway │
|
||||
└─────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
- **2026-02-22**: S3 credentials (`TF_STATE_ACCESS_KEY`/`SECRET_KEY`) atualizadas.
|
||||
As credenciais anteriores pertenciam ao usuario `william.dias` que estava desabilitado para S3.
|
||||
Criado novo Customer Secret Key para `danilo.duarte` via OCI CLI.
|
||||
|
||||
---
|
||||
|
||||
## Checklist de Atividades
|
||||
|
||||
### Infraestrutura (Terraform)
|
||||
- [x] VCN já existe (`vcn-oke` 10.120.0.0/16)
|
||||
- [x] Subnets já existem (sbn-lb-1 pode ser usada para API Gateway)
|
||||
- [ ] Criar subnet dedicada para API Gateway (opcional, pode usar sbn-lb-1)
|
||||
- [ ] Adicionar `OCI_SUBNET_OCID` ao Variable Group `oci-terraform`
|
||||
### Infraestrutura Terraform (Concluido)
|
||||
- [x] VCN vcn-oke dev (10.110.0.0/16) criada via Terraform
|
||||
- [x] Subnet dedicada `sbn-api-gateway` (10.110.192.0/20) criada via Terraform
|
||||
- [x] Modulo `api_gateway_mfe` criado (`tf_oci_clusters/modules/api_gateway_mfe/`)
|
||||
- [x] API Gateway `api-gateway-mfe-dev` provisionado (IP 10.110.198.250)
|
||||
- [x] Deployment MFE User com rotas SPA (index.html + static files)
|
||||
- [x] Pipeline CI/CD `terraform-tf_oci_clusters` funcionando (build #5964)
|
||||
- [x] Variable Group `oci-terraform` atualizado (S3 credentials corrigidas)
|
||||
|
||||
### Azure DevOps
|
||||
- [ ] Adicionar `OCI_SUBNET_OCID` ao Variable Group `oci-terraform`
|
||||
- **Valor sugerido**: `ocid1.subnet.oc1.sa-saopaulo-1.aaaaaaaa2ezw57uocis6s2eioypdsnt2p4pwm4fwnjz5jdaqigrm6jaqexeq` (sbn-lb-1)
|
||||
- [ ] Criar pipelines para todos os MFEs
|
||||
### Conectividade (Pendente)
|
||||
- [ ] Attach vcn-oke dev ao DRG-Invista-Shared
|
||||
- [ ] Route tables entre VCN-Shared e vcn-oke dev
|
||||
- [ ] Security lists para trafego cross-VCN
|
||||
|
||||
### Pipeline mfe-user
|
||||
- [ ] Testar pipeline existente
|
||||
- [ ] Corrigir rotas para SPA (Angular)
|
||||
- [ ] Adicionar suporte a múltiplos ambientes (dev/hml/prod)
|
||||
- [ ] Tratar fallback para index.html
|
||||
### Load Balancer (Pendente)
|
||||
- [ ] Backend set no LB Test_Crivo_Dev -> 10.110.198.250:443
|
||||
- [ ] Routing rule para hostname mfe-user-dev.invista.com.br
|
||||
- [ ] Health check configurado
|
||||
|
||||
### Novos MFEs (criar pipelines)
|
||||
- [ ] mfe-shell → OCI
|
||||
- [ ] mfe-auth → OCI
|
||||
- [ ] mfe-person → OCI
|
||||
- [ ] mfe-poc → OCI
|
||||
- [ ] mfe-formalization → OCI + AWS (primeira pipeline)
|
||||
### DNS (Pendente)
|
||||
- [ ] Cloudflare: registro mfe-user-dev.invista.com.br
|
||||
|
||||
### MFEs adicionais (Futuro)
|
||||
- [ ] mfe-shell - adicionar ao mfe_deployments no Terraform
|
||||
- [ ] mfe-auth - adicionar ao mfe_deployments no Terraform
|
||||
- [ ] mfe-person - adicionar ao mfe_deployments no Terraform
|
||||
- [ ] mfe-poc - adicionar ao mfe_deployments no Terraform
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -256,9 +216,10 @@ oci api-gateway deployment get --deployment-id <id>
|
|||
|
||||
---
|
||||
|
||||
## Referências
|
||||
## Referencias
|
||||
|
||||
- [Terraform OCI Clusters](../tf_oci_clusters/README.md)
|
||||
- [OCI - Visão Geral](./OCI.md)
|
||||
- [Terraform - Importação](./OCI-TERRAFORM.md)
|
||||
- [API Gateway](./OCI-API-GATEWAY.md)
|
||||
- [API Gateways](./API-GATEWAY.md) - Todos os gateways (incluindo api-gateway-mfe-dev)
|
||||
- [Load Balancers](./LOAD-BALANCERS.md) - LBs e routing
|
||||
- [Terraform Importacao](./OCI-TERRAFORM.md) - Import de recursos
|
||||
- [API Gateway Config](./OCI-API-GATEWAY.md) - Setup manual
|
||||
- [Cloudflare](./CLOUDFLARE.md) - DNS
|
||||
|
|
|
|||
|
|
@ -45,6 +45,15 @@ nexus/
|
|||
- [OCI Connection](./azure-devops/OCI-CONNECTION.md)
|
||||
- [MS-USER - Microservico de Usuarios](./MS-USER.md)
|
||||
|
||||
### Infraestrutura OCI
|
||||
|
||||
- [API Gateways](./API-GATEWAY.md) - Todos os gateways OCI (nexus, insign, MFE)
|
||||
- [Load Balancers](./LOAD-BALANCERS.md) - LBs OCI e routing
|
||||
- [MFE Tasks](./OCI-MFE-TASKS.md) - Status e checklist do setup MFE
|
||||
- [API Gateway Config](./OCI-API-GATEWAY.md) - Configuracao detalhada API GW
|
||||
- [Terraform Import](./OCI-TERRAFORM.md) - Importacao de recursos
|
||||
- [Cloudflare](./CLOUDFLARE.md) - DNS e proxy
|
||||
|
||||
---
|
||||
|
||||
*Projeto InventCloud - Invista FIDC*
|
||||
|
|
|
|||
Loading…
Reference in a new issue