I am creating GCP pubsub schema with terraform.
When I am creating pubsub schema manually I am directly copy paste schema in the provided field and didn't get any error.
But when I am creating schema from terraform I have to replace newline with "\n". Is there any solution so that I don't have put "\n" in place of newline explicit.
My terraform code for pubsub schema
resource "google_pubsub_schema" "schema" {
name = var.schema_name
type = var.schema_type
definition = var.schema_definition
}
Not working : Format provided by the product team, getting the error from terraform
syntax = "proto3";
package com.sntl.proto;
message UsageMessageProto {
string tenantEnvId = 1;
string correlationId = 2;
UsageDataProto data = 3;
message UsageDataProto {
string identity = 1;
string sessionId = 2;
uint32 clientVersion = 3;
uint64 timeStamp = 4;
string authId = 5;
uint64 usageCountMultiplier = 6;
uint64 hardlimit = 7;
string machineId = 8;
string serviceId = 9;
uint64 vendorId = 10;
string logComment = 11;
}
}
Working : new change format replace newline with "\n":
\n syntax = \"proto3\"; \n package com.sntl.proto; \n message UsageMessageProto { \n string tenantEnvId = 1; \n string correlationId = 2; \n UsageDataProto data = 3; \n message UsageDataProto { \n string identity = 1; \n string sessionId = 2; \n uint32 clientVersion = 3; \n uint64 timeStamp = 4; \n string authId = 5; \n uint64 usageCountMultiplier = 6; \n uint64 hardlimit = 7; \n string machineId = 8; \n string serviceId = 9; \n uint64 vendorId = 10; \n string logComment = 11;\n}\n}\n
I need a solution so that I don't have to put "\n" in place of newline explicit.