pub struct OpenTofuTemplateRenderingService { /* private fields */ }Expand description
Service for rendering OpenTofu infrastructure templates
This service encapsulates the logic for rendering OpenTofu (Terraform)
configuration files. It’s designed to be shared across command handlers
and steps that need to prepare infrastructure templates.
Note: OpenTofu requires more configuration than other template types because
it needs provider-specific settings, SSH credentials, and instance metadata.
Implementations§
Source§impl OpenTofuTemplateRenderingService
impl OpenTofuTemplateRenderingService
Sourcepub fn from_params(
templates_dir: PathBuf,
build_dir: PathBuf,
ssh_credentials: SshCredentials,
ssh_port: u16,
instance_name: InstanceName,
provider_config: ProviderConfig,
clock: Arc<dyn Clock>,
) -> Self
pub fn from_params( templates_dir: PathBuf, build_dir: PathBuf, ssh_credentials: SshCredentials, ssh_port: u16, instance_name: InstanceName, provider_config: ProviderConfig, clock: Arc<dyn Clock>, ) -> Self
Build an OpenTofuTemplateRenderingService from configuration parameters
§Arguments
templates_dir- Directory containing the source templatesbuild_dir- Directory where rendered templates will be writtenssh_credentials- SSH credentials for accessing the provisioned instancessh_port- SSH port for the instanceinstance_name- Name of the instance to provisionprovider_config- Provider-specific configuration (LXD, Docker, etc.)clock- The clock for generating timestamps
§Returns
Returns a configured OpenTofuTemplateRenderingService ready for template rendering
Sourcepub async fn render(&self) -> Result<(), OpenTofuTemplateRenderingServiceError>
pub async fn render(&self) -> Result<(), OpenTofuTemplateRenderingServiceError>
Render OpenTofu infrastructure templates
This renders the OpenTofu configuration files (main.tf, variables.tf, etc.)
to the build directory.
§Errors
Returns OpenTofuTemplateRenderingServiceError::RenderingFailed if template rendering fails.
Auto Trait Implementations§
impl !RefUnwindSafe for OpenTofuTemplateRenderingService
impl !UnwindSafe for OpenTofuTemplateRenderingService
impl Freeze for OpenTofuTemplateRenderingService
impl Send for OpenTofuTemplateRenderingService
impl Sync for OpenTofuTemplateRenderingService
impl Unpin for OpenTofuTemplateRenderingService
impl UnsafeUnpin for OpenTofuTemplateRenderingService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request