Ⅰ. 插件描述
Vim terraform snippetsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'sebosp/vim-snippets-terraform'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'sebosp/vim-snippets-terraform'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'sebosp/vim-snippets-terraform'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/sebosp/vim-snippets-terraform
Ⅳ. 文档说明
# AWS terraform snippets for vim
Compatible with Terraform 0.9.3
You need to have vim-snippets and UltiSnips installed which in turn means you need python2 or python3 and vim compiled with your python version (There's a docker image with everything cooked, see below).
Example
Status 100% Complete
This is a very early stage, if you are a brave soul and find inconsistencies please let me know.
As you might suspect, this is not me typing the snippets, a script provides general scaffolding and structure of the different resources or data. For every snippet I have gone through the docs to verify the use and try to be as close to docs as possible (which is mostly the reason to do this, get acquainted with the code and read the docs).
Use
All AWS resources can be triggered at the start of the line.
meta-params (depends_on, lifecycle, etc) can be started regardless of the position.
Snippets can be located by following this simple combination:
First letter denotes the verbosity of the snippet:
s:short: only the required params are populatedf:full: every attribute type is populated
Second letter denotes the resource type:
d:data: triggers a "data" sourcer:resource: triggers a "resource" definition
The name of the resource:
AwsAlbTargetGrouptriggers the data|resource "aws_alb_target_group"
Docker Image
This is included as part of sebosp/tvl:0.0.9
See tvl repo for usage.
