I need to decode a GCP Service account json at runtime. Pseudocode:
datadog_sa_key = ServiceAccountKey(
scope, f'datadog-sa-key-{project_id}', service_account_id=datadog_service_account.name
)
stuff = TerraformOutput(scope, 'yass', value='ywass')
stuff.add_override('value', '`jsondecode(base64decode("google_service_account_key.datadog_sa_key.private_key")).client_email`')
The docs are a bit sparse in terms of python examples. I’ve tried various variations of specifying the function string but to no avail
The goal is to actually print out the a value from the base64-encoded json stored in the private_key
attribute of the datadog_sa_key
variable
This is just printing the string for me, not actually executing it. Should what I’m trying to do be possible?