Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement resource #49

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Implement resource #49

wants to merge 6 commits into from

Conversation

nazarewk
Copy link

@nazarewk nazarewk commented Oct 18, 2020

this PR is retrofitted from https://github.com/nazarewk-iac/terraform-provider-custom / https://registry.terraform.io/providers/nazarewk-iac/custom/latest

The documentation is available at https://registry.terraform.io/providers/nazarewk/external/latest/docs/resources/resource?pollNotifications=true

Contrary to the data source the resource does not have stdin/stdout interface with Terraform. Instead it uses TF_DATA_DIR subdirectory and set of text files named after resource attributes for following reasons:

  • sometimes it's hard to tame script's or tool's stdout,
  • makes it easier to categorize data
  • makes it possible to mark data as sensitive (implemented) or not store it in the state at all (not implemented, might yield issues on delete)

the biggest drawbacks of the approach are:

  • slower to execute,
  • creates files,

I can identify some room for code improvement:

  1. broaden the scope of temporary directory (create it less often)? not sure it's possible without some ugly hacks
  2. prefer /tmp//run//var/run instead of TF_DATA_DIR? Some linux/unix distributions mount (a lot faster) in-memory disks in there.
  3. Add debugging trace? So far I am relying only on diagnostics.

Related to:

@nazarewk nazarewk marked this pull request as ready for review November 5, 2020 21:01
@hashicorp-cla
Copy link

hashicorp-cla commented Nov 22, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants