-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network interfaces and an instance-level security groups may not be specified on the same request #2506
Comments
I can work around the error if I change the launch template to specify NetworkInterfaces instead of SecurityGroupNames and associate the security group to the NetworkInterface: launchTempl, err := ec2.NewLaunchTemplate(ctx, "exampleLaunchTemplate", &ec2.LaunchTemplateArgs{
ImageId: pulumi.String(ami),
InstanceType: pulumi.String("t2.micro"),
//SecurityGroupNames: pulumi.StringArray{sg.Name},
NetworkInterfaces: ec2.LaunchTemplateNetworkInterfaceArray{
ec2.LaunchTemplateNetworkInterfaceArgs{
SubnetId: subnet.ID(),
SecurityGroups: p.StringArray{
sg.ID(),
},
},
},
}, p.Provider(awsProvider))
if err != nil {
return err
} Also removing subnet association from the instance and to the launch template network interface: _, err = ec2.NewInstance(ctx, "debug-worker", &ec2.InstanceArgs{
//SubnetId: subnet.ID(),
InstanceType: pulumi.String("t2.micro"),
LaunchTemplate: &ec2.InstanceLaunchTemplateArgs{
Id: launchTempl.ID(),
Version: launchTempl.LatestVersion.ApplyT(func(x int) *string {
res := fmt.Sprintf("%d", x)
return &res
}).(pulumi.StringPtrOutput),
},
}, p.Provider(awsProvider)) |
Perhaps what's happening here is that this configuration of LaunchTemplate SecurityGroups is not compatible with NewInstance, but the surfaced error is not very direct about how to fix that. |
@t0yv0 I can see you marked it as |
I've heard indirectly (@phillipedwards) that the workaround was acceptable. I think we can close. |
Cannot close issue without required labels: |
What happened?
Customer stack fails with the following error in Pulumi:
Network interfaces and an instance-level security groups may not be specified on the same request
But the same command succeeds through AWS CLI
Expected Behavior
Pulumi on par with AWS CLI here.
Steps to reproduce
We were not able to access the original repro but here is a synthetic repro that reproduces the same error message. The key is having LaunchTemplate specifying security groups and Instance specifying SubnetId.
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: