mysterious-piano-88140
09/14/2021, 7:36 PMexport const databaseResourceGroup = new ResourceGroup(
'resource-group-dev',
{
resourceGroupName: 'resource-group-dev',
location: 'germanywestcentral',
tags: {
project: 'test',
env: 'dev',
type: 'resourcegroup'
}
}
)
My problem is that in the second project the ResourceGroup is not linked no matter how (getResourceGroup, Import, StackReference) but is always recreated, which leads to a fail because it just already exists.
// const resourceGroup = await getResourceGroup({
// resourceGroupName: databaseResourceGroupName
// })
const resourceGroup = new ResourceGroup(
'resource-group-dev',
{
resourceGroupName: 'resource-group-dev',
location: 'germanywestcentral',
tags: {
project: 'test',
env: 'dev',
type: 'resourcegroup'
}
},
{
import: `/subscriptions/<subscription-id>/resourceGroups/<resourcegroupname>`
}
)
Do any of you here have an idea how I can link between resources without recreating them.
I would now expect a similar pattern as in the AWS CDK where I can access ARN with from methods.bored-oyster-3147
09/14/2021, 7:40 PMmysterious-piano-88140
09/14/2021, 7:44 PMbored-oyster-3147
09/14/2021, 7:47 PMmysterious-piano-88140
09/14/2021, 7:58 PMType Name Plan Info
pulumi:pulumi:Stack xxxx-dev 1 error
+ └─ azure-native:resources:ResourceGroup xxx-resource-group-dev create 2 errors
Diagnostics:
pulumi:pulumi:Stack (xxx-dev):
error: preview failed
azure-native:resources:ResourceGroup (xxx-resource-group-dev):
error: Duplicate resource URN 'urn:pulumi:dev::xxxx::azure-native:resources:ResourceGroup::xxx-resource-group-dev'; try giving it a unique name
error: Preview failed: resource '/subscriptions/<subscriptionid>/resourceGroups/xxx-resource-group-dev57917a4a' does not exist
witty-candle-66007
09/14/2021, 8:02 PMbored-oyster-3147
09/14/2021, 8:02 PMmysterious-piano-88140
09/14/2021, 9:02 PM