Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ func main() {
Usage: "A description of the function.",
EnvVars: []string{"PLUGIN_DESCRIPTION", "DESCRIPTION", "INPUT_DESCRIPTION"},
},
&cli.StringFlag{
Name: "tracing-mode",
Usage: "The function's X-Ray tracing configuration.",
EnvVars: []string{"PLUGIN_TRACING_MODE", "TRACING_MODE", "INPUT_TRACING_MODE"},
},
}

if err := app.Run(os.Args); err != nil {
Expand Down Expand Up @@ -210,6 +215,7 @@ func run(c *cli.Context) error {
SecurityGroups: c.StringSlice("securitygroups"),
Description: c.String("description"),
SessionToken: c.String("session-token"),
TracingMode: c.String("tracing-mode"),
},
Commit: Commit{
Sha: c.String("commit.sha"),
Expand Down
8 changes: 8 additions & 0 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type (
Description string
Layers []string
SessionToken string
TracingMode string
}

// Commit information.
Expand Down Expand Up @@ -213,6 +214,13 @@ func (p Plugin) Exec() error {
})
}

if p.Config.TracingMode != "" {
isUpdateConfig = true
cfg.SetTracingConfig(&lambda.TracingConfig{
Mode: aws.String(p.Config.TracingMode),
})
}

svc := lambda.New(sess, config)

if isUpdateConfig {
Expand Down