https://pulumi.com logo
Title
m

magnificent-sugar-64951

05/21/2023, 9:39 AM
since it try to delete the subnet
m

melodic-tomato-39005

05/22/2023, 12:58 PM
Hi @magnificent-sugar-64951,
pulumi import
should not only update your stack (json file) but also print code that you can insert into your program. Another alternative is to use import directly in your code. Both are documented here.
m

magnificent-sugar-64951

05/22/2023, 1:01 PM
@melodic-tomato-39005 pulumi import doesn't print the code, that's another issue
image.png
and this is pulumi preview
image.png
this is import
image.png
m

melodic-tomato-39005

05/22/2023, 1:06 PM
Oh, I see. It’s an empty import because you pointed Pulumi to your existing stack with
-f
. But in your case, you want to import new resources from Azure into your stack. You would use this syntax:
pulumi import aws:s3/bucket:Bucket infra-logs company-infra-logs
m

magnificent-sugar-64951

05/22/2023, 1:07 PM
this is preview
Type Name Plan Info pulumiπŸ˜›ulumi:Stack aks-k8s-dev ~ β”œβ”€ azure-native:network:VirtualNetwork virtualNetwork update [diff: -subnets] ~ └─ azure-native:containerservice:ManagedCluster managedCluster update [diff: -autoScalerProfile]
so in that case import for azure aks is
pulumi import azure-native:network:VirtualNetwork
pulumi import azure-native:containerservice:ManagedCluster
right?
so we can get what need to be import using pulumi preview command , isn't it?
sorry hv to go to pick the kid
will be back in 30min
thanks Thomas for the help
πŸ™‚
m

melodic-tomato-39005

05/22/2023, 1:09 PM
You need three arguments:
pulumi import [type] [name] [id]
. I think your
types
are correct. The
name
is your choice. The
id
is the full Azure id.
np πŸ™‚
m

magnificent-sugar-64951

05/22/2023, 1:10 PM
oki got it