|
| 1 | +[@cdklabs/generative-ai-cdk-constructs](../README.md) / BaseClass |
| 2 | + |
| 3 | +# Class: BaseClass |
| 4 | + |
| 5 | +## Hierarchy |
| 6 | + |
| 7 | +- `Construct` |
| 8 | + |
| 9 | + ↳ **`BaseClass`** |
| 10 | + |
| 11 | + ↳↳ [`RagAppsyncStepfnOpensearch`](RagAppsyncStepfnOpensearch.md) |
| 12 | + |
| 13 | + ↳↳ [`SummarizationAppsyncStepfn`](SummarizationAppsyncStepfn.md) |
| 14 | + |
| 15 | + ↳↳ [`QaAppsyncOpensearch`](QaAppsyncOpensearch.md) |
| 16 | + |
| 17 | + ↳↳ [`SageMakerEndpointBase`](SageMakerEndpointBase.md) |
| 18 | + |
| 19 | + ↳↳ [`ContentGenerationAppSyncLambda`](ContentGenerationAppSyncLambda.md) |
| 20 | + |
| 21 | +## Table of contents |
| 22 | + |
| 23 | +### Constructors |
| 24 | + |
| 25 | +- [constructor](BaseClass.md#constructor) |
| 26 | + |
| 27 | +### Properties |
| 28 | + |
| 29 | +- [constructUsageMetric](BaseClass.md#constructusagemetric) |
| 30 | +- [enablexray](BaseClass.md#enablexray) |
| 31 | +- [fieldLogLevel](BaseClass.md#fieldloglevel) |
| 32 | +- [lambdaTracing](BaseClass.md#lambdatracing) |
| 33 | +- [node](BaseClass.md#node) |
| 34 | +- [retention](BaseClass.md#retention) |
| 35 | +- [stage](BaseClass.md#stage) |
| 36 | +- [usageMetricMap](BaseClass.md#usagemetricmap) |
| 37 | + |
| 38 | +### Methods |
| 39 | + |
| 40 | +- [addObservabilityToConstruct](BaseClass.md#addobservabilitytoconstruct) |
| 41 | +- [toString](BaseClass.md#tostring) |
| 42 | +- [updateConstructUsageMetricCode](BaseClass.md#updateconstructusagemetriccode) |
| 43 | +- [updateEnvSuffix](BaseClass.md#updateenvsuffix) |
| 44 | +- [isConstruct](BaseClass.md#isconstruct) |
| 45 | + |
| 46 | +## Constructors |
| 47 | + |
| 48 | +### constructor |
| 49 | + |
| 50 | +• **new BaseClass**(`scope`, `id`): [`BaseClass`](BaseClass.md) |
| 51 | + |
| 52 | +#### Parameters |
| 53 | + |
| 54 | +| Name | Type | |
| 55 | +| :------ | :------ | |
| 56 | +| `scope` | `Construct` | |
| 57 | +| `id` | `string` | |
| 58 | + |
| 59 | +#### Returns |
| 60 | + |
| 61 | +[`BaseClass`](BaseClass.md) |
| 62 | + |
| 63 | +#### Overrides |
| 64 | + |
| 65 | +Construct.constructor |
| 66 | + |
| 67 | +## Properties |
| 68 | + |
| 69 | +### constructUsageMetric |
| 70 | + |
| 71 | +• `Readonly` **constructUsageMetric**: ``"uksb-1tupboc45"`` |
| 72 | + |
| 73 | +construct usage metric , added in template description |
| 74 | + |
| 75 | +___ |
| 76 | + |
| 77 | +### enablexray |
| 78 | + |
| 79 | +• **enablexray**: `boolean` = `true` |
| 80 | + |
| 81 | +enable disable xray tracing |
| 82 | + |
| 83 | +**`Default`** |
| 84 | + |
| 85 | +```ts |
| 86 | +- True |
| 87 | +``` |
| 88 | + |
| 89 | +___ |
| 90 | + |
| 91 | +### fieldLogLevel |
| 92 | + |
| 93 | +• **fieldLogLevel**: `FieldLogLevel` = `appsync.FieldLogLevel.ALL` |
| 94 | + |
| 95 | +Default log config for all constructs |
| 96 | + |
| 97 | +___ |
| 98 | + |
| 99 | +### lambdaTracing |
| 100 | + |
| 101 | +• **lambdaTracing**: `Tracing` = `lambda.Tracing.ACTIVE` |
| 102 | + |
| 103 | +enable disable lambda tracing |
| 104 | + |
| 105 | +**`Default`** |
| 106 | + |
| 107 | +```ts |
| 108 | +- Active |
| 109 | +``` |
| 110 | + |
| 111 | +___ |
| 112 | + |
| 113 | +### node |
| 114 | + |
| 115 | +• `Readonly` **node**: `Node` |
| 116 | + |
| 117 | +The tree node. |
| 118 | + |
| 119 | +#### Inherited from |
| 120 | + |
| 121 | +Construct.node |
| 122 | + |
| 123 | +___ |
| 124 | + |
| 125 | +### retention |
| 126 | + |
| 127 | +• **retention**: `RetentionDays` = `logs.RetentionDays.TEN_YEARS` |
| 128 | + |
| 129 | +Default log retention config for all constructs |
| 130 | + |
| 131 | +___ |
| 132 | + |
| 133 | +### stage |
| 134 | + |
| 135 | +• **stage**: `string` |
| 136 | + |
| 137 | +Value will be appended to resources name. |
| 138 | + |
| 139 | +**`Default`** |
| 140 | + |
| 141 | +```ts |
| 142 | +- _dev |
| 143 | +``` |
| 144 | + |
| 145 | +___ |
| 146 | + |
| 147 | +### usageMetricMap |
| 148 | + |
| 149 | +▪ `Static` `Protected` **usageMetricMap**: `Record`\<`string`, `number`\> |
| 150 | + |
| 151 | +Record<string, number> , maps construct name with number of deployments |
| 152 | + |
| 153 | +## Methods |
| 154 | + |
| 155 | +### addObservabilityToConstruct |
| 156 | + |
| 157 | +▸ **addObservabilityToConstruct**(`props`): `void` |
| 158 | + |
| 159 | +#### Parameters |
| 160 | + |
| 161 | +| Name | Type | |
| 162 | +| :------ | :------ | |
| 163 | +| `props` | [`BaseClassProps`](../interfaces/BaseClassProps.md) | |
| 164 | + |
| 165 | +#### Returns |
| 166 | + |
| 167 | +`void` |
| 168 | + |
| 169 | +___ |
| 170 | + |
| 171 | +### toString |
| 172 | + |
| 173 | +▸ **toString**(): `string` |
| 174 | + |
| 175 | +Returns a string representation of this construct. |
| 176 | + |
| 177 | +#### Returns |
| 178 | + |
| 179 | +`string` |
| 180 | + |
| 181 | +#### Inherited from |
| 182 | + |
| 183 | +Construct.toString |
| 184 | + |
| 185 | +___ |
| 186 | + |
| 187 | +### updateConstructUsageMetricCode |
| 188 | + |
| 189 | +▸ **updateConstructUsageMetricCode**(`props`, `scope`, `lambdaFunctions`): `void` |
| 190 | + |
| 191 | +#### Parameters |
| 192 | + |
| 193 | +| Name | Type | |
| 194 | +| :------ | :------ | |
| 195 | +| `props` | [`BaseClassProps`](../interfaces/BaseClassProps.md) | |
| 196 | +| `scope` | `Construct` | |
| 197 | +| `lambdaFunctions` | `DockerImageFunction`[] | |
| 198 | + |
| 199 | +#### Returns |
| 200 | + |
| 201 | +`void` |
| 202 | + |
| 203 | +___ |
| 204 | + |
| 205 | +### updateEnvSuffix |
| 206 | + |
| 207 | +▸ **updateEnvSuffix**(`props`): `void` |
| 208 | + |
| 209 | +#### Parameters |
| 210 | + |
| 211 | +| Name | Type | |
| 212 | +| :------ | :------ | |
| 213 | +| `props` | [`BaseClassProps`](../interfaces/BaseClassProps.md) | |
| 214 | + |
| 215 | +#### Returns |
| 216 | + |
| 217 | +`void` |
| 218 | + |
| 219 | +___ |
| 220 | + |
| 221 | +### isConstruct |
| 222 | + |
| 223 | +▸ **isConstruct**(`x`): x is Construct |
| 224 | + |
| 225 | +Checks if `x` is a construct. |
| 226 | + |
| 227 | +Use this method instead of `instanceof` to properly detect `Construct` |
| 228 | +instances, even when the construct library is symlinked. |
| 229 | + |
| 230 | +Explanation: in JavaScript, multiple copies of the `constructs` library on |
| 231 | +disk are seen as independent, completely different libraries. As a |
| 232 | +consequence, the class `Construct` in each copy of the `constructs` library |
| 233 | +is seen as a different class, and an instance of one class will not test as |
| 234 | +`instanceof` the other class. `npm install` will not create installations |
| 235 | +like this, but users may manually symlink construct libraries together or |
| 236 | +use a monorepo tool: in those cases, multiple copies of the `constructs` |
| 237 | +library can be accidentally installed, and `instanceof` will behave |
| 238 | +unpredictably. It is safest to avoid using `instanceof`, and using |
| 239 | +this type-testing method instead. |
| 240 | + |
| 241 | +#### Parameters |
| 242 | + |
| 243 | +| Name | Type | Description | |
| 244 | +| :------ | :------ | :------ | |
| 245 | +| `x` | `any` | Any object | |
| 246 | + |
| 247 | +#### Returns |
| 248 | + |
| 249 | +x is Construct |
| 250 | + |
| 251 | +true if `x` is an object created from a class which extends `Construct`. |
| 252 | + |
| 253 | +#### Inherited from |
| 254 | + |
| 255 | +Construct.isConstruct |
0 commit comments