Closed tnguyen14 closed 3 years ago
Hey @tnguyen14 I would be curious why advertise_mode
is not being read correctly when you import it.
Are you able to include debug logs for your import & plan afterwards?
Otherwise, adding support for updating peer_asn
and advertise_mode
would be a feature request and I can add it to the list to be triaged
@slevenick thanks for the response. I would say go with the feature request for now. I will open a separate ticket for the import issue with more debug logs.
@slevenick I created https://github.com/hashicorp/terraform-provider-google/issues/8009 for the import issue
advertisedGroups
mentions:
Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.
advertiseMode
's documentation is a little sparse, it only indicates:
User-specified flag to indicate which mode to use for advertisement.
What I suspect is that the same is true for this field as well, and that the bgp
settings override those in the peer. That makes a past assumption of ours- that no setting returned means "DEFAULT"
- is false. Note that default doesn't mean "default for the router" here, it's the default advertisement mode
The good news: You can ignore this value. Terraform deciding it has a value of "DEFAULT"
is entirely clientside, and the field is immutable (eg. changing the value recreates the resource) and as-implemented Terraform is unable to send a bad update. It's completely benign to ignore- I would suggest setting lifecycle.ignore_changes
on the field.
We'll still want to investigate and fix this behaviour, we'll want to confirm what we do with the service team.
Note that default doesn't mean "default for the router" here, it's the default advertisement mode
Default seems to imply inherited from cloud router.
Each BGP session for a Cloud Router also has a default advertisement. By default, Cloud Router propagates its route advertisements to all of its BGP sessions. If you configure custom route advertisements on a Cloud Router, its BGP sessions inherit those custom advertisements.
The current behavior looks okay to me. We only need to look into seeing if a bpgpeer's AdvertiseMode and AdvertisedGroup is changeable.
From a dev on the Virtual router team.
That is, if bgp.advertiseMode is "custom" and bgppeer.advertiseMode is "default", then the custom advertisements from bgp will be applied to the bgppeer.
Thanks for looking into this!
The current behavior looks okay to me.
@ScottSuarez are you saying that it's okay to force replacement if peer_asn
and advertise_mode
change?
The current behavior looks okay to me.
@ScottSuarez are you saying that it's okay to force replacement if
peer_asn
andadvertise_mode
change?
No I was referring to behavior of DEFAULT
being set when bpg.advertisedMode
is CUSTOM
.
I investigated the updatable fields and I was able to confirm that advertiseMode
, advertisedGroups
, peerAsn
, and peerIpAddress
are able to be updated. I've put out a pr to enable you do so. Thanks for your help here @tnguyen14 .
Does anyone know when the change merged in #8862 will be released?
April 19th it will be released as apart of 3.65.0
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error π€ π , please reach out to my human friends π hashibot-feedback@hashicorp.com. Thanks!
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
0.12.29
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
We have BGP peers that are of type "MANAGED_BY_ATTACHMENT". We use
terraform import
to get them managed by Terraform.On the GCP console, the "Advertisement Mode" for the peers are shown as "Custom", however, when imported, the terraform state has the attribute
advertise_mode
asDEFAULT
.When we run
terraform plan
, the output shows that theadvertise_mode
needs to be changed fromDEFAULT
toCUSTOM
(as the terraform configuration file expects), and that thepeer_asn
needs to be updated as well (also as the terraform configuration file dictates).The changes on these 2 attributes indicate that they would force a replacement of the BGP peer resource.
I don't think that changing these attributes should force a replacement. In the GCP console, I could go in and update these attributes inline without having to delete those resources.
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
References