@gradientedge/cdk-utils-azure 2.43.0 → 2.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/common/stack.js
CHANGED
|
@@ -22,7 +22,7 @@ import { registerTagTransformation } from './tagging.js';
|
|
|
22
22
|
*/
|
|
23
23
|
export class CommonAzureStack extends ComponentResource {
|
|
24
24
|
/** Default Node.js runtime version for Azure Function Apps */
|
|
25
|
-
static NODEJS_RUNTIME = '
|
|
25
|
+
static NODEJS_RUNTIME = '24';
|
|
26
26
|
/** The construct instance created by this stack */
|
|
27
27
|
construct;
|
|
28
28
|
/** Stack properties including environment-specific configuration */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { BaseProps } from '@gradientedge/cdk-utils-common';
|
|
1
2
|
import { GetComponentOutputArgs } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
2
3
|
import { GetWorkspaceOutputArgs } from '@pulumi/azure-native/operationalinsights/index.js';
|
|
3
|
-
import {
|
|
4
|
+
import { Input } from '@pulumi/pulumi';
|
|
4
5
|
import { AzureLocation, AzureRemoteBackend } from './constants.js';
|
|
5
6
|
/**
|
|
6
7
|
* Configuration for an Azure location/region
|
|
@@ -21,6 +22,8 @@ export interface AzureLocationConfig {
|
|
|
21
22
|
* @category Interface
|
|
22
23
|
*/
|
|
23
24
|
export interface CommonAzureStackProps extends BaseProps {
|
|
25
|
+
/** Optional runtime versions for node functions */
|
|
26
|
+
runtimeVersion?: Input<string>;
|
|
24
27
|
/** Optional Pulumi stack name for cross-stack references */
|
|
25
28
|
stackName?: string;
|
|
26
29
|
/** Optional Azure resource group name override */
|
|
@@ -48,7 +48,11 @@ export class AzureFunctionManager {
|
|
|
48
48
|
...scope.props.defaultTags,
|
|
49
49
|
...props.tags,
|
|
50
50
|
},
|
|
51
|
-
}, {
|
|
51
|
+
}, {
|
|
52
|
+
parent: scope,
|
|
53
|
+
...resourceOptions,
|
|
54
|
+
ignoreChanges: [...(resourceOptions?.ignoreChanges ?? []), 'tags'],
|
|
55
|
+
});
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* @summary Method to create a new function within a function app
|
|
@@ -92,13 +96,18 @@ export class AzureFunctionManager {
|
|
|
92
96
|
const runtime = {
|
|
93
97
|
...props.runtime,
|
|
94
98
|
name: props.runtime?.name ?? 'node',
|
|
95
|
-
version: props.runtime?.version ?? CommonAzureStack.NODEJS_RUNTIME,
|
|
99
|
+
version: props.runtime?.version ?? scope.props.runtimeVersion ?? CommonAzureStack.NODEJS_RUNTIME,
|
|
96
100
|
};
|
|
97
101
|
const scaleAndConcurrency = {
|
|
98
102
|
...props.scaleAndConcurrency,
|
|
99
103
|
instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ?? 4096,
|
|
100
104
|
maximumInstanceCount: props.scaleAndConcurrency?.maximumInstanceCount ?? 40,
|
|
101
105
|
};
|
|
106
|
+
const tags = {
|
|
107
|
+
environment: scope.props.stage,
|
|
108
|
+
...scope.props.defaultTags,
|
|
109
|
+
...props.tags,
|
|
110
|
+
};
|
|
102
111
|
const functionApp = new WebApp(`${id}-fc`, {
|
|
103
112
|
...props,
|
|
104
113
|
name,
|
|
@@ -121,13 +130,9 @@ export class AzureFunctionManager {
|
|
|
121
130
|
},
|
|
122
131
|
siteConfig: props.siteConfig ?? {
|
|
123
132
|
http20Enabled: true,
|
|
124
|
-
linuxFxVersion: `${props.runtime?.name ?? 'node'}|${props.runtime?.version ?? CommonAzureStack.NODEJS_RUNTIME}`,
|
|
125
|
-
},
|
|
126
|
-
tags: {
|
|
127
|
-
environment: scope.props.stage,
|
|
128
|
-
...scope.props.defaultTags,
|
|
129
|
-
...props.tags,
|
|
133
|
+
linuxFxVersion: `${props.runtime?.name ?? 'node'}|${props.runtime?.version ?? scope.props.runtimeVersion ?? CommonAzureStack.NODEJS_RUNTIME}`,
|
|
130
134
|
},
|
|
135
|
+
tags: tags,
|
|
131
136
|
}, { parent: scope, ...resourceOptions });
|
|
132
137
|
// perform a deployment for the rolling update strategy
|
|
133
138
|
const deploymentId = uuidv5(`${id}-depl`, uuidv5.DNS);
|
|
@@ -145,6 +150,7 @@ export class AzureFunctionManager {
|
|
|
145
150
|
apiVersion: '2024-04-01',
|
|
146
151
|
name,
|
|
147
152
|
location,
|
|
153
|
+
tags,
|
|
148
154
|
properties: {
|
|
149
155
|
functionAppConfig: {
|
|
150
156
|
...props.functionAppConfig,
|
|
@@ -192,7 +198,7 @@ export class AzureFunctionManager {
|
|
|
192
198
|
runtime: {
|
|
193
199
|
...props.runtime,
|
|
194
200
|
name: props.runtime?.name ?? 'node',
|
|
195
|
-
version: props.runtime?.version ?? CommonAzureStack.NODEJS_RUNTIME,
|
|
201
|
+
version: props.runtime?.version ?? scope.props.runtimeVersion ?? CommonAzureStack.NODEJS_RUNTIME,
|
|
196
202
|
},
|
|
197
203
|
scaleAndConcurrency: {
|
|
198
204
|
...props.scaleAndConcurrency,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils-azure",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.45.0",
|
|
4
4
|
"description": "Azure Pulumi utilities for @gradientedge/cdk-utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"lodash": "4.18.1",
|
|
24
24
|
"uuid": "14.0.0",
|
|
25
25
|
"yaml": "2.9.0",
|
|
26
|
-
"@gradientedge/cdk-utils-common": "2.
|
|
26
|
+
"@gradientedge/cdk-utils-common": "2.9.0"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"gradientedge",
|