|
1 | | -## AWS CloudFormation RPDK Go Plugin |
| 1 | +## AWS CloudFormation Resource Provider Go Plugin |
2 | 2 |
|
3 | | -The CloudFormation Provider Development Toolkit Go Plugin allows you to autogenerate Go code based on an input schema. |
| 3 | +The CloudFormation CLI (cfn) allows you to author your own resource providers that can be used by CloudFormation. |
4 | 4 |
|
5 | | -This plugin library helps to provide runtime bindings for the execution of your providers by CloudFormation. |
| 5 | +This plugin library helps to provide Go runtime bindings for the execution of your providers by CloudFormation. |
| 6 | + |
| 7 | +Usage |
| 8 | +----- |
| 9 | + |
| 10 | +If you are using this package to build resource providers for CloudFormation, install the [CloudFormation CLI Go Plugin](https://github.com/aws-cloudformation/cloudformation-cli-go-plugin) - this will automatically install the the [CloudFormation CLI](https://github.com/aws-cloudformation/cloudformation-cli)! A Python virtual environment is recommended. |
| 11 | + |
| 12 | +```bash |
| 13 | +pip3 install cloudformation-cli-go-plugin |
| 14 | +``` |
| 15 | + |
| 16 | +Refer to the documentation for the [CloudFormation CLI](https://github.com/aws-cloudformation/cloudformation-cli) for usage instructions. |
6 | 17 |
|
7 | 18 | Development |
8 | 19 | ----------- |
9 | 20 |
|
10 | | -For changes to the plugin, a Python virtual environment is recommended. You also need to download `cloudformation-cli` and install it first: |
| 21 | +For changes to the plugin, a Python virtual environment is recommended. Check out and install the plugin in editable mode: |
11 | 22 |
|
12 | | -``` |
| 23 | +```bash |
13 | 24 | python3 -m venv env |
14 | 25 | source env/bin/activate |
15 | | -pip3 install cloudformation-cli |
16 | | -pip3 install -e . |
| 26 | +pip3 install -e /path/to/cloudformation-cli-go-plugin |
17 | 27 | ``` |
18 | 28 |
|
19 | | -Linting and running unit tests is done via [pre-commit](https://pre-commit.com/), and so is performed automatically on commit. The continuous integration also runs these checks. Manual options are available so you don't have to commit): |
| 29 | +You may also want to check out the [CloudFormation CLI](https://github.com/aws-cloudformation/cloudformation-cli) if you wish to make edits to that. In this case, installing them in one operation works well: |
20 | 30 |
|
| 31 | +```bash |
| 32 | +pip3 install \ |
| 33 | + -e /path/to/cloudformation-cli \ |
| 34 | + -e /path/to/cloudformation-cli-go-plugin |
21 | 35 | ``` |
| 36 | + |
| 37 | +That ensures neither is accidentally installed from PyPI. |
| 38 | + |
| 39 | +Linting and running unit tests is done via [pre-commit](https://pre-commit.com/), and so is performed automatically on commit. The continuous integration also runs these checks. Manual options are available so you don't have to commit: |
| 40 | + |
| 41 | +```bash |
22 | 42 | # run all hooks on all files, mirrors what the CI runs |
23 | 43 | pre-commit run --all-files |
24 | | -# run unit tests only. can also be used for other hooks, e.g. black, flake8, pylint-local |
| 44 | +# run unit tests only. can also be used for other hooks, e.g. black, isort, pytest-local |
25 | 45 | pre-commit run pytest-local |
26 | 46 | ``` |
27 | 47 |
|
28 | 48 | Getting started |
29 | 49 | --------------- |
30 | 50 |
|
31 | | -This plugin create a sample golang project and requires golang 1.8 or above and [godep](https://golang.github.io/dep/docs/introduction.html). For more information on installing and setting up your Go environment, please visit the offial [Golang site](https://golang.org/). |
| 51 | +This plugin create a sample Go project and requires golang 1.8 or above and [godep](https://golang.github.io/dep/docs/introduction.html). For more information on installing and setting up your Go environment, please visit the official [Golang site](https://golang.org/). |
32 | 52 |
|
33 | 53 |
|
34 | 54 | License |
|
0 commit comments