-
Notifications
You must be signed in to change notification settings - Fork 5
Add a new action
Iván Corrales Solera edited this page Feb 18, 2021
·
1 revision
- Create a new folder for the action
mkdir actions/<action>- Let's create the files in the folder:
action.goanddecoder.go
action.go It contains the definition for our action. This struct must implement interface Action.
type MyAction struct {
*actions.Base
name string
index hcl.Expression
value hcl.Expression
}decoder.go It must contain an implementation of the interface Decoder.
- Add a new entry for our Decoder in decoders
- Add a new entry for the new action here
-
Modify action
blockto support the new action.
action {
attribute1 =""
attribute2 =""
block {
}
}In case of we need to create an action that is composed of attributes but also by subblocks, we will need to define new structs. To do this, we can have a look at the implementation of action HTTP that make uses of the internal directory.