Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ModularPipelines.Terraform/AssemblyInfo.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
using System.Reflection;

[assembly: AssemblyMetadata("ModularPipelines.OptionsGenerator.Tool", "terraform")]
[assembly: AssemblyMetadata("ModularPipelines.OptionsGenerator.GeneratedAt", "2026-04-26T03:18:06.7100995Z")]
[assembly: AssemblyMetadata("ModularPipelines.OptionsGenerator.GeneratedAt", "2026-05-03T03:41:29.2372590Z")]
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,16 @@ public record TerraformGetOptions : TerraformOptions
[CliFlag("-no-color")]
public bool? NoColor { get; set; }

/// <summary>
/// Set the Terraform test directory, defaults to "tests".
/// </summary>
[CliOption("-test-directory", Format = OptionFormat.EqualsSeparated)]
public string? TestDirectory { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ public record TerraformGraphOptions : TerraformOptions
[CliOption("-module-depth", Format = OptionFormat.EqualsSeparated)]
public int? ModuleDepth { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,10 @@ public record TerraformInitOptions : TerraformOptions
[CliOption("-test-directory", Format = OptionFormat.EqualsSeparated)]
public string? TestDirectory { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ public record TerraformModulesOptions : TerraformOptions
[CliFlag("-json")]
public bool? Json { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ public record TerraformProvidersLockOptions : TerraformOptions
[CliOption("-test-directory", Format = OptionFormat.EqualsSeparated)]
public string? TestDirectory { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@ public record TerraformProvidersMirrorOptions : TerraformOptions
[CliFlag("-lock-file")]
public bool? LockFile { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ namespace ModularPipelines.Terraform.Options;
[CliSubCommand("providers")]
public record TerraformProvidersOptions : TerraformOptions
{
/// <summary>
/// Set the Terraform test directory, defaults to "tests".
/// </summary>
[CliOption("-test-directory", Format = OptionFormat.EqualsSeparated)]
public string? TestDirectory { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// <auto-generated>
// This file was generated by ModularPipelines.OptionsGenerator.
// Do not edit this file manually.
// </auto-generated>

#nullable enable

using System.CodeDom.Compiler;
using System.Diagnostics.CodeAnalysis;
using ModularPipelines.Attributes;
using ModularPipelines.Terraform.Options;

namespace ModularPipelines.Terraform.Options;

/// <summary>
/// Prints out a json representation of the schemas for all providers used
/// </summary>
[GeneratedCode("ModularPipelines.OptionsGenerator", "")]
[ExcludeFromCodeCoverage]
[CliSubCommand("providers", "schema")]
public record TerraformProvidersSchemaOptions : TerraformOptions
{
/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ public record TerraformStateMvOptions : TerraformOptions
[CliFlag("-ignore-remote-version")]
public bool? IgnoreRemoteVersion { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// <auto-generated>
// This file was generated by ModularPipelines.OptionsGenerator.
// Do not edit this file manually.
// </auto-generated>

#nullable enable

using System.CodeDom.Compiler;
using System.Diagnostics.CodeAnalysis;
using ModularPipelines.Attributes;
using ModularPipelines.Terraform.Options;

namespace ModularPipelines.Terraform.Options;

/// <summary>
/// Pull the state from its location, upgrade the local copy, and output it
/// </summary>
[GeneratedCode("ModularPipelines.OptionsGenerator", "")]
[ExcludeFromCodeCoverage]
[CliSubCommand("state", "pull")]
public record TerraformStatePullOptions : TerraformOptions
{
/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ public record TerraformStatePushOptions : TerraformOptions
[CliOption("-lock-timeout", Format = OptionFormat.EqualsSeparated)]
public string? LockTimeout { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ public record TerraformStateReplaceProviderOptions : TerraformOptions
[CliFlag("-ignore-remote-version")]
public bool? IgnoreRemoteVersion { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ public record TerraformStateRmOptions : TerraformOptions
[CliFlag("-ignore-remote-version")]
public bool? IgnoreRemoteVersion { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ public record TerraformTaintOptions : TerraformOptions
[CliFlag("-ignore-remote-version")]
public bool? IgnoreRemoteVersion { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public record TerraformTestOptions : TerraformOptions
public bool? Json { get; set; }

/// <summary>
/// Saves a test report in JUnit XML format to the specified file. This is currently incompatible with remote test execution using the the -cloud-run option. The file path must be relative or absolute.
/// Saves a test report in JUnit XML format to the specified file. This is currently incompatible with remote test execution using the -cloud-run option. The file path must be relative or absolute.
/// </summary>
[CliOption("-junit-xml", Format = OptionFormat.EqualsSeparated)]
public string? JunitXml { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ public record TerraformValidateOptions : TerraformOptions
[CliFlag("-no-tests")]
public bool? NoTests { get; set; }

/// <summary>
/// Set the Terraform test directory, defaults to "tests".
/// </summary>
[CliOption("-test-directory", Format = OptionFormat.EqualsSeparated)]
public string? TestDirectory { get; set; }

/// <summary>
/// If specified, the command will also validate .tfquery.hcl files.
/// </summary>
[CliFlag("-query")]
public bool? Query { get; set; }

/// <summary>
/// Load variable values from the given file, in addition to the default files terraform.tfvars and *.auto.tfvars. Use this option more than once to include more than one variables file.
/// </summary>
[CliOption("-var-file", Format = OptionFormat.EqualsSeparated)]
public string? VarFile { get; set; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,20 @@ public virtual async Task<CommandResult> Mirror(
return await _command.ExecuteCommandLineTool(options ?? new TerraformProvidersMirrorOptions(), executionOptions, cancellationToken);
}

/// <summary>
/// Prints out a json representation of the schemas for all providers used
/// </summary>
/// <param name="options">The command options.</param>
/// <param name="executionOptions">The execution configuration options.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The command result.</returns>
public virtual async Task<CommandResult> Schema(
TerraformProvidersSchemaOptions options = default,
CommandExecutionOptions executionOptions = null,
CancellationToken cancellationToken = default)
{
return await _command.ExecuteCommandLineTool(options ?? new TerraformProvidersSchemaOptions(), executionOptions, cancellationToken);
}

#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ public virtual async Task<CommandResult> Mv(
return await _command.ExecuteCommandLineTool(options ?? new TerraformStateMvOptions(), executionOptions, cancellationToken);
}

/// <summary>
/// Pull the state from its location, upgrade the local copy, and output it
/// </summary>
/// <param name="options">The command options.</param>
/// <param name="executionOptions">The execution configuration options.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The command result.</returns>
public virtual async Task<CommandResult> Pull(
TerraformStatePullOptions options = default,
CommandExecutionOptions executionOptions = null,
CancellationToken cancellationToken = default)
{
return await _command.ExecuteCommandLineTool(options ?? new TerraformStatePullOptions(), executionOptions, cancellationToken);
}

/// <summary>
/// Update remote state from a local state file at PATH.
/// </summary>
Expand Down
Loading