Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New lookup for RDS DatabaseInstance #72

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/cloud-assembly/context-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -380,4 +395,5 @@ export type ContextQueryProperties =
| LoadBalancerListenerContextQuery
| SecurityGroupContextQuery
| KeyContextQuery
| DatabaseInstanceContextQuery
| PluginContextQuery;
40 changes: 40 additions & 0 deletions schema/cloud-assembly.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@
"load-balancer-listener",
"security-group",
"key-provider",
"rds-database-instance-provider",
"plugin"
]
},
Expand Down Expand Up @@ -560,6 +561,9 @@
{
"$ref": "#/definitions/KeyContextQuery"
},
{
"$ref": "#/definitions/DatabaseInstanceContextQuery"
},
{
"$ref": "#/definitions/PluginContextQuery"
}
Expand Down Expand Up @@ -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",
Expand Down