Skip to content

.driftignore: Inline comments being ignored #1688

@syphernl

Description

@syphernl

Description
Imaging having a .driftignore file with these contents:

aws_iam_role.foo
aws_iam_role.bar
aws_iam_role.baz # created manually as a test

Running driftctl scan on this will still show aws_iam_role.baz as existing without it being created via IaC.

Changing the .driftignore file to this:

aws_iam_role.foo
aws_iam_role.bar

# created manually as a test
aws_iam_role.baz

results in driftctl properly ignoring the aws_iam_role.baz entry.

Environment

  • OS: Ubuntu / Alpine
  • driftctl version: v0.39.0
  • terraform version: v1.5.6
  • terraform providers versions:

How to reproduce
See above

Possible Solution
Allow in-line comments to be placed, anything besides a # should be ignored. To my knowledge there are no entities that contain a #?

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions