Skip to main content

ParserBuilder

Struct ParserBuilder 

Source
#[non_exhaustive]
pub struct ParserBuilder { /* private fields */ }
Expand description

Builder for Parser. Every method consumes and returns self so configuration reads top-to-bottom.

Implementations§

Source§

impl ParserBuilder

Source

pub fn workspace_root(self, root: impl AsRef<Path>) -> Self

Required. Workspace root (the directory that contains the Terraform / Terragrunt code).

Source

pub fn environment(self, name: impl Into<Arc<str>>) -> Self

Pin terraform.workspace / Terragrunt cascade choice. Optional; when unset the resolver leaves var.environment unresolved.

Source

pub fn env_var_mode(self, mode: EnvVarMode) -> Self

How get_env(...) / Terragrunt funcs read the process env. Default: strict with an empty allowlist (no env vars are visible to user code).

Source

pub fn allow_env(self, name: impl Into<Arc<str>>) -> Self

Allow a single env var name through get_env(...). Repeatable.

Source

pub fn allow_env_many<I, S>(self, names: I) -> Self
where I: IntoIterator<Item = S>, S: Into<Arc<str>>,

Allowlist multiple env var names in one call.

Source

pub fn var(self, key: impl Into<Arc<str>>, value: impl Into<Arc<str>>) -> Self

Repo-level var.<key> = value binding. Repeatable. Values are stored as Value::Str; for richer types build the Map manually via Self::repo_vars.

Source

pub fn repo_vars(self, vars: Map) -> Self

Replace the repo-level variable map. See also Self::var.

Source

pub fn profile_map(self, map: Arc<ProfileMap>) -> Self

Pin an explicit ProfileMap for the provider resolver.

Source

pub fn load_profile_map_yaml(self, path: impl AsRef<Path>) -> Result<Self>

Load the profile map from a YAML file (spec 16 § 3.2).

§Errors

Returns Error::Provider when the file is missing, malformed, or violates the validator rules (account-id pattern, region length, etc.).

Source

pub fn load_aws_config(self, path: impl AsRef<Path>) -> Result<Self>

Load the profile map from an ~/.aws/config-shaped INI file (spec 16 § 3.1).

§Errors

Returns Error::Provider when the file is missing or malformed.

Source

pub fn default_region(self, region: impl AsRef<str>) -> Result<Self>

Default AWS region applied when neither provider blocks nor the Terragrunt cascade supply one.

§Errors

Returns Error::Validation when region fails the Region validator (charset / length).

Source

pub const fn strict_providers(self, strict: bool) -> Self

If true, the provider resolver returns StrictUnresolved when a referenced profile is missing from the profile map. Default: false.

Source

pub const fn max_walk_depth(self, depth: u32) -> Self

Maximum walk depth (discovery). Default: 16.

Source

pub const fn max_total_files(self, n: u64) -> Self

Maximum total files in the workspace. Default: 200 000.

Source

pub const fn max_file_bytes(self, n: u64) -> Self

Maximum size per file. Default: 4 MiB.

Source

pub const fn max_include_depth(self, n: u32) -> Self

Maximum Terragrunt include depth. Default: 32.

Whether the discoverer follows symlinks. Default: false.

Source

pub fn build(self) -> Result<Parser>

Finalise into a Parser.

§Errors

Returns Error::Validation when workspace_root was not set.

Trait Implementations§

Source§

impl Clone for ParserBuilder

Source§

fn clone(&self) -> ParserBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParserBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ParserBuilder

Source§

fn default() -> ParserBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,