Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added optional routing field to regional hostname #4514

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ func resourceCloudflareRegionalHostnameCreate(ctx context.Context, d *schema.Res
d.SetId(r.Hostname)
d.Set("hostname", r.Hostname)
d.Set("region_key", r.RegionKey)
if r.Routing != "" {
d.Set("routing", r.Routing)
}
d.Set("created_on", r.CreatedOn.Format(time.RFC3339Nano))
return nil
}
Expand All @@ -60,6 +63,9 @@ func resourceCloudflareRegionalHostnameRead(ctx context.Context, d *schema.Resou
d.SetId(r.Hostname)
d.Set("hostname", r.Hostname)
d.Set("region_key", r.RegionKey)
if r.Routing != "" {
d.Set("routing", r.Routing)
}
d.Set("created_on", r.CreatedOn.Format(time.RFC3339Nano))
return nil
}
Expand Down Expand Up @@ -88,6 +94,9 @@ func resourceCloudflareRegionalHostnameUpdate(ctx context.Context, d *schema.Res
d.SetId(r.Hostname)
d.Set("hostname", r.Hostname)
d.Set("region_key", r.RegionKey)
if r.Routing != "" {
d.Set("routing", r.Routing)
}
d.Set("created_on", r.CreatedOn.Format(time.RFC3339Nano))
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
Required: true,
Description: "The region key. See [the full region list](https://developers.cloudflare.com/data-localization/regional-services/get-started/).",
},
"routing": {

Check failure on line 25 in internal/sdkv2provider/schema_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

S013: schema should configure one of Computed, Optional, or Required
Type: schema.TypeString,
Required: false,

Check failure on line 27 in internal/sdkv2provider/schema_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

S019: schema should omit Computed, Optional, or Required set to false
Description: "Configure which routing method to use for the regional hostname.",
},
"created_on": {
Type: schema.TypeString,
Computed: true,
Expand Down
Loading