Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/azure/services/eventgrid/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`

Expand Down
2 changes: 1 addition & 1 deletion src/lib/azure/services/key-vault/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? {
Expand Down
25 changes: 25 additions & 0 deletions src/lib/azure/services/servicebus/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ 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 {
ServicebusTopicProps,
ServicebusSubscriptionProps,
ServicebusNamespaceProps,
ServicebusQueueProps,
DataAzurermServicebusQueueProps,
} from './types'

/**
Expand Down Expand Up @@ -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
}
}
2 changes: 2 additions & 0 deletions src/lib/azure/services/servicebus/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
2 changes: 1 addition & 1 deletion src/lib/cloudflare/services/access/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})

Expand Down
7 changes: 6 additions & 1 deletion src/test/azure/services/servicebus-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand All @@ -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,
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/cloudflare/services/access-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
})
})
Expand Down