better-shampoo-48884
06/25/2021, 12:42 PMnew k8s.core.yaml("my-string",{..})
needs now to be `new k8s.core.yaml(${region}-my-string
,{..)`
There are ~180 resources created in my stack so far, and each of them needs a new name. Ideas?billowy-army-68599
06/25/2021, 1:10 PMbetter-shampoo-48884
06/25/2021, 1:20 PMbillowy-army-68599
06/25/2021, 1:23 PMbetter-shampoo-48884
06/25/2021, 1:25 PMpulumi stack -u
shows the issue.. the ConfigGroup (keycloak-crd-install) is defined by me (pulumi name) but the URNs for the actual yaml (and crd) being deployed are without any naming I can influence - thus will conflict:
kubernetes:yaml:ConfigGroup keycloak-crd-install
│ │ │ URN: urn:pulumi:prod.k8s.devsecops::baseline-k8s::proj:k8s:foundation$kubernetes:yaml:ConfigGroup::keycloak-crd-install
│ │ ├─ kubernetes:yaml:ConfigFile ./components/kubernetes-components/operators/keycloak-12.0.1/crds/keycloak.org_keycloakusers_crd.yaml
│ │ │ │ URN: urn:pulumi:prod.k8s.devsecops::baseline-k8s::proj:k8s:foundation$kubernetes:yaml:ConfigGroup$kubernetes:yaml:ConfigFile::./components/kubernetes-components/operators/keycloak-12.0.1/crds/keycloak.org_keycloakusers_crd.yaml
│ │ │ └─ kubernetes:<http://apiextensions.k8s.io/v1beta1:CustomResourceDefinition|apiextensions.k8s.io/v1beta1:CustomResourceDefinition> <http://keycloakusers.keycloak.org|keycloakusers.keycloak.org>
│ │ │ URN: urn:pulumi:prod.k8s.devsecops::baseline-k8s::proj:k8s:foundation$kubernetes:yaml:ConfigGroup$kubernetes:yaml:ConfigFile$kubernetes:<http://apiextensions.k8s.io/v1beta1:CustomResourceDefinition::keycloakusers.keycloak.org|apiextensions.k8s.io/v1beta1:CustomResourceDefinition::keycloakusers.keycloak.org>
little-cartoon-10569
06/27/2021, 10:37 PMpulumi import
statements, but it should only be a couple of hours' work...better-shampoo-48884
06/28/2021, 6:02 AMbillowy-army-68599
06/28/2021, 11:23 AMbetter-shampoo-48884
06/29/2021, 6:20 AMImporting (prod.k8s.cust-temp-location):
Type Name Status
pulumi:pulumi:Stack baseline-k8s-prod.k8s.cust-temp-location
└─ base:k8s:databases location-Database
= ├─ azure-native:keyvault:Secret location-influx-pass-vault imported
= └─ azure-native:keyvault:Secret location-influx-user-vault imported
Resources:
= 2 imported
39 unchanged
----
Updating (prod.k8s.cust-temp-location):
Type Name Status Info
pulumi:pulumi:Stack baseline-k8s-prod.k8s.cust-temp-location **failed** 1 error; 63 messages
└─ base:k8s:databases location-Database
+- └─ azure-native:keyvault:Secret location-influx-user-vault **replacing failed** [diff: -tags~properties,protect,provider]; 1 error
Diagnostics:
azure-native:keyvault:Secret (location-influx-user-vault):
error: cannot create already existing resource '/subscriptions/(sub)/resourceGroups/(rg)/providers/Microsoft.KeyVault/vaults/(vaultname)/secrets/influxdb-username'
For some reason it wants to recreate the key - most likely because the value of it changes, which is likely since the value it had was from a previous run in a stack I destroyed. Considering how hard it is to delete keys in vault - that was not an option. The provider from the stack had a random-looking numeric value (looking at another stack used) so I didn't feel like I could safely provide it - not that I think that was an option. Updating the value of a secret should not require recreation of that secret though, so I can't believe that the properties would cause it.great-sunset-355
06/30/2021, 6:13 PMbetter-shampoo-48884
06/30/2021, 6:37 PMDuplicate resource URN ...
issues - this might help.
Essentially, I'm combining both `resourcePrefix`to introduce uniqueness to the naming of the resource, as well as transformations
to remove any instances of that uniqueness as it gets deployed. Hacky? Sure. Works? So far so good 🙂
https://github.com/pulumi/pulumi/discussions/7382 for a bit more detail.