Dagger
Search

drift

A Drift detection module around terraform/terragrunt which allow to send a report

Installation

dagger install github.com/Dudesons/daggerverse/drift@v0.2.0

Entrypoint

Return Type
Drift !
Arguments
NameTypeDescription
mountPointString Define where the code is mounted, this could impact for absolute module path
Example
dagger -m github.com/Dudesons/daggerverse/drift@5a0943df5ceca43ab24309e5331f0bac26208a58 call \
func (m *myModule) example() *Drift  {
	return dag.
			Drift()
}
@function
def example() -> dag.Drift:
	return (
		dag.drift()
	)
@func()
example(): Drift {
	return dag
		.drift()
}

Types

Drift 🔗

reportToSlack() 🔗

Send the report formated to slack

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-The slack token to use
channelIdString !-The channel id where the report will be posted
colorString "#9512a6"Define the sidebar color of the message in slack
Example
dagger -m github.com/Dudesons/daggerverse/drift@5a0943df5ceca43ab24309e5331f0bac26208a58 call \
 report-to-slack --token env:MYSECRET --channel-id string
func (m *myModule) example(ctx context.Context, token *Secret, channelId string)   {
	return dag.
			Drift().
			ReportToSlack(ctx, token, channelId)
}
@function
async def example(token: dagger.Secret, channel_id: str) -> None:
	return await (
		dag.drift()
		.report_to_slack(token, channel_id)
	)
@func()
async example(token: Secret, channelId: string): Promise<void> {
	return dag
		.drift()
		.reportToSlack(token, channelId)
}

detection() 🔗

Trigger the drift detection

Return Type
Drift !
Arguments
NameTypeDefault ValueDescription
srcDirectory !-All the terraform/terragrunt code necessary in order to be able to run plan
stackRootPathString !-The root path where stack are living
maxParallelizationInteger !-The number of execution in parallel we want to have, 0 mean no limit
cacheBursterLevelString "hour"Define if the cache burster level is done per day (daily), per hour (hour), per minute (minute), per second (default)
Example
dagger -m github.com/Dudesons/daggerverse/drift@5a0943df5ceca43ab24309e5331f0bac26208a58 call \
 detection --src DIR_PATH --stack-root-path string --max-parallelization integer
func (m *myModule) example(src *Directory, stackRootPath string, maxParallelization int) *Drift  {
	return dag.
			Drift().
			Detection(src, stackRootPath, maxParallelization)
}
@function
def example(src: dagger.Directory, stack_root_path: str, max_parallelization: int) -> dag.Drift:
	return (
		dag.drift()
		.detection(src, stack_root_path, max_parallelization)
	)
@func()
example(src: Directory, stackRootPath: string, maxParallelization: number): Drift {
	return dag
		.drift()
		.detection(src, stackRootPath, maxParallelization)
}