diff --git a/src/lib/azure/services/eventgrid/main.ts b/src/lib/azure/services/eventgrid/main.ts index c7e101c0..505e9d8d 100644 --- a/src/lib/azure/services/eventgrid/main.ts +++ b/src/lib/azure/services/eventgrid/main.ts @@ -176,7 +176,7 @@ export class AzureEventgridManager { id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicEventSubscriptionProps, - systemTopic: EventgridSystemTopic + systemTopic: EventgridSystemTopic | DataAzurermEventgridTopic ) { if (!props) throw `Props undefined for ${id}` diff --git a/src/lib/azure/services/key-vault/main.ts b/src/lib/azure/services/key-vault/main.ts index cf91189c..d2460fc8 100644 --- a/src/lib/azure/services/key-vault/main.ts +++ b/src/lib/azure/services/key-vault/main.ts @@ -46,7 +46,7 @@ export class AzureKeyVaultManager { location: resourceGroup.location, resourceGroupName: resourceGroup.name, skuName: props.skuName ?? 'standard', - enableRbacAuthorization: props.enableRbacAuthorization ?? true, + rbacAuthorizationEnabled: props.rbacAuthorizationEnabled ?? true, softDeleteRetentionDays: props.softDeleteRetentionDays ?? 90, purgeProtectionEnabled: props.purgeProtectionEnabled ?? true, tags: props.tags ?? { diff --git a/src/lib/azure/services/servicebus/main.ts b/src/lib/azure/services/servicebus/main.ts index 090bb553..19ca2e00 100644 --- a/src/lib/azure/services/servicebus/main.ts +++ b/src/lib/azure/services/servicebus/main.ts @@ -3,6 +3,7 @@ import { ServicebusNamespace } from '@cdktf/provider-azurerm/lib/servicebus-name import { ServicebusTopic } from '@cdktf/provider-azurerm/lib/servicebus-topic' import { ServicebusSubscription } from '@cdktf/provider-azurerm/lib/servicebus-subscription' import { ServicebusQueue } from '@cdktf/provider-azurerm/lib/servicebus-queue' +import { DataAzurermServicebusQueue } from '@cdktf/provider-azurerm/lib/data-azurerm-servicebus-queue' import { CommonAzureConstruct } from '../../common' import { createAzureTfOutput } from '../../utils' import { @@ -10,6 +11,7 @@ import { ServicebusSubscriptionProps, ServicebusNamespaceProps, ServicebusQueueProps, + DataAzurermServicebusQueueProps, } from './types' /** @@ -141,4 +143,27 @@ export class AzureServicebusManager { return servicebusSubscription } + + /** + * @summary Method to resolve a new servicebus queue + * @param id scoped id of the resource + * @param scope scope in which this resource is defined + * @param props servicebus queue properties + * @see [CDKTF Servicebus Queue Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusQueue.typescript.md} + */ + public resolveServicebusQueue(id: string, scope: CommonAzureConstruct, props: DataAzurermServicebusQueueProps) { + if (!props) throw `Props undefined for ${id}` + + const servicebusQueue = new DataAzurermServicebusQueue(scope, `${id}-sq`, { + ...props, + name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.serviceBusQueue), + namespaceId: props.namespaceId, + }) + + createAzureTfOutput(`${id}-servicebusQueueName`, scope, servicebusQueue.name) + createAzureTfOutput(`${id}-servicebusQueueFriendlyUniqueId`, scope, servicebusQueue.friendlyUniqueId) + createAzureTfOutput(`${id}-servicebusQueueId`, scope, servicebusQueue.id) + + return servicebusQueue + } } diff --git a/src/lib/azure/services/servicebus/types.ts b/src/lib/azure/services/servicebus/types.ts index 5c383c67..b099057f 100644 --- a/src/lib/azure/services/servicebus/types.ts +++ b/src/lib/azure/services/servicebus/types.ts @@ -2,8 +2,10 @@ import { ServicebusNamespaceConfig } from '@cdktf/provider-azurerm/lib/servicebu import { ServicebusTopicConfig } from '@cdktf/provider-azurerm/lib/servicebus-topic' import { ServicebusQueueConfig } from '@cdktf/provider-azurerm/lib/servicebus-queue' import { ServicebusSubscriptionConfig } from '@cdktf/provider-azurerm/lib/servicebus-subscription' +import { DataAzurermServicebusQueueConfig } from '@cdktf/provider-azurerm/lib/data-azurerm-servicebus-queue' export interface ServicebusNamespaceProps extends ServicebusNamespaceConfig {} export interface ServicebusTopicProps extends ServicebusTopicConfig {} export interface ServicebusQueueProps extends ServicebusQueueConfig {} export interface ServicebusSubscriptionProps extends ServicebusSubscriptionConfig {} +export interface DataAzurermServicebusQueueProps extends DataAzurermServicebusQueueConfig {} diff --git a/src/lib/cloudflare/services/access/main.ts b/src/lib/cloudflare/services/access/main.ts index 39f9304c..393a3e31 100644 --- a/src/lib/cloudflare/services/access/main.ts +++ b/src/lib/cloudflare/services/access/main.ts @@ -141,7 +141,7 @@ export class CloudflareAccessManager { const accessGroup = new ZeroTrustAccessGroup(scope, `${id}`, { ...props, - name: `${props.name}-${scope.props.stage}`, + name: `${props.name} - ${scope.props.stage.toUpperCase()}`, zoneId, }) diff --git a/src/test/azure/services/servicebus-manager.test.ts b/src/test/azure/services/servicebus-manager.test.ts index 9dc40270..b19f683f 100644 --- a/src/test/azure/services/servicebus-manager.test.ts +++ b/src/test/azure/services/servicebus-manager.test.ts @@ -80,7 +80,7 @@ class TestCommonConstruct extends CommonAzureConstruct { namespaceId: namespace.id, }) - this.servicebusManager.createServicebusQueue(`test-servicebus-topic-${this.props.stage}`, this, { + const serviceBus = this.servicebusManager.createServicebusQueue(`test-servicebus-queue-${this.props.stage}`, this, { ...this.props.testServicebusQueue, namespaceId: namespace.id, }) @@ -89,6 +89,11 @@ class TestCommonConstruct extends CommonAzureConstruct { ...this.props.testServicebusSubscription, topicId: topic.id, }) + + this.servicebusManager.resolveServicebusQueue(`test-resolve-servicebus-queue-${this.props.stage}`, this, { + name: serviceBus.name, + namespaceId: serviceBus.namespaceId, + }) } } diff --git a/src/test/cloudflare/services/access-manager.test.ts b/src/test/cloudflare/services/access-manager.test.ts index 537da90d..58a49a21 100644 --- a/src/test/cloudflare/services/access-manager.test.ts +++ b/src/test/cloudflare/services/access-manager.test.ts @@ -313,7 +313,7 @@ describe('TestCloudflareAccessManager', () => { }, }, ], - name: 'test-group-dev', + name: 'test-group - DEV', zone_id: '${data.cloudflare_zone.test-access-grp-dev-data-zone-data-zone.zone_id}', }) })