@gradientedge/cdk-utils 10.1.0 → 10.2.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/lib/azure/common/constants.d.ts +3 -2
- package/dist/src/lib/azure/common/constants.js +2 -1
- package/dist/src/lib/azure/common/construct.d.ts +26 -12
- package/dist/src/lib/azure/common/construct.js +31 -45
- package/dist/src/lib/azure/common/resource-name-formatter.d.ts +9 -4
- package/dist/src/lib/azure/common/resource-name-formatter.js +9 -5
- package/dist/src/lib/azure/common/stack.d.ts +18 -32
- package/dist/src/lib/azure/common/stack.js +77 -74
- package/dist/src/lib/azure/common/tagging.d.ts +29 -8
- package/dist/src/lib/azure/common/tagging.js +72 -26
- package/dist/src/lib/azure/common/types.d.ts +19 -4
- package/dist/src/lib/azure/services/api-management/main.d.ts +29 -32
- package/dist/src/lib/azure/services/api-management/main.js +100 -121
- package/dist/src/lib/azure/services/api-management/types.d.ts +33 -18
- package/dist/src/lib/azure/services/app-configuration/main.d.ts +6 -7
- package/dist/src/lib/azure/services/app-configuration/main.js +23 -26
- package/dist/src/lib/azure/services/app-configuration/types.d.ts +2 -2
- package/dist/src/lib/azure/services/app-service/main.d.ts +10 -12
- package/dist/src/lib/azure/services/app-service/main.js +37 -49
- package/dist/src/lib/azure/services/app-service/types.d.ts +4 -4
- package/dist/src/lib/azure/services/application-insights/main.d.ts +7 -8
- package/dist/src/lib/azure/services/application-insights/main.js +20 -26
- package/dist/src/lib/azure/services/application-insights/types.d.ts +2 -4
- package/dist/src/lib/azure/services/cosmosdb/main.d.ts +12 -15
- package/dist/src/lib/azure/services/cosmosdb/main.js +42 -61
- package/dist/src/lib/azure/services/cosmosdb/types.d.ts +4 -6
- package/dist/src/lib/azure/services/dns/main.d.ts +13 -17
- package/dist/src/lib/azure/services/dns/main.js +33 -51
- package/dist/src/lib/azure/services/dns/types.d.ts +5 -8
- package/dist/src/lib/azure/services/eventgrid/main.d.ts +20 -22
- package/dist/src/lib/azure/services/eventgrid/main.js +61 -89
- package/dist/src/lib/azure/services/eventgrid/types.d.ts +7 -8
- package/dist/src/lib/azure/services/function/main.d.ts +15 -15
- package/dist/src/lib/azure/services/function/main.js +54 -59
- package/dist/src/lib/azure/services/function/types.d.ts +18 -6
- package/dist/src/lib/azure/services/index.d.ts +1 -1
- package/dist/src/lib/azure/services/index.js +1 -1
- package/dist/src/lib/azure/services/key-vault/main.d.ts +6 -7
- package/dist/src/lib/azure/services/key-vault/main.js +29 -28
- package/dist/src/lib/azure/services/key-vault/types.d.ts +3 -2
- package/dist/src/lib/azure/services/monitor/main.d.ts +7 -8
- package/dist/src/lib/azure/services/monitor/main.js +10 -15
- package/dist/src/lib/azure/services/monitor/types.d.ts +2 -2
- package/dist/src/lib/azure/services/operational-insights/main.d.ts +29 -0
- package/dist/src/lib/azure/services/operational-insights/main.js +50 -0
- package/dist/src/lib/azure/services/operational-insights/types.d.ts +3 -0
- package/dist/src/lib/azure/services/redis/main.d.ts +8 -9
- package/dist/src/lib/azure/services/redis/main.js +24 -26
- package/dist/src/lib/azure/services/redis/types.d.ts +2 -2
- package/dist/src/lib/azure/services/resource-group/main.d.ts +6 -7
- package/dist/src/lib/azure/services/resource-group/main.js +9 -14
- package/dist/src/lib/azure/services/resource-group/types.d.ts +2 -2
- package/dist/src/lib/azure/services/servicebus/main.d.ts +17 -22
- package/dist/src/lib/azure/services/servicebus/main.js +47 -70
- package/dist/src/lib/azure/services/servicebus/types.d.ts +6 -10
- package/dist/src/lib/azure/services/storage/main.d.ts +24 -27
- package/dist/src/lib/azure/services/storage/main.js +70 -88
- package/dist/src/lib/azure/services/storage/types.d.ts +10 -8
- package/dist/src/lib/azure/types/index.d.ts +2 -1
- package/dist/src/lib/azure/utils/index.d.ts +19 -3
- package/dist/src/lib/azure/utils/index.js +19 -13
- package/dist/src/lib/cloudflare/common/stack.js +1 -1
- package/package.json +2 -1
- package/src/lib/azure/common/constants.ts +2 -1
- package/src/lib/azure/common/construct.ts +32 -48
- package/src/lib/azure/common/resource-name-formatter.ts +10 -6
- package/src/lib/azure/common/stack.ts +78 -78
- package/src/lib/azure/common/tagging.ts +78 -29
- package/src/lib/azure/common/types.ts +21 -4
- package/src/lib/azure/services/api-management/main.ts +172 -169
- package/src/lib/azure/services/api-management/types.ts +39 -16
- package/src/lib/azure/services/app-configuration/main.ts +33 -31
- package/src/lib/azure/services/app-configuration/types.ts +2 -2
- package/src/lib/azure/services/app-service/main.ts +61 -62
- package/src/lib/azure/services/app-service/types.ts +4 -4
- package/src/lib/azure/services/application-insights/main.ts +29 -30
- package/src/lib/azure/services/application-insights/types.ts +2 -5
- package/src/lib/azure/services/cosmosdb/main.ts +78 -77
- package/src/lib/azure/services/cosmosdb/types.ts +10 -6
- package/src/lib/azure/services/dns/main.ts +65 -72
- package/src/lib/azure/services/dns/types.ts +9 -9
- package/src/lib/azure/services/eventgrid/main.ts +120 -122
- package/src/lib/azure/services/eventgrid/types.ts +13 -8
- package/src/lib/azure/services/function/main.ts +75 -72
- package/src/lib/azure/services/function/types.ts +21 -6
- package/src/lib/azure/services/index.ts +1 -1
- package/src/lib/azure/services/key-vault/main.ts +38 -32
- package/src/lib/azure/services/key-vault/types.ts +4 -2
- package/src/lib/azure/services/monitor/main.ts +17 -21
- package/src/lib/azure/services/monitor/types.ts +2 -2
- package/src/lib/azure/services/operational-insights/main.ts +61 -0
- package/src/lib/azure/services/operational-insights/types.ts +3 -0
- package/src/lib/azure/services/redis/main.ts +30 -30
- package/src/lib/azure/services/redis/types.ts +2 -2
- package/src/lib/azure/services/resource-group/main.ts +20 -20
- package/src/lib/azure/services/resource-group/types.ts +2 -2
- package/src/lib/azure/services/servicebus/main.ts +103 -94
- package/src/lib/azure/services/servicebus/types.ts +17 -11
- package/src/lib/azure/services/storage/main.ts +113 -114
- package/src/lib/azure/services/storage/types.ts +16 -8
- package/src/lib/azure/types/index.ts +2 -1
- package/src/lib/azure/utils/index.ts +20 -22
- package/src/lib/cloudflare/common/stack.ts +1 -1
- package/dist/src/lib/azure/services/log-analytics-workspace/main.d.ts +0 -30
- package/dist/src/lib/azure/services/log-analytics-workspace/main.js +0 -55
- package/dist/src/lib/azure/services/log-analytics-workspace/types.d.ts +0 -3
- package/src/lib/azure/services/log-analytics-workspace/main.ts +0 -61
- package/src/lib/azure/services/log-analytics-workspace/types.ts +0 -3
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.d.ts +0 -0
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.js +0 -0
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/types.js +0 -0
- /package/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.ts +0 -0
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DataAzurermStorageAccountBlobContainerSas } from '@cdktf/provider-azurerm/lib/data-azurerm-storage-account-blob-container-sas/index.js'
|
|
3
|
-
import { DataAzurermStorageAccount } from '@cdktf/provider-azurerm/lib/data-azurerm-storage-account/index.js'
|
|
4
|
-
import { DataAzurermStorageContainer } from '@cdktf/provider-azurerm/lib/data-azurerm-storage-container/index.js'
|
|
5
|
-
import { StorageAccount } from '@cdktf/provider-azurerm/lib/storage-account/index.js'
|
|
6
|
-
import { StorageBlob } from '@cdktf/provider-azurerm/lib/storage-blob/index.js'
|
|
7
|
-
import { StorageContainer } from '@cdktf/provider-azurerm/lib/storage-container/index.js'
|
|
8
|
-
import { CommonAzureConstruct } from '../../common/index.js'
|
|
9
|
-
import { createAzureTfOutput } from '../../utils/index.js'
|
|
1
|
+
import * as azure from '@pulumi/azure'
|
|
10
2
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
Blob,
|
|
4
|
+
BlobContainer,
|
|
5
|
+
HttpProtocol,
|
|
6
|
+
Kind,
|
|
7
|
+
listStorageAccountSAS,
|
|
8
|
+
Permissions,
|
|
9
|
+
Services,
|
|
10
|
+
SignedResourceTypes,
|
|
11
|
+
SkuName,
|
|
12
|
+
StorageAccount,
|
|
13
|
+
} from '@pulumi/azure-native/storage/index.js'
|
|
14
|
+
import * as pulumi from '@pulumi/pulumi'
|
|
15
|
+
import { CommonAzureConstruct } from '../../common/index.js'
|
|
16
|
+
import { ContainerSasTokenProps, StorageAccountProps, StorageBlobProps, StorageContainerProps } from './types.js'
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
|
-
* @classdesc Provides operations on Azure Storage
|
|
19
|
+
* @classdesc Provides operations on Azure Storage using Pulumi
|
|
19
20
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
20
21
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
21
22
|
* @example
|
|
22
|
-
* ```
|
|
23
|
+
* ```typescript
|
|
23
24
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
24
25
|
*
|
|
25
26
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
26
|
-
* constructor(
|
|
27
|
-
* super(
|
|
27
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
28
|
+
* super(name, props)
|
|
28
29
|
* this.props = props
|
|
29
30
|
* this.storageManager.createStorageAccount('MyAccount', this, props)
|
|
30
31
|
* }
|
|
@@ -37,60 +38,64 @@ export class AzureStorageManager {
|
|
|
37
38
|
* @param id scoped id of the resource
|
|
38
39
|
* @param scope scope in which this resource is defined
|
|
39
40
|
* @param props storage account properties
|
|
40
|
-
* @see [
|
|
41
|
+
* @see [Pulumi Azure Native Storage Account]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/storageaccount/}
|
|
41
42
|
*/
|
|
42
43
|
public createStorageAccount(id: string, scope: CommonAzureConstruct, props: StorageAccountProps) {
|
|
43
44
|
if (!props) throw `Props undefined for ${id}`
|
|
44
45
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
47
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
48
|
+
: `${props.resourceGroupName}`
|
|
49
|
+
|
|
50
|
+
return new StorageAccount(
|
|
51
|
+
`${id}-sa`,
|
|
52
|
+
{
|
|
53
|
+
...props,
|
|
54
|
+
accountName: scope.resourceNameFormatter
|
|
55
|
+
.format(props.accountName?.toString(), scope.props.resourceNameOptions?.storageAccount)
|
|
56
|
+
.replace(/\W/g, '')
|
|
57
|
+
.toLowerCase(),
|
|
58
|
+
resourceGroupName,
|
|
59
|
+
sku: props.sku ?? {
|
|
60
|
+
name: SkuName.Standard_LRS,
|
|
61
|
+
},
|
|
62
|
+
kind: props.kind ?? Kind.StorageV2,
|
|
63
|
+
location: props.location ?? scope.props.location,
|
|
64
|
+
tags: props.tags ?? {
|
|
65
|
+
environment: scope.props.stage,
|
|
66
|
+
},
|
|
64
67
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
createAzureTfOutput(`${id}-storageAccountName`, scope, storageAccount.name)
|
|
68
|
-
createAzureTfOutput(`${id}-storageAccountFriendlyUniqueId`, scope, storageAccount.friendlyUniqueId)
|
|
69
|
-
createAzureTfOutput(`${id}-storageAccountId`, scope, storageAccount.id)
|
|
70
|
-
|
|
71
|
-
return storageAccount
|
|
68
|
+
{ parent: scope }
|
|
69
|
+
)
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
/**
|
|
75
|
-
* @summary Method to create a new storage container
|
|
73
|
+
* @summary Method to create a new storage container (blob container)
|
|
76
74
|
* @param id scoped id of the resource
|
|
77
75
|
* @param scope scope in which this resource is defined
|
|
78
76
|
* @param props storage container properties
|
|
79
|
-
* @see [
|
|
77
|
+
* @see [Pulumi Azure Native Blob Container]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/blobcontainer/}
|
|
80
78
|
*/
|
|
81
79
|
public createStorageContainer(id: string, scope: CommonAzureConstruct, props: StorageContainerProps) {
|
|
82
80
|
if (!props) throw `Props undefined for ${id}`
|
|
83
81
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
83
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
84
|
+
: `${props.resourceGroupName}`
|
|
85
|
+
|
|
86
|
+
return new BlobContainer(
|
|
87
|
+
`${id}-sc`,
|
|
88
|
+
{
|
|
89
|
+
...props,
|
|
90
|
+
containerName: scope.resourceNameFormatter.format(
|
|
91
|
+
props.containerName?.toString(),
|
|
92
|
+
scope.props.resourceNameOptions?.storageContainer
|
|
93
|
+
),
|
|
94
|
+
accountName: props.accountName,
|
|
95
|
+
resourceGroupName,
|
|
96
|
+
},
|
|
97
|
+
{ parent: scope }
|
|
98
|
+
)
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
/**
|
|
@@ -98,12 +103,12 @@ export class AzureStorageManager {
|
|
|
98
103
|
* @param id scoped id of the resource
|
|
99
104
|
* @param scope scope in which this resource is defined
|
|
100
105
|
* @param props storage blob properties
|
|
101
|
-
* @see [
|
|
106
|
+
* @see [Pulumi Azure Native Blob]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/blob/}
|
|
102
107
|
*/
|
|
103
108
|
public createStorageBlob(id: string, scope: CommonAzureConstruct, props: StorageBlobProps) {
|
|
104
109
|
if (!props) throw `Props undefined for ${id}`
|
|
105
110
|
|
|
106
|
-
const resourceGroup =
|
|
111
|
+
const resourceGroup = azure.core.getResourceGroupOutput({
|
|
107
112
|
name: scope.props.resourceGroupName
|
|
108
113
|
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
109
114
|
: `${props.resourceGroupName}`,
|
|
@@ -111,76 +116,70 @@ export class AzureStorageManager {
|
|
|
111
116
|
|
|
112
117
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
113
118
|
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
createAzureTfOutput(`${id}-storageBlobName`, scope, storageBlob.name)
|
|
133
|
-
createAzureTfOutput(`${id}-storageBlobFriendlyUniqueId`, scope, storageBlob.friendlyUniqueId)
|
|
134
|
-
createAzureTfOutput(`${id}-storageBlobId`, scope, storageBlob.id)
|
|
135
|
-
|
|
136
|
-
return storageBlob
|
|
119
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
120
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
121
|
+
: `${props.resourceGroupName}`
|
|
122
|
+
|
|
123
|
+
return new Blob(
|
|
124
|
+
`${id}-sb`,
|
|
125
|
+
{
|
|
126
|
+
...props,
|
|
127
|
+
blobName: scope.resourceNameFormatter.format(
|
|
128
|
+
props.blobName?.toString(),
|
|
129
|
+
scope.props.resourceNameOptions?.storageBlob
|
|
130
|
+
),
|
|
131
|
+
accountName: props.accountName,
|
|
132
|
+
containerName: `${props.containerName}-${scope.props.stage}`,
|
|
133
|
+
resourceGroupName,
|
|
134
|
+
},
|
|
135
|
+
{ parent: scope }
|
|
136
|
+
)
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* @summary Generates a container-level SAS token for an existing Azure Storage container.
|
|
141
141
|
*
|
|
142
142
|
* @description
|
|
143
|
-
* This method
|
|
144
|
-
*
|
|
143
|
+
* This method generates a Shared Access Signature (SAS) token for secure container access.
|
|
144
|
+
* The token is generated using Pulumi's listStorageAccountSAS function.
|
|
145
145
|
*
|
|
146
146
|
* @param id - Unique scoped identifier for the SAS token resource
|
|
147
|
-
* @param scope -
|
|
147
|
+
* @param scope - Pulumi construct scope
|
|
148
148
|
* @param props - SAS options:
|
|
149
|
-
* - start: Optional start date in the format 'YYYY-MM-DD'.
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @param
|
|
153
|
-
* @param storageContainer
|
|
149
|
+
* - start: Optional start date in the format 'YYYY-MM-DD'. Defaults to today's date.
|
|
150
|
+
* - expiry: Optional expiry date in the format 'YYYY-MM-DD'. Defaults to 7 days from current date.
|
|
151
|
+
* @param storageAccount - The storage account resource
|
|
152
|
+
* @param storageContainer - Optional blob container resource
|
|
154
153
|
*
|
|
155
|
-
* @returns A
|
|
154
|
+
* @returns A Pulumi Output containing the SAS token
|
|
156
155
|
*
|
|
157
|
-
* @see https://
|
|
156
|
+
* @see https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/liststorageaccountsas/
|
|
158
157
|
*/
|
|
159
158
|
public generateContainerSasToken(
|
|
160
159
|
id: string,
|
|
161
160
|
scope: CommonAzureConstruct,
|
|
162
|
-
props:
|
|
163
|
-
storageAccount: StorageAccount
|
|
164
|
-
storageContainer?: StorageContainer
|
|
161
|
+
props: ContainerSasTokenProps,
|
|
162
|
+
storageAccount: StorageAccount
|
|
165
163
|
) {
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
164
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
165
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
166
|
+
: `${props.resourceGroupName}`
|
|
167
|
+
|
|
168
|
+
return pulumi
|
|
169
|
+
.all([storageAccount.name])
|
|
170
|
+
.apply(([accountName]) => {
|
|
171
|
+
return listStorageAccountSAS({
|
|
172
|
+
accountName,
|
|
173
|
+
resourceGroupName,
|
|
174
|
+
protocols: props.httpsOnly === false ? HttpProtocol.Https_http : HttpProtocol.Https,
|
|
175
|
+
sharedAccessStartTime: props.start ?? new Date().toISOString().split('T')[0],
|
|
176
|
+
sharedAccessExpiryTime:
|
|
177
|
+
props.expiry ?? new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
|
|
178
|
+
permissions: props.permissions ?? Permissions.R,
|
|
179
|
+
services: Services.B,
|
|
180
|
+
resourceTypes: SignedResourceTypes.C,
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
.apply(result => result.accountSasToken)
|
|
185
184
|
}
|
|
186
185
|
}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
BlobArgs,
|
|
3
|
+
BlobContainerArgs,
|
|
4
|
+
ListStorageAccountSASArgs,
|
|
5
|
+
StorageAccountArgs,
|
|
6
|
+
} from '@pulumi/azure-native/storage/index.js'
|
|
5
7
|
import { BaseAzureConfigProps } from '../../types/index.js'
|
|
6
8
|
|
|
7
|
-
export interface StorageAccountProps extends
|
|
9
|
+
export interface StorageAccountProps extends StorageAccountArgs {}
|
|
8
10
|
|
|
9
|
-
export interface StorageContainerProps extends BaseAzureConfigProps,
|
|
11
|
+
export interface StorageContainerProps extends BaseAzureConfigProps, BlobContainerArgs {}
|
|
10
12
|
|
|
11
|
-
export interface StorageBlobProps extends BaseAzureConfigProps,
|
|
13
|
+
export interface StorageBlobProps extends BaseAzureConfigProps, BlobArgs {}
|
|
12
14
|
|
|
13
|
-
export interface
|
|
15
|
+
export interface ContainerSasTokenProps extends ListStorageAccountSASArgs {
|
|
16
|
+
resourceGroupName: string
|
|
17
|
+
containerName?: string
|
|
18
|
+
httpsOnly?: boolean
|
|
19
|
+
start?: string
|
|
20
|
+
expiry?: string
|
|
21
|
+
}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Azure utility functions for Pulumi
|
|
3
|
+
*
|
|
4
|
+
* Note: Pulumi automatically exposes resource properties as outputs.
|
|
5
|
+
* Unlike CDKTF, explicit output creation is not required.
|
|
6
|
+
* Resource properties are already pulumi.Output<T> types and can be
|
|
7
|
+
* exported directly or used with .apply() for transformations.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // In CDKTF (old):
|
|
12
|
+
* createAzureTfOutput('resourceGroupName', scope, resourceGroup.name)
|
|
13
|
+
*
|
|
14
|
+
* // In Pulumi (new):
|
|
15
|
+
* // No explicit output creation needed - resourceGroup.name is already an output
|
|
16
|
+
* export const resourceGroupName = resourceGroup.name
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
4
19
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
scope: CommonAzureConstruct,
|
|
8
|
-
value?: string,
|
|
9
|
-
description?: string,
|
|
10
|
-
sensitive?: boolean,
|
|
11
|
-
overrideId = true
|
|
12
|
-
) => {
|
|
13
|
-
const output = new TerraformOutput(scope, id, {
|
|
14
|
-
description,
|
|
15
|
-
sensitive,
|
|
16
|
-
value,
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
if (overrideId) {
|
|
20
|
-
output.overrideLogicalId(_.camelCase(id))
|
|
21
|
-
}
|
|
22
|
-
return output
|
|
23
|
-
}
|
|
20
|
+
// Utility functions can be added here as needed for Pulumi Azure operations
|
|
21
|
+
export {}
|
|
@@ -99,7 +99,7 @@ export class CommonCloudflareStack extends ComponentResource {
|
|
|
99
99
|
* - Primary use is to have layered config for each environment which is injected into the context
|
|
100
100
|
*/
|
|
101
101
|
protected determineStageContexts(props: CommonCloudflareStackProps) {
|
|
102
|
-
const stageContextFilePath = path.join(appRoot.path, props.stageContextPath ?? '
|
|
102
|
+
const stageContextFilePath = path.join(appRoot.path, props.stageContextPath ?? 'env', `${props.stage}.json`)
|
|
103
103
|
|
|
104
104
|
if (isDevStage(props.stage)) {
|
|
105
105
|
if (props.debug) console.debug(`Development stage. Using default stage context properties`)
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { LogAnalyticsWorkspace } from '@cdktf/provider-azurerm/lib/log-analytics-workspace/index.js';
|
|
2
|
-
import { CommonAzureConstruct } from '../../common/index.js';
|
|
3
|
-
import { LogAnalyticsWorkspaceProps } from './types.js';
|
|
4
|
-
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Log Analytics Workspace
|
|
6
|
-
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
7
|
-
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
8
|
-
* @example
|
|
9
|
-
* ```
|
|
10
|
-
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
11
|
-
*
|
|
12
|
-
* class CustomConstruct extends CommonAzureConstruct {
|
|
13
|
-
* constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
|
|
14
|
-
* super(parent, id, props)
|
|
15
|
-
* this.props = props
|
|
16
|
-
* this.LogAnalyticWorkspaceManager.createLogAnalyticsWorkspace('MyLogAnalyticsWorkspace', this, props)
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare class AzureLogAnalyticsWorkspaceManager {
|
|
22
|
-
/**
|
|
23
|
-
* @summary Method to create a new cosmosdb account
|
|
24
|
-
* @param id scoped id of the resource
|
|
25
|
-
* @param scope scope in which this resource is defined
|
|
26
|
-
* @param props cosmosdb account properties
|
|
27
|
-
* @see [CDKTF CosmosDb Account Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/logAnalyticsWorkspace.typescript.md}
|
|
28
|
-
*/
|
|
29
|
-
createLogAnalyticsWorkspace(id: string, scope: CommonAzureConstruct, props: LogAnalyticsWorkspaceProps): LogAnalyticsWorkspace;
|
|
30
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
|
|
2
|
-
import { LogAnalyticsWorkspace } from '@cdktf/provider-azurerm/lib/log-analytics-workspace/index.js';
|
|
3
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
4
|
-
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Log Analytics Workspace
|
|
6
|
-
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
7
|
-
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
8
|
-
* @example
|
|
9
|
-
* ```
|
|
10
|
-
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
11
|
-
*
|
|
12
|
-
* class CustomConstruct extends CommonAzureConstruct {
|
|
13
|
-
* constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
|
|
14
|
-
* super(parent, id, props)
|
|
15
|
-
* this.props = props
|
|
16
|
-
* this.LogAnalyticWorkspaceManager.createLogAnalyticsWorkspace('MyLogAnalyticsWorkspace', this, props)
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export class AzureLogAnalyticsWorkspaceManager {
|
|
22
|
-
/**
|
|
23
|
-
* @summary Method to create a new cosmosdb account
|
|
24
|
-
* @param id scoped id of the resource
|
|
25
|
-
* @param scope scope in which this resource is defined
|
|
26
|
-
* @param props cosmosdb account properties
|
|
27
|
-
* @see [CDKTF CosmosDb Account Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/logAnalyticsWorkspace.typescript.md}
|
|
28
|
-
*/
|
|
29
|
-
createLogAnalyticsWorkspace(id, scope, props) {
|
|
30
|
-
if (!props)
|
|
31
|
-
throw `Props undefined for ${id}`;
|
|
32
|
-
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-lw-rg`, {
|
|
33
|
-
name: scope.props.resourceGroupName
|
|
34
|
-
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
35
|
-
: `${props.resourceGroupName}`,
|
|
36
|
-
});
|
|
37
|
-
if (!resourceGroup)
|
|
38
|
-
throw `Resource group undefined for ${id}`;
|
|
39
|
-
const logAnalyticsWorkspace = new LogAnalyticsWorkspace(scope, `${id}-lw`, {
|
|
40
|
-
...props,
|
|
41
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.logAnalyticsWorkspace),
|
|
42
|
-
location: resourceGroup.location,
|
|
43
|
-
resourceGroupName: resourceGroup.name,
|
|
44
|
-
sku: props.sku ?? 'PerGB2018',
|
|
45
|
-
retentionInDays: props.retentionInDays ?? 30,
|
|
46
|
-
tags: props.tags ?? {
|
|
47
|
-
environment: scope.props.stage,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
createAzureTfOutput(`${id}-logAnalyticsWorkspaceName`, scope, logAnalyticsWorkspace.name);
|
|
51
|
-
createAzureTfOutput(`${id}-logAnalyticsWorkspaceFriendlyUniqueId`, scope, logAnalyticsWorkspace.friendlyUniqueId);
|
|
52
|
-
createAzureTfOutput(`${id}-logAnalyticsWorkspaceId`, scope, logAnalyticsWorkspace.id);
|
|
53
|
-
return logAnalyticsWorkspace;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js'
|
|
2
|
-
import { LogAnalyticsWorkspace } from '@cdktf/provider-azurerm/lib/log-analytics-workspace/index.js'
|
|
3
|
-
import { CommonAzureConstruct } from '../../common/index.js'
|
|
4
|
-
import { createAzureTfOutput } from '../../utils/index.js'
|
|
5
|
-
import { LogAnalyticsWorkspaceProps } from './types.js'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @classdesc Provides operations on Azure Log Analytics Workspace
|
|
9
|
-
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
10
|
-
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
11
|
-
* @example
|
|
12
|
-
* ```
|
|
13
|
-
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
14
|
-
*
|
|
15
|
-
* class CustomConstruct extends CommonAzureConstruct {
|
|
16
|
-
* constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
|
|
17
|
-
* super(parent, id, props)
|
|
18
|
-
* this.props = props
|
|
19
|
-
* this.LogAnalyticWorkspaceManager.createLogAnalyticsWorkspace('MyLogAnalyticsWorkspace', this, props)
|
|
20
|
-
* }
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export class AzureLogAnalyticsWorkspaceManager {
|
|
25
|
-
/**
|
|
26
|
-
* @summary Method to create a new cosmosdb account
|
|
27
|
-
* @param id scoped id of the resource
|
|
28
|
-
* @param scope scope in which this resource is defined
|
|
29
|
-
* @param props cosmosdb account properties
|
|
30
|
-
* @see [CDKTF CosmosDb Account Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/logAnalyticsWorkspace.typescript.md}
|
|
31
|
-
*/
|
|
32
|
-
public createLogAnalyticsWorkspace(id: string, scope: CommonAzureConstruct, props: LogAnalyticsWorkspaceProps) {
|
|
33
|
-
if (!props) throw `Props undefined for ${id}`
|
|
34
|
-
|
|
35
|
-
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-lw-rg`, {
|
|
36
|
-
name: scope.props.resourceGroupName
|
|
37
|
-
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
-
: `${props.resourceGroupName}`,
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
42
|
-
|
|
43
|
-
const logAnalyticsWorkspace = new LogAnalyticsWorkspace(scope, `${id}-lw`, {
|
|
44
|
-
...props,
|
|
45
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.logAnalyticsWorkspace),
|
|
46
|
-
location: resourceGroup.location,
|
|
47
|
-
resourceGroupName: resourceGroup.name,
|
|
48
|
-
sku: props.sku ?? 'PerGB2018',
|
|
49
|
-
retentionInDays: props.retentionInDays ?? 30,
|
|
50
|
-
tags: props.tags ?? {
|
|
51
|
-
environment: scope.props.stage,
|
|
52
|
-
},
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
createAzureTfOutput(`${id}-logAnalyticsWorkspaceName`, scope, logAnalyticsWorkspace.name)
|
|
56
|
-
createAzureTfOutput(`${id}-logAnalyticsWorkspaceFriendlyUniqueId`, scope, logAnalyticsWorkspace.friendlyUniqueId)
|
|
57
|
-
createAzureTfOutput(`${id}-logAnalyticsWorkspaceId`, scope, logAnalyticsWorkspace.id)
|
|
58
|
-
|
|
59
|
-
return logAnalyticsWorkspace
|
|
60
|
-
}
|
|
61
|
-
}
|
/package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.d.ts
RENAMED
|
File without changes
|
/package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.js
RENAMED
|
File without changes
|
/package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/types.js
RENAMED
|
File without changes
|
|
File without changes
|