Italiano

Menu della documentazione

Menu della documentazione

Menu della documentazione

Menu della documentazione

Configuring application provider and API gateway environments

Table of Contents

Table of Contents

Table of Contents

Table of Contents

This guide provides the necessary steps to configure application and gateway environments for a tenant. The configuration ensures proper environment hierarchy and association with the corresponding gateway settings.

Prerequisites

  • Access to the database for executing SQL scripts.

  • Permission to update the configuration map (CONFIGMAP).

  • Access to env.json for modifying frontend settings.

Operational Steps

Step 1: Define the Application Provider and API Gateway Environments

List all environments sequentially from lowest (e.g., DEV) to highest (e.g., PROD). If the application and gateway environments differ, specify both lists. Optionally, include alternative aliases used for these environments.

Example environment list:

DEV, TEST, PROD

Step 1: Database Configuration - Configure Application Provider Environments

To configure the Application Provider Environments, execute the following SQL statements:

-- Insert Environments
INSERT INTO as_environment (environmentid, "name", is_lowest_env, is_prod, entity) VALUES
    ('6855dcfe-49a2-4db2-8127-2ae4f4d76865', 'DEV', true, false, 'APP'),
    ('85b91cd8-1f10-4d7f-8954-909c2f4ba6f1', 'TEST', false, false, 'APP'),
    ('55ec8100-c3f1-4bf7-9352-c47b4317468f', 'PROD', false, true, 'APP')
ON CONFLICT (environmentid) DO UPDATE
SET "name" = EXCLUDED."name",
	is_lowest_env = EXCLUDED.is_lowest_env,
	is_prod = EXCLUDED.is_prod,
	entity = EXCLUDED.entity;

Step 2: Database Configuration - Configure API Gateway Environments

To configure the API Gateways Environments, execute the following SQL statements:

-- Insert Environments
INSERT INTO as_environment (environmentid, "name", is_lowest_env, is_prod, entity) VALUES
     ('9c64453b-2028-40dd-aec2-db12583614ae', 'DEV', true, false, 'API'),
    ('25bd7aed-f4a0-4f4d-a0b3-0a6570eb73c9', 'TEST', false, false, 'API'),
    ('2d68ccc1-792e-46b1-8c91-a8f8a3312651', 'PROD', false, true, 'API')
ON CONFLICT (environmentid) DO UPDATE
SET "name" = EXCLUDED."name",
	is_lowest_env = EXCLUDED.is_lowest_env,
	is_prod = EXCLUDED.is_prod,
	entity = EXCLUDED.entity;
-- Set the hierarchy for the API environments (e.g., DEV TEST PROD)	
INSERT INTO as_hierarchy_environment ("source", destination, entity)
VALUES
    ('9c64453b-2028-40dd-aec2-db12583614ae', '25bd7aed-f4a0-4f4d-a0b3-0a6570eb73c9', 'API'),
    ('25bd7aed-f4a0-4f4d-a0b3-0a6570eb73c9', '2d68ccc1-792e-46b1-8c91-a8f8a3312651', 'API')
ON CONFLICT ("source",destination) DO UPDATE
SET "source" = EXCLUDED."source",
	destination = EXCLUDED.destination,
	entity = EXCLUDED.entity;	
-- Set Roles Permissions - Available Operations :["publication","subscription","republication"]	
INSERT INTO as_role_environment (roleid, environmentid, operation)
VALUES
    ('<roleId>', '25bd7aed-f4a0-4f4d-a0b3-0a6570eb73c9', 'publication'),
    ('<roleId>', '2d68ccc1-792e-46b1-8c91-a8f8a3312651', 'subscription'),
    ('<roleId>', '9c64453b-2028-40dd-aec2-db12583614ae', 'republication')
ON CONFLICT (roleid,environmentid,operation) DO UPDATE
SET roleid = EXCLUDED.roleid,
	environmentid = EXCLUDED.environmentid,
	operation = EXCLUDED.operation;

Step 3: Update the Tenant-Config Configuration Map

In Kubernetes, you will need to update the tenant configuration to reflect the API Gateway environments. This can be done by modifying the tenant-config to include the environments in the following way:

  1. Update the TENANT_ENVIRONMENTS variable

Step 4: Adjust Frontend Display Order (Optional)

To control the display order of API Gateway environments in the frontend, you may need to modify the environment-conf-cm.yaml configuration.

If you want to reverse the display order (e.g., display PROD first, then TEST, then DEV), you can update the descEnvironmentsOrder property in the configuration file.

Verifications

  1. Check the database to ensure correct insertion of environment data.

  2. Validate the configuration map updates.

  3. Confirm that the frontend displays the environments in the expected order.