-
Notifications
You must be signed in to change notification settings - Fork 28
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
unable to set AssociatePublicIpAddress
for network interface to false
#115
Comments
@theobarberbany any advice on how we should proceed? I can open a PR afterward. |
we tested with this minimal patch (default to false) and it works well for us
|
Perhaps you linked the wrong thing, but, following the link, the only description I can see of the AssociatePublicIPAddress field is
There is nothing to say that it defaults to Looking at the SDK reference, it does mention:
Are you perhaps launching your instance into a default subnet? |
I'm pretty sure we do not use the default subnet. we delete the default vpc as part of our account provisioning process . |
also i corporate settings, there is usually an SCP required AssociatePublicIpAddress explicitly set to false as well |
Hmm, double checking on that logic, I think the issue is just line 374
If it were instead
The rest of the logic works just the same, except, whatever the user put in explicitly as true or false into that value, would get passed onto AWS. Meaning anyone not expressing an opinion, would still leverage AWS's default value, whatever they determine that to be. |
Appears this is a regression as we used to set the value directly, up until #78 |
yeah that works too. we would like to be able to explicitly set that value |
In corporate context, we often have a SCP (service control policy) to block
AssociatePublicIpAddress
when set totrue
by default.However, in machine-api-provider-aws, we have this code path
machine-api-provider-aws/pkg/actuators/machine/instances.go
Lines 364 to 389 in 318ae2f
where as when we create new network interface, we did not explicity set
AssociatePublicIpAddress
. This field, when omited, AWS will use the default value which istrue
as documented hereTogether with the
if aws.BoolValue(machineProviderConfig.PublicIP) {
only check, render us unable to set this value tofalse
even if we setmachineProviderConfig.PublicIP
to false.The fix for this could be
AssociatePublicIpAddress
tofalse
.else
clause to handlefalse
path.What do you think?
The text was updated successfully, but these errors were encountered: