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

plugin: Allow to declare custom attributes in config files #967

Merged
merged 1 commit into from Nov 23, 2020

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Nov 3, 2020

See also terraform-linters/tflint-plugin-sdk#72

This PR adds Body field with the hcl:",remain" tag to tflint.PluginConfig. This allows you to declare arbitrary custom attributes for each plugin, which previously only allowed enabled as attributes for the "plugin" block.

The content declared inside the "plugin" block will be transferred to the plugin as hcl.Body. On the plugin side, you can retrieve the configurations by decoding it against your own schema.

For example, the AWS ruleset will be able to declare the following configuration:

plugin "aws" {
  enabled = true

  access_key = "AWS_ACCESS_KEY"
  secret_key = "AWS_SECRET_KEY"
  region     = "us-east-1"
  profile    = "AWS_PROFILE"
  shared_credentials_file = "~/.aws/myapp"
}

@wata727 wata727 force-pushed the support_custom_plugin_attributes branch from d63b285 to 9c0fc38 Compare November 3, 2020 08:48
@wata727 wata727 force-pushed the support_custom_plugin_attributes branch from 9c0fc38 to d6138c7 Compare November 3, 2020 12:53
@wata727 wata727 merged commit 0919dd0 into master Nov 23, 2020
@wata727 wata727 deleted the support_custom_plugin_attributes branch November 23, 2020 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant