@gradientedge/cdk-utils-azure 2.32.0 → 2.33.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as archive from '@pulumi/archive';
|
|
2
2
|
import { ConfigurationStore, GetConfigurationStoreResult } from '@pulumi/azure-native/appconfiguration/index.js';
|
|
3
3
|
import { GetComponentResult } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
4
|
+
import { RoleAssignment } from '@pulumi/azure-native/authorization/index.js';
|
|
4
5
|
import { Vault } from '@pulumi/azure-native/keyvault/index.js';
|
|
5
6
|
import { Dashboard } from '@pulumi/azure-native/portal/index.js';
|
|
6
7
|
import { BlobContainer, StorageAccount } from '@pulumi/azure-native/storage/index.js';
|
|
@@ -44,6 +45,9 @@ export declare class AzureFunctionApp extends CommonAzureConstruct {
|
|
|
44
45
|
dataStorageContainer: BlobContainer;
|
|
45
46
|
applicationInsights: Output<GetComponentResult>;
|
|
46
47
|
functionDashboard: Dashboard;
|
|
48
|
+
storageRoleAssignment: RoleAssignment;
|
|
49
|
+
appConfigRoleAssignment: RoleAssignment;
|
|
50
|
+
eventGridRoleAssignment: RoleAssignment;
|
|
47
51
|
/**
|
|
48
52
|
* @summary Create a new AzureFunctionApp
|
|
49
53
|
* @param id scoped id of the resource
|
|
@@ -48,6 +48,9 @@ export class AzureFunctionApp extends CommonAzureConstruct {
|
|
|
48
48
|
dataStorageContainer;
|
|
49
49
|
applicationInsights;
|
|
50
50
|
functionDashboard;
|
|
51
|
+
storageRoleAssignment;
|
|
52
|
+
appConfigRoleAssignment;
|
|
53
|
+
eventGridRoleAssignment;
|
|
51
54
|
/**
|
|
52
55
|
* @summary Create a new AzureFunctionApp
|
|
53
56
|
* @param id scoped id of the resource
|
|
@@ -340,9 +343,9 @@ export class AzureFunctionApp extends CommonAzureConstruct {
|
|
|
340
343
|
if (this.props.dataStorageAccount) {
|
|
341
344
|
this.authorisationManager.grantRoleAssignmentToStorageAccount(`${this.id}-data`, this, this.dataStorageAccount.id, this.getFunctionAppPrincipalId(), PrincipalType.ServicePrincipal, this.authorisationManager.resolveRoleDefinitionId(this, RoleDefinitionId.STORAGE_BLOB_DATA_CONTRIBUTOR));
|
|
342
345
|
}
|
|
343
|
-
this.authorisationManager.grantRoleAssignmentToStorageAccount(this.id, this, this.appStorageAccount.id, this.getFunctionAppPrincipalId(), PrincipalType.ServicePrincipal, this.authorisationManager.resolveRoleDefinitionId(this, RoleDefinitionId.STORAGE_BLOB_DATA_CONTRIBUTOR));
|
|
346
|
+
this.storageRoleAssignment = this.authorisationManager.grantRoleAssignmentToStorageAccount(this.id, this, this.appStorageAccount.id, this.getFunctionAppPrincipalId(), PrincipalType.ServicePrincipal, this.authorisationManager.resolveRoleDefinitionId(this, RoleDefinitionId.STORAGE_BLOB_DATA_CONTRIBUTOR));
|
|
344
347
|
if (!this.props.useConfigOverride) {
|
|
345
|
-
this.authorisationManager.grantRoleAssignmentToApplicationConfiguration(this.id, this, this.appConfig.id, this.getFunctionAppPrincipalId(), PrincipalType.ServicePrincipal, this.authorisationManager.resolveRoleDefinitionId(this, RoleDefinitionId.APP_CONFIGURATION_DATA_READER));
|
|
348
|
+
this.appConfigRoleAssignment = this.authorisationManager.grantRoleAssignmentToApplicationConfiguration(this.id, this, this.appConfig.id, this.getFunctionAppPrincipalId(), PrincipalType.ServicePrincipal, this.authorisationManager.resolveRoleDefinitionId(this, RoleDefinitionId.APP_CONFIGURATION_DATA_READER));
|
|
346
349
|
}
|
|
347
350
|
if (this.appConfigurationsParsedConfig &&
|
|
348
351
|
AzureAppConfigurationManager.hasCosmosDependencies(this.appConfigurationsParsedConfig)) {
|
|
@@ -356,7 +359,7 @@ export class AzureFunctionApp extends CommonAzureConstruct {
|
|
|
356
359
|
});
|
|
357
360
|
}
|
|
358
361
|
if (AzureAppConfigurationManager.hasEventGridTargets(this.appConfigurationsParsedConfig)) {
|
|
359
|
-
this.authorisationManager.grantRoleAssignmentToEventgridTopic(this.id, this, this.props.existingTopicName, this.props.existingTopicResourceGroupName, this.getFunctionAppPrincipalId(), PrincipalType.ServicePrincipal, this.authorisationManager.resolveRoleDefinitionId(this, RoleDefinitionId.EVENTGRID_DATA_SENDER));
|
|
362
|
+
this.eventGridRoleAssignment = this.authorisationManager.grantRoleAssignmentToEventgridTopic(this.id, this, this.props.existingTopicName, this.props.existingTopicResourceGroupName, this.getFunctionAppPrincipalId(), PrincipalType.ServicePrincipal, this.authorisationManager.resolveRoleDefinitionId(this, RoleDefinitionId.EVENTGRID_DATA_SENDER));
|
|
360
363
|
}
|
|
361
364
|
}
|
|
362
365
|
/**
|