echoing-address-44214
03/08/2023, 2:05 AMnew aws.ec2.SecurityGroup(
"ruwentest",
{
description: "ruwentest",
vpcId: "vpc-123",
ingress: []
}
);
I can use pulumi import ...
to bring it into pulumi. But pulumi shows immediately a drift since the autogenerated name from pulumi doesn't match the current security group name. I know I can set the name explicitly, but I want to avoid that since that breaks deployments when I need to recreate the resource.
What I want is that if pulumi generates a name for something which I am importing right now, then it should take the existing name instead of generating a new one. Is there way to do that?billowy-army-68599
03/08/2023, 2:13 AMpulumi import
to generate the code? if so it should have the correct nameechoing-address-44214
03/08/2023, 2:14 AMbillowy-army-68599
03/08/2023, 2:16 AMnew aws.ec2.SecurityGroup(
"ruwentest",
{
description: "ruwentest",
vpcId: "vpc-123",
ingress: []
},
{ import: <id> }
);
What you could do is have a configurable flag that can be toggled if you’re importingechoing-address-44214
03/08/2023, 2:17 AMpulumi refreh
and pulumi up
pulumi wants to replace the security group because the name has changedbillowy-army-68599
03/08/2023, 2:17 AMechoing-address-44214
03/08/2023, 2:18 AMnew aws.ec2.SecurityGroup(
"ruwentest",
{
description: "ruwentest",
vpcId: standardAwsEnvironment.getVpcId(),
ingress: [],
// name: "ruwentest-52f4618",
},
{ import: "sg-0c09aeb634822eed9" }
);
ruwentest-5f93af2
and that clashes with the existing name ruwentest-52f4618
billowy-army-68599
03/08/2023, 2:46 AMechoing-address-44214
03/08/2023, 2:47 AMbillowy-army-68599
03/08/2023, 2:51 AMechoing-address-44214
03/08/2023, 2:55 AMbillowy-army-68599
03/08/2023, 3:01 AMechoing-address-44214
03/08/2023, 3:04 AMbillowy-army-68599
03/08/2023, 3:14 AMechoing-address-44214
03/08/2023, 3:15 AMbillowy-army-68599
03/08/2023, 4:00 AMechoing-address-44214
03/08/2023, 4:01 AMsalmon-gold-74709
03/20/2023, 7:09 PMechoing-address-44214
03/20/2023, 11:19 PM