From c949cf645c005442a858a7780051dcb96a7259c1 Mon Sep 17 00:00:00 2001 From: Put Cheung Date: Thu, 21 Nov 2024 15:36:14 +0000 Subject: [PATCH] New lookup for RDS DatabaseInstance --- lib/cloud-assembly/context-queries.ts | 16 +++++++++++ schema/cloud-assembly.schema.json | 40 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/lib/cloud-assembly/context-queries.ts b/lib/cloud-assembly/context-queries.ts index 49541a1..33b5dac 100644 --- a/lib/cloud-assembly/context-queries.ts +++ b/lib/cloud-assembly/context-queries.ts @@ -54,6 +54,11 @@ export enum ContextProvider { */ KEY_PROVIDER = 'key-provider', + /** + * RDS DatabaseInstance Provider + */ + RDS_DATABASE_INSTANCE_PROVIDER = 'rds-database-instance-provider', + /** * A plugin provider (the actual plugin name will be in the properties) */ @@ -347,6 +352,16 @@ export interface KeyContextQuery extends ContextLookupRoleOptions { readonly aliasName: string; } +/** + * Query input for looking up a RDS DatabaseInstance + */ +export interface DatabaseInstanceContextQuery extends ContextLookupRoleOptions { + /** + * Instance identifier used to search the DatabaseInstance + */ + readonly instanceIdentifier: string; +} + /** * Query input for plugins * @@ -380,4 +395,5 @@ export type ContextQueryProperties = | LoadBalancerListenerContextQuery | SecurityGroupContextQuery | KeyContextQuery + | DatabaseInstanceContextQuery | PluginContextQuery; diff --git a/schema/cloud-assembly.schema.json b/schema/cloud-assembly.schema.json index 1fbafd9..4ec2aff 100644 --- a/schema/cloud-assembly.schema.json +++ b/schema/cloud-assembly.schema.json @@ -525,6 +525,7 @@ "load-balancer-listener", "security-group", "key-provider", + "rds-database-instance-provider", "plugin" ] }, @@ -560,6 +561,9 @@ { "$ref": "#/definitions/KeyContextQuery" }, + { + "$ref": "#/definitions/DatabaseInstanceContextQuery" + }, { "$ref": "#/definitions/PluginContextQuery" } @@ -1015,6 +1019,42 @@ "region" ] }, + "DatabaseInstanceContextQuery": { + "description": "Query input for looking up a RDS DatabaseInstance", + "type": "object", + "properties": { + "instanceIdentifier": { + "description": "Instance identifier used to search the DatabaseInstance", + "type": "string" + }, + "account": { + "description": "Query account", + "type": "string" + }, + "region": { + "description": "Query region", + "type": "string" + }, + "lookupRoleArn": { + "description": "The ARN of the role that should be used to look up the missing values (Default - None)", + "type": "string" + }, + "lookupRoleExternalId": { + "description": "The ExternalId that needs to be supplied while assuming this role (Default - No ExternalId will be supplied)", + "type": "string" + }, + "assumeRoleAdditionalOptions": { + "description": "Additional options to pass to STS when assuming the lookup role.\n\n- `RoleArn` should not be used. Use the dedicated `lookupRoleArn` property instead.\n- `ExternalId` should not be used. Use the dedicated `lookupRoleExternalId` instead. (Default - No additional options.)", + "type": "object", + "additionalProperties": {} + } + }, + "required": [ + "account", + "instanceIdentifier", + "region" + ] + }, "PluginContextQuery": { "description": "Query input for plugins\n\nThis alternate branch is necessary because it needs to be able to escape all type checking\nwe do on on the cloud assembly -- we cannot know the properties that will be used a priori.", "type": "object",