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

chore(CLOUDDEV-1074): Remove and fix examples #180

Merged
merged 2 commits into from
Dec 10, 2024
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
14 changes: 14 additions & 0 deletions docs/resources/cdn_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ provider "edgecenter" {
permanent_api_token = "251$d3361.............1b35f26d8"
}

resource "edgecenter_cdn_origingroup" "origin_group_1" {
name = "origin_group_1"
use_next = true
origin {
source = "example.com"
enabled = true
}
origin {
source = "mirror.example.com"
enabled = true
backup = true
}
consistent_balancing = true
}

resource "edgecenter_cdn_resource" "cdn_example_com" {
cname = "cdn.example.com"
Expand Down
24 changes: 16 additions & 8 deletions docs/resources/lbpool.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,34 @@ provider "edgecenter" {
permanent_api_token = "251$d3361.............1b35f26d8"
}

resource "edgecenter_loadbalancer" "lb" {
resource "edgecenter_loadbalancerv2" "lb" {
project_id = 1
region_id = 1
name = "test1"
name = "test"
flavor = "lb1-1-2"
listener {
name = "test"
protocol = "HTTP"
protocol_port = 80
metadata_map = {
tag1 = "tag1_value"
}
}

resource "edgecenter_lblistener" "listener" {
project_id = 1
region_id = 1
name = "test"
protocol = "TCP"
protocol_port = 36621
allowed_cidrs = ["127.0.0.0/24", "192.168.0.0/24"]
loadbalancer_id = edgecenter_loadbalancerv2.lb.id
}

resource "edgecenter_lbpool" "pl" {
project_id = 1
region_id = 1
name = "test_pool1"
protocol = "HTTP"
lb_algorithm = "LEAST_CONNECTIONS"
loadbalancer_id = edgecenter_loadbalancer.lb.id
listener_id = edgecenter_loadbalancer.lb.listener.0.id
loadbalancer_id = edgecenter_loadbalancerv2.lb.id
listener_id = edgecenter_lblistener.listener.id
health_monitor {
type = "PING"
delay = 60
Expand Down
20 changes: 0 additions & 20 deletions examples/data-sources/edgecenter_laas_hosts/data-source.tf

This file was deleted.

20 changes: 0 additions & 20 deletions examples/data-sources/edgecenter_laas_status/data-source.tf

This file was deleted.

14 changes: 14 additions & 0 deletions examples/resources/edgecenter_cdn_resource/resource.tf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А это что за пример? Просто сам добавил недостающий ресурс? Желательно согласоваться с командой CDN

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Там был пример и в нём была ошибка, линтер подсвечивал красным. Я подправил. То что добавлял, взял из другого примера про edgecenter_cdn_origingroup. Давай, конечно, согласую

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, все ок. Если в resource указать origin_group, то часть манифеста с origin_group обязательно должна быть описана. Иначе apply для такого манифеста не пройдет.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ provider "edgecenter" {
permanent_api_token = "251$d3361.............1b35f26d8"
}

resource "edgecenter_cdn_origingroup" "origin_group_1" {
name = "origin_group_1"
use_next = true
origin {
source = "example.com"
enabled = true
}
origin {
source = "mirror.example.com"
enabled = true
backup = true
}
consistent_balancing = true
}

resource "edgecenter_cdn_resource" "cdn_example_com" {
cname = "cdn.example.com"
Expand Down
2 changes: 0 additions & 2 deletions examples/resources/edgecenter_faas_function/import.sh

This file was deleted.

31 changes: 0 additions & 31 deletions examples/resources/edgecenter_faas_function/resource.tf

This file was deleted.

2 changes: 0 additions & 2 deletions examples/resources/edgecenter_faas_namespace/import.sh

This file was deleted.

14 changes: 0 additions & 14 deletions examples/resources/edgecenter_faas_namespace/resource.tf

This file was deleted.

2 changes: 0 additions & 2 deletions examples/resources/edgecenter_laas_topic/import.sh

This file was deleted.

10 changes: 0 additions & 10 deletions examples/resources/edgecenter_laas_topic/resource.tf

This file was deleted.

24 changes: 16 additions & 8 deletions examples/resources/edgecenter_lbpool/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@ provider "edgecenter" {
permanent_api_token = "251$d3361.............1b35f26d8"
}

resource "edgecenter_loadbalancer" "lb" {
resource "edgecenter_loadbalancerv2" "lb" {
project_id = 1
region_id = 1
name = "test1"
name = "test"
flavor = "lb1-1-2"
listener {
name = "test"
protocol = "HTTP"
protocol_port = 80
metadata_map = {
tag1 = "tag1_value"
}
}

resource "edgecenter_lblistener" "listener" {
project_id = 1
region_id = 1
name = "test"
protocol = "TCP"
protocol_port = 36621
allowed_cidrs = ["127.0.0.0/24", "192.168.0.0/24"]
loadbalancer_id = edgecenter_loadbalancerv2.lb.id
}

resource "edgecenter_lbpool" "pl" {
project_id = 1
region_id = 1
name = "test_pool1"
protocol = "HTTP"
lb_algorithm = "LEAST_CONNECTIONS"
loadbalancer_id = edgecenter_loadbalancer.lb.id
listener_id = edgecenter_loadbalancer.lb.listener.0.id
loadbalancer_id = edgecenter_loadbalancerv2.lb.id
listener_id = edgecenter_lblistener.listener.id
health_monitor {
type = "PING"
delay = 60
Expand Down
9 changes: 0 additions & 9 deletions examples/resources/edgecenter_storage_sftp/resource.tf

This file was deleted.

8 changes: 0 additions & 8 deletions examples/resources/edgecenter_storage_sftp_key/resource.tf

This file was deleted.

Loading