-
Notifications
You must be signed in to change notification settings - Fork 626
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
GATE-2448: Adds support for proxy endpoints #1517
GATE-2448: Adds support for proxy endpoints #1517
Conversation
Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/docs/changelog-process.md. Example:
If you do not require a release note to be included, please add the |
b83b13d
to
70f731a
Compare
CHANGELOG.md
Outdated
@@ -3,6 +3,7 @@ | |||
FEATURES: | |||
|
|||
* **New Resource:** `cloudflare_waiting_room_event` ([#1509](https://github.com/cloudflare/terraform-provider-cloudflare/issues/1509)) | |||
* **New Resource:** `cloudflare_teams_proxy_endpoint` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is automatically generated, check out https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/docs/changelog-process.md to add a changelog entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solid start! to get this over the line we need:
- a CHANGELOG entry; and
- website documentation. check out Adds Website docs for cloudflare_static_route #1113 for a good example.
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr(name, "account_id", accountID), | ||
resource.TestCheckResourceAttr(name, "name", rnd), | ||
resource.TestCheckResourceAttr(name, "ips.0", "1.2.3.4/32"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use IP ranges from RFC5737 for our tests/documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right, I forget every time. Fixed!
Computed: true, | ||
}, | ||
"ips": { | ||
Type: schema.TypeList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you care about order? if not, you probably want TypeSet
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, done
854cb7c
to
ca3fb3a
Compare
ca3fb3a
to
b955125
Compare
updatedProxyEndpoint := cloudflare.TeamsProxyEndpoint{ | ||
ID: d.Id(), | ||
Name: d.Get("name").(string), | ||
IPs: inflateProxyEndpointIPs(d.Get("ips").([]interface{})), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPs: inflateProxyEndpointIPs(d.Get("ips").([]interface{})), | |
IPs: expandInterfaceToStringList(d.Get("ips").([]interface{})), |
func inflateProxyEndpointIPs(ips []interface{}) []string { | ||
i := make([]string, len(ips)) | ||
for x, ip := range ips { | ||
i[x] = ip.(string) | ||
} | ||
return i | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicates expandInterfaceToStringList
func inflateProxyEndpointIPs(ips []interface{}) []string { | |
i := make([]string, len(ips)) | |
for x, ip := range ips { | |
i[x] = ip.(string) | |
} | |
return i | |
} |
acceptance tests are passing
|
thank you @Michael9127 👏 |
No description provided.