Skip to content

Commit

Permalink
Merge pull request #1718 from Shopify/cloudflare-logpush-job-kind
Browse files Browse the repository at this point in the history
support for cloudflare_logpush_job kind attribute
  • Loading branch information
jacobbednarz committed Jun 28, 2022
2 parents 37b83ad + 52fc7d4 commit de0ffb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/1718.txt
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/cloudflare_logpush_job: adds support for `kind` attribute
```
2 changes: 2 additions & 0 deletions internal/provider/resource_cloudflare_logpush_job.go
Expand Up @@ -63,6 +63,7 @@ func getJobFromResource(d *schema.ResourceData) (cloudflare.LogpushJob, *AccessI
job := cloudflare.LogpushJob{
ID: id,
Enabled: d.Get("enabled").(bool),
Kind: d.Get("kind").(string),
Name: d.Get("name").(string),
Dataset: d.Get("dataset").(string),
LogpullOptions: d.Get("logpull_options").(string),
Expand Down Expand Up @@ -130,6 +131,7 @@ func resourceCloudflareLogpushJobRead(ctx context.Context, d *schema.ResourceDat
}

d.Set("name", job.Name)
d.Set("kind", job.Kind)
d.Set("enabled", job.Enabled)
d.Set("logpull_options", job.LogpullOptions)
d.Set("destination_conf", job.DestinationConf)
Expand Down
6 changes: 6 additions & 0 deletions internal/provider/schema_cloudflare_logpush_job.go
Expand Up @@ -27,6 +27,12 @@ func resourceCloudflareLogpushJobSchema() map[string]*schema.Schema {
Optional: true,
Description: "Whether to enable the job.",
},
"kind": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{"edge", "instant-logs", ""}, false),
Description: fmt.Sprintf("The kind of logpush job to create. %s", renderAvailableDocumentationValuesStringSlice([]string{"edge", "instant-logs", ""})),
},
"name": {
Type: schema.TypeString,
Optional: true,
Expand Down

0 comments on commit de0ffb3

Please sign in to comment.