-
Notifications
You must be signed in to change notification settings - Fork 21
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
Long TXT value is getting recreated upon terraform apply
#54
Comments
"
is getting recreated upon terraform apply
terraform apply
You should use jsonencode for things like dkim records: value = jsonencode("v=DKIM1;h=sha256;k=rsa;s=email;p=MIIBIjAN...") |
@kimdre Sorry, I edited the question a lot after your comment. But in any case: I just tried |
The splitting is normal for long records like dkim, as the length of a single string in TXT records is limited to 255 bytes. It's normal though and the only workaround for this is to replace your single string with the splitted one that terraform shows as the current value before performing actions. |
A nice workaround to split recods automatically is described in a similiar issue related to route53 on aws: hashicorp/terraform-provider-aws#14941 (comment) |
Closes timohirt#54 Info is taken from timohirt#54 (comment)
Thanks, here's what I came up with after some trial and error: #56 |
I thought of the other workaround under my linked comment, which splits the string when needed (after every 255th char). However I have not tried it. |
Oh, I've overlooked that. However, it's overescaping ( |
I just tried it out with a combination of your example and the mentioned workaround with small changes:
|
taken from timohirt#54 (comment)
Indeed, this works for me too. I added it as alternative way - since it isn't really simpler than the other way ;-) |
I have this DKIM record in my
terraform.tf
:Now, upon each
terraform apply
, I'm getting:So (together with the information from #13) this looks like the API is automatically splitting the long string. But then, this provider thinks it's different from my long string, and tries to recreate it.
Unfortunately, I didn't quite get the bottom line of #13 - is it to split the
value
string manually in 2 parts?The text was updated successfully, but these errors were encountered: