@gradientedge/cdk-utils-azure 2.26.0 → 2.27.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,4 +1,4 @@
|
|
|
1
|
-
import { getApiManagementServiceOutput, HostnameType, LoggerType } from '@pulumi/azure-native/apimanagement/index.js';
|
|
1
|
+
import { getApiManagementServiceOutput, HostnameType, listSubscriptionSecretsOutput, LoggerType, } from '@pulumi/azure-native/apimanagement/index.js';
|
|
2
2
|
import { getComponentOutput } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
3
3
|
import { PrincipalType } from '@pulumi/azure-native/authorization/index.js';
|
|
4
4
|
import { getVaultOutput } from '@pulumi/azure-native/keyvault/index.js';
|
|
@@ -165,12 +165,19 @@ export class AzureRestApi extends CommonAzureConstruct {
|
|
|
165
165
|
allowTracing: false,
|
|
166
166
|
scope: '/apis',
|
|
167
167
|
});
|
|
168
|
+
const subscriptionKey = pulumi
|
|
169
|
+
.all([this.api.apim.name, this.resourceGroup.name, apiManagementSubscription.name])
|
|
170
|
+
.apply(([serviceName, resourceGroupName, subscriptionName]) => listSubscriptionSecretsOutput({
|
|
171
|
+
serviceName,
|
|
172
|
+
resourceGroupName,
|
|
173
|
+
sid: subscriptionName,
|
|
174
|
+
}).apply(secrets => secrets.primaryKey ?? ''));
|
|
168
175
|
this.keyVaultManager.createKeyVaultSecret(`${this.id}-key-vault-api-subscription-key-secret`, this, {
|
|
169
176
|
vaultName: this.api.authKeyVault.name,
|
|
170
177
|
secretName: `${this.id}-subscription-key`,
|
|
171
178
|
resourceGroupName: this.props.apiAuthKeyVault.resourceGroupName,
|
|
172
179
|
properties: {
|
|
173
|
-
value:
|
|
180
|
+
value: subscriptionKey,
|
|
174
181
|
},
|
|
175
182
|
});
|
|
176
183
|
}
|