Closed xsmills closed 4 years ago
There are few ways you can do it:
Use TerraformGenerator's Function class:
tfg.resource('spinnaker_pipeline', 'deploypipeline', {
application: myservice.attr('application'),
name: 'deploy',
pipeline: fn('file', 'resources/rollback.json')
});
Do it in a more Javascript/Typescript manner
const rollbackJson = required('resources/rollback.json');
tfg.resource('spinnaker_pipeline', 'deploypipeline', { application: myservice.attr('application'), name: 'deploy', pipeline: heredoc(rollbackJson) });
3. You can even write your rollback JSON directly in your .js or .ts file:
const rollbackJson = { something: 'something' };
tfg.resource('spinnaker_pipeline', 'deploypipeline', { application: myservice.attr('application'), name: 'deploy', pipeline: heredoc(rollbackJson) });
Describe the bug The in-built Terraform
file
function isn't recognized. When it is used in a resource like shown below, a reference error is thrown.To reproduce
Throws this error:
Expected behavior I would have expected the
file
function to be recognized.Additional context Add any other context about the problem here.