fortinet / alicloud-aa-egress-route-failover Goto Github PK
View Code? Open in Web Editor NEWAA Egress route failover for AliCloud
AA Egress route failover for AliCloud
`
Treid to deploy A-A on default region us-east-1 . failed on resource create
resource "alicloud_fc_function" "fortigate-AA-Failover
shell@Alicloud:~/fortigate-ha$ terraform apply -var instance=ecs.c5 -var split_egress_traffic=true -var region=us-east-1
data.alicloud_images.ecs_image: Refreshing state...
data.alicloud_account.current: Refreshing state...
data.alicloud_regions.current_region_ds: Refreshing state...
data.alicloud_instance_types.types_ds: Refreshing state...
data.alicloud_zones.default: Refreshing state...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
<= data "template_file" "setupPrimary" {
+ id = (known after apply)
+ rendered = (known after apply)
+ template = "config system global\n set hostname "PrimaryFortiGate"\n set admin-sport 8443\nend\nconfig system interface\n edit "port1"\n set vdom "root"\n set mode dhcp\n set allowaccess ping https ssh fgfm\n set type physical\n set snmp-index 1\n next\n edit "port2"\n set vdom "root"\n set mode dhcp\n set defaultgw enable\n set allowaccess ping https ssh fgfm\n set type physical\n next\nend\nconfig firewall address\n edit "EgressProtected"\n set subnet 172.16.0.0 255.255.0.0\n next\nend\nconfig firewall policy\n edit 1\n set name "Egress"\n set srcintf "port1"\n set dstintf "port1"\n set srcaddr "EgressProtected"\n set dstaddr "all"\n set action accept\n set schedule "always"\n set service "ALL"\n set fsso disable\n set nat enable\n next\nend\nconfig system link-monitor\n edit "fgt-monitor"\n set srcintf "port1"\n set server "172.16.8.100"\n set update-cascade-interface disable\n set update-static-route disable\n next\nend\nconfig system automation-action\n edit "LinkStatus"\n set action-type alicloud-function\n set alicloud-account-id "${account_id}"\n set alicloud-region ${region}\n set alicloud-version "2016-08-15"\n set alicloud-service "${function_service}"\n set alicloud-function "${function_id}"\n next\nend\nconfig system automation-trigger\n edit "aliLinkStatus"\n set event-type event-log\n set logid 22922\n next\n end\nconfig system automation-stitch\n edit "aliLinkStatus"\n set trigger "aliLinkStatus"\n set action "LinkStatus"\n next\nend\n"
+ vars = {
+ "account_id" = "!!!removed"
+ "function_id" = (known after apply)
+ "function_service" = (known after apply)
+ "region" = "us-east-1"
}
}
<= data "template_file" "setupSecondary" {
+ id = (known after apply)
+ rendered = (known after apply)
+ template = "\nconfig system global\n set hostname "SecondaryFortigate"\n set admin-sport 8443\nend\nconfig system interface\n edit "port1"\n set vdom "root"\n set mode dhcp\n set allowaccess ping https ssh fgfm\n set type physical\n set snmp-index 1\n next\n edit "port2"\n set vdom "root"\n set mode dhcp\n set defaultgw enable\n set allowaccess ping https ssh fgfm\n set type physical\n next\nend\nconfig firewall address\n edit "EgressProtected"\n set subnet 172.16.0.0 255.255.0.0\n next\nend\nconfig firewall policy\n edit 1\n set name "Egress"\n set srcintf "port1"\n set dstintf "port1"\n set srcaddr "EgressProtected"\n set dstaddr "all"\n set action accept\n set schedule "always"\n set service "ALL"\n set fsso disable\n set nat enable\n next\nend\nconfig system link-monitor\n edit "fgt-monitor"\n set srcintf "port1"\n set server "172.16.0.100"\n set update-cascade-interface disable\n set update-static-route disable\n next\nend\nconfig system automation-action\n edit "LinkStatus"\n set action-type alicloud-function\n set alicloud-account-id "${account_id}"\n set alicloud-region ${region}\n set alicloud-version "2016-08-15"\n set alicloud-service "${function_service}"\n set alicloud-function "${function_id}"\n next\nend\nconfig system automation-trigger\n edit "aliLinkStatus"\n set event-type event-log\n set logid 22922\n next\n end\nconfig system automation-stitch\n edit "aliLinkStatus"\n set trigger "aliLinkStatus"\n set action "LinkStatus"\n next\nend"
+ vars = {
+ "account_id" = "!!!removed"
+ "function_id" = (known after apply)
+ "function_service" = (known after apply)
+ "region" = "us-east-1"
}
}
description = "Created by terraform"
id = (known after apply)
internet_access = true
last_modified = (known after apply)
name = (known after apply)
role = (known after apply)
service_id = (known after apply)
log_config {
vpc_config {
availability_zone = "us-east-1a"
credit_specification = (known after apply)
deletion_protection = false
dry_run = false
host_name = (known after apply)
id = (known after apply)
image_id = "m-0xif6xxwhjlqhoaqjrr6"
instance_charge_type = "PostPaid"
instance_name = (known after apply)
instance_type = "ecs.c5.large"
internet_charge_type = "PayByTraffic"
internet_max_bandwidth_in = 200
internet_max_bandwidth_out = 100
key_name = (known after apply)
private_ip = "172.16.0.100"
public_ip = (known after apply)
role_name = (known after apply)
security_groups = (known after apply)
spot_strategy = "NoSpot"
status = (known after apply)
subnet_id = (known after apply)
system_disk_category = "cloud_efficiency"
system_disk_size = 40
user_data = (known after apply)
volume_tags = (known after apply)
vswitch_id = (known after apply)
data_disks {
availability_zone = "us-east-1b"
credit_specification = (known after apply)
deletion_protection = false
dry_run = false
host_name = (known after apply)
id = (known after apply)
image_id = "m-0xif6xxwhjlqhoaqjrr6"
instance_charge_type = "PostPaid"
instance_name = (known after apply)
instance_type = "ecs.c5.large"
internet_charge_type = "PayByTraffic"
internet_max_bandwidth_in = 200
internet_max_bandwidth_out = 100
key_name = (known after apply)
private_ip = "172.16.8.100"
public_ip = (known after apply)
role_name = (known after apply)
security_groups = (known after apply)
spot_strategy = "NoSpot"
status = (known after apply)
subnet_id = (known after apply)
system_disk_category = "cloud_efficiency"
system_disk_size = 40
user_data = (known after apply)
volume_tags = (known after apply)
vswitch_id = (known after apply)
data_disks {
id = (known after apply)
logstore = (known after apply)
project = (known after apply)
field_search {
full_text {
attachment_count = (known after apply)
description = "FortiGate aafailover Logging Policy"
document = (known after apply)
force = true
id = (known after apply)
name = (known after apply)
type = (known after apply)
version = "1"
statement {
attachment_count = (known after apply)
description = "FortiGate aafailover VPC Policy - Used to bind vpc to function compute during automated deploy"
document = jsonencode(
{
+ Statement = [
+ {
+ Action = [
+ "vpc:DescribeVSwitchAttributes",
]
+ Effect = "Allow"
+ Resource = ""
},
+ {
+ Action = [
+ "ecs:CreateNetworkInterface",
+ "ecs:DeleteNetworkInterface",
+ "ecs:DescribeNetworkInterfaces",
+ "ecs:CreateNetworkInterfacePermission",
+ "ecs:DescribeNetworkInterfacePermissions",
+ "ecs:DeleteNetworkInterfacePermission",
]
+ Effect = "Allow"
+ Resource = ""
},
]
+ Version = "1"
}
)
force = true
id = (known after apply)
name = (known after apply)
type = (known after apply)
version = "1"
statement {
Plan: 40 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
random_string.random_name_post: Creating...
random_string.psk: Creating...
random_string.random_name_post: Creation complete after 0s [id=jvb]
random_string.psk: Creation complete after 0s [id=?fppWD{oY78!=1P3]
alicloud_ram_role.ram_role: Creating...
alicloud_ram_policy.policy_vpc: Creating...
alicloud_log_project.aafailoverLogging: Creating...
alicloud_vpc.vpc: Creating...
data.template_file.setupPrimary: Refreshing state...
data.template_file.setupSecondary: Refreshing state...
alicloud_ram_role.ram_role: Creation complete after 0s [id=FortiGateAAFailover-FunctionCompute-Role-jvb]
alicloud_log_project.aafailoverLogging: Creation complete after 9s [id=fortigate-aafailover-log-jvb]
alicloud_log_store.aafailoverLogging-Store: Creating...
alicloud_ram_policy.policy_vpc: Creation complete after 9s [id=FortiGateAAFailover-function-vpc-policy-jvb]
alicloud_ram_role_policy_attachment.attach_vpc: Creating...
alicloud_vpc.vpc: Still creating... [10s elapsed]
alicloud_ram_role_policy_attachment.attach_vpc: Creation complete after 9s [id=role:FortiGateAAFailover-function-vpc-policy-jvb:Custom:FortiGateAAFailover-FunctionCompute-Role-jvb]
alicloud_log_store.aafailoverLogging-Store: Still creating... [10s elapsed]
alicloud_vpc.vpc: Creation complete after 19s [id=vpc-0xi53y556bifmyu0relbq]
alicloud_route_table.custom_route_tables[0]: Creating...
alicloud_security_group.SecGroup_FC: Creating...
alicloud_vswitch.vsw2: Creating...
alicloud_route_table.custom_route_tables[1]: Creating...
alicloud_security_group.SecGroup: Creating...
alicloud_vswitch.vsw_internal_A: Creating...
alicloud_vswitch.vsw: Creating...
alicloud_vswitch.vsw_internal_B: Creating...
alicloud_log_store.aafailoverLogging-Store: Creation complete after 10s [id=fortigate-aafailover-log-jvb:aa-failoverlog-store-jvb]
alicloud_log_store_index.log_store_index: Creating...
alicloud_ram_policy.policy: Creating...
alicloud_route_table.custom_route_tables[0]: Still creating... [10s elapsed]
alicloud_security_group.SecGroup_FC: Still creating... [10s elapsed]
alicloud_vswitch.vsw2: Still creating... [10s elapsed]
alicloud_route_table.custom_route_tables[1]: Still creating... [10s elapsed]
alicloud_security_group.SecGroup: Still creating... [10s elapsed]
alicloud_vswitch.vsw_internal_A: Still creating... [10s elapsed]
alicloud_vswitch.vsw: Still creating... [10s elapsed]
alicloud_vswitch.vsw_internal_B: Still creating... [10s elapsed]
alicloud_log_store_index.log_store_index: Still creating... [10s elapsed]
alicloud_ram_policy.policy: Still creating... [10s elapsed]
alicloud_route_table.custom_route_tables[1]: Creation complete after 11s [id=vtb-0xi7clg793zmhhahhg14t]
alicloud_route_table.custom_route_tables[0]: Creation complete after 13s [id=vtb-0xijy64smrf60sj604ubp]
alicloud_ram_policy.policy: Creation complete after 13s [id=FortiGateAAFailover-Logging-Policy-jvb]
alicloud_ram_role_policy_attachment.attach: Creating...
alicloud_security_group.SecGroup_FC: Creation complete after 13s [id=sg-0xi8gn2ubhqlhoo12jde]
alicloud_security_group_rule.allow_b_class_ingress: Creating...
alicloud_security_group_rule.allow_c_class_ingress: Creating...
alicloud_security_group_rule.allow_a_class_ingress: Creating...
alicloud_security_group.SecGroup: Creation complete after 13s [id=sg-0xie0fhnb46g4n5zowfy]
alicloud_security_group_rule.allow_all_tcp_egress_FC: Creating...
alicloud_vswitch.vsw: Creation complete after 14s [id=vsw-0xio6txf0ywzucq4d2472]
alicloud_security_group_rule.allow_all_tcp_egress: Creating...
alicloud_log_store_index.log_store_index: Creation complete after 19s [id=fortigate-aafailover-log-jvb:aa-failoverlog-store-jvb]
alicloud_security_group_rule.allow_all_tcp_ingress: Creating...
alicloud_vswitch.vsw_internal_B: Creation complete after 19s [id=vsw-0xinta29ynfncxl1go38w]
alicloud_network_interface.SecondaryFortigateInterface: Creating...
alicloud_vswitch.vsw2: Creation complete after 19s [id=vsw-0xifrwrz3yb8qgw3y5oub]
alicloud_fc_service.fortigate-failover-service: Creating...
alicloud_vswitch.vsw_internal_A: Creation complete after 19s [id=vsw-0xiw0o9zf44758gucy8uf]
alicloud_network_interface.PrimaryFortiGateInterface: Creating...
alicloud_ram_role_policy_attachment.attach: Creation complete after 10s [id=role:FortiGateAAFailover-Logging-Policy-jvb:Custom:FortiGateAAFailover-FunctionCompute-Role-jvb]
alicloud_route_table_attachment.custom_route_table_attachment_private[0]: Creating...
alicloud_security_group_rule.allow_b_class_ingress: Still creating... [10s elapsed]
alicloud_security_group_rule.allow_c_class_ingress: Still creating... [10s elapsed]
alicloud_security_group_rule.allow_a_class_ingress: Still creating... [10s elapsed]
alicloud_security_group_rule.allow_all_tcp_egress_FC: Still creating... [10s elapsed]
alicloud_security_group_rule.allow_all_tcp_egress: Still creating... [10s elapsed]
alicloud_security_group_rule.allow_all_tcp_ingress: Still creating... [10s elapsed]
alicloud_network_interface.SecondaryFortigateInterface: Still creating... [10s elapsed]
alicloud_fc_service.fortigate-failover-service: Still creating... [10s elapsed]
alicloud_network_interface.PrimaryFortiGateInterface: Still creating... [10s elapsed]
alicloud_security_group_rule.allow_a_class_ingress: Creation complete after 20s [id=sg-0xi8gn2ubhqlhoo12jde:ingress:tcp:1/65535:intranet:10.10.0.0/8:accept:1]
alicloud_route_table_attachment.custom_route_table_attachment_private[1]: Creating...
alicloud_security_group_rule.allow_c_class_ingress: Creation complete after 20s [id=sg-0xi8gn2ubhqlhoo12jde:ingress:tcp:1/65535:intranet:192.168.0.0/16:accept:1]
alicloud_security_group_rule.allow_b_class_ingress: Creation complete after 20s [id=sg-0xi8gn2ubhqlhoo12jde:ingress:tcp:1/65535:intranet:172.16.0.0/12:accept:1]
alicloud_security_group_rule.allow_all_tcp_egress_FC: Creation complete after 20s [id=sg-0xi8gn2ubhqlhoo12jde:egress:tcp:1/65535:intranet:0.0.0.0/0:accept:1]
alicloud_security_group_rule.allow_all_tcp_egress: Creation complete after 19s [id=sg-0xie0fhnb46g4n5zowfy:egress:tcp:1/65535:intranet:0.0.0.0/0:accept:1]
alicloud_route_table_attachment.custom_route_table_attachment_private[0]: Still creating... [10s elapsed]
alicloud_security_group_rule.allow_all_tcp_ingress: Creation complete after 15s [id=sg-0xie0fhnb46g4n5zowfy:ingress:tcp:1/65535:intranet:0.0.0.0/0:accept:1]
alicloud_network_interface.SecondaryFortigateInterface: Creation complete after 16s [id=eni-0xibii13xfxshx6tu4nz]
alicloud_instance.SecondaryFortigate: Creating...
alicloud_fc_service.fortigate-failover-service: Still creating... [20s elapsed]
alicloud_network_interface.PrimaryFortiGateInterface: Still creating... [20s elapsed]
alicloud_route_table_attachment.custom_route_table_attachment_private[1]: Still creating... [10s elapsed]
alicloud_route_table_attachment.custom_route_table_attachment_private[0]: Still creating... [20s elapsed]
alicloud_instance.SecondaryFortigate: Still creating... [10s elapsed]
alicloud_network_interface.PrimaryFortiGateInterface: Creation complete after 28s [id=eni-0xib0h4jnr2zo7dcq4k2]
alicloud_instance.PrimaryFortigate: Creating...
alicloud_route_entry.custom_route_table_egress[1]: Creating...
alicloud_route_entry.custom_route_table_egress[0]: Creating...
alicloud_fc_service.fortigate-failover-service: Creation complete after 29s [id=FortiGateAAFailover-jvb]
alicloud_route_table_attachment.custom_route_table_attachment_private[0]: Creation complete after 25s [id=vtb-0xijy64smrf60sj604ubp:vsw-0xiw0o9zf44758gucy8uf]
alicloud_route_table_attachment.custom_route_table_attachment_private[1]: Creation complete after 17s [id=vtb-0xi7clg793zmhhahhg14t:vsw-0xinta29ynfncxl1go38w]
alicloud_instance.SecondaryFortigate: Still creating... [20s elapsed]
alicloud_instance.PrimaryFortigate: Still creating... [10s elapsed]
alicloud_route_entry.custom_route_table_egress[1]: Still creating... [10s elapsed]
alicloud_route_entry.custom_route_table_egress[0]: Still creating... [10s elapsed]
alicloud_route_entry.custom_route_table_egress[0]: Creation complete after 16s [id=vtb-0xijy64smrf60sj604ubp:vrt-0ximhbn4muf0ofi2k8fw7:0.0.0.0/0:NetworkInterface:eni-0xib0h4jnr2zo7dcq4k2]
alicloud_route_entry.custom_route_table_egress[1]: Creation complete after 16s [id=vtb-0xi7clg793zmhhahhg14t:vrt-0ximhbn4muf0ofi2k8fw7:0.0.0.0/0:NetworkInterface:eni-0xibii13xfxshx6tu4nz]
alicloud_instance.SecondaryFortigate: Still creating... [30s elapsed]
alicloud_instance.PrimaryFortigate: Still creating... [20s elapsed]
alicloud_instance.SecondaryFortigate: Still creating... [40s elapsed]
alicloud_instance.PrimaryFortigate: Still creating... [30s elapsed]
alicloud_instance.SecondaryFortigate: Still creating... [50s elapsed]
alicloud_instance.PrimaryFortigate: Still creating... [40s elapsed]
alicloud_instance.SecondaryFortigate: Still creating... [1m0s elapsed]
alicloud_instance.PrimaryFortigate: Creation complete after 48s [id=i-0xie0fhnb46g4n64usae]
alicloud_network_interface_attachment.PrimaryFortigateattachment: Creating...
alicloud_network_interface_attachment.PrimaryFortigateattachment: Creation complete after 6s [id=eni-0xib0h4jnr2zo7dcq4k2:i-0xie0fhnb46g4n64usae]
alicloud_instance.SecondaryFortigate: Creation complete after 1m7s [id=i-0xig97usfwprwl27xxce]
alicloud_fc_function.fortigate-AA-Failover: Creating...
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Creating...
alicloud_fc_function.fortigate-AA-Failover: Still creating... [10s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [10s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [20s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [20s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [30s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [30s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [40s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [40s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [50s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [50s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [1m0s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [1m0s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [1m10s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [1m10s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [1m20s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [1m20s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [1m30s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [1m30s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [1m40s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [1m40s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [1m50s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [1m50s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [2m0s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [2m0s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [2m10s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [2m10s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [2m20s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [2m20s elapsed]
alicloud_fc_function.fortigate-AA-Failover: Still creating... [2m30s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Still creating... [2m30s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Creation complete after 2m34s [id=eni-0xibii13xfxshx6tu4nz:i-0xig97usfwprwl27xxce]
Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_fc_function.go:173: Resource alicloud_fc_function CreateFunction Failed!!! [SDK fc-go-sdk ERROR]:
timeout while waiting for state to become 'success' (timeout: 2m0s)
on main.tf line 304, in resource "alicloud_fc_function" "fortigate-AA-Failover":
304: resource "alicloud_fc_function" "fortigate-AA-Failover" {
shell@Alicloud:~/fortigate-ha$
`
I am only using RAM account with ECS,VPC,LOG,FC privilege and created access-key/id to deploy terraform file. however, I met "403 The service or function does not belong to you" error messages.
the aliyun document said, to use FC, you have to use you aliyuncloud ID instead of a RAM account.
how can I workaround this issue if I only have RAM account ?
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Creating...
alicloud_fc_service.fortigate-failover-service: Still creating... [1m0s elapsed]
alicloud_instance.PrimaryFortigate: Still creating... [1m0s elapsed]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Creation complete after 5s [id=eni-0xi6dtet037kz3yvrh02:i-0xib0h4jnr2y1o4a3p2m]
alicloud_instance.PrimaryFortigate: Creation complete after 1m2s [id=i-0xicxeoha1g2ai0w816g]
alicloud_network_interface_attachment.PrimaryFortigateattachment: Creating...
alicloud_network_interface_attachment.PrimaryFortigateattachment: Creation complete after 4s [id=eni-0xi6lt03725e73n60j1t:i-0xicxeoha1g2ai0w816g]
alicloud_fc_service.fortigate-failover-service: Still creating... [1m10s elapsed]
alicloud_fc_service.fortigate-failover-service: Still creating... [1m20s elapsed]
alicloud_fc_service.fortigate-failover-service: Still creating... [1m30s elapsed]
alicloud_fc_service.fortigate-failover-service: Still creating... [1m40s elapsed]
alicloud_fc_service.fortigate-failover-service: Still creating... [1m50s elapsed]
alicloud_fc_service.fortigate-failover-service: Still creating... [2m0s elapsed]
Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_fc_service.go:157: Resource alicloud_fc_service CreateService Failed!!! [SDK fc-go-sdk ERROR]:
{
"HttpStatus": 403,
"RequestId": "b578f28b-0594-4187-8758-2fb2f418ca25",
"ErrorCode": "AccessDenied",
"ErrorMessage": "The service or function doesn't belong to you."
Hi Sir
wo have three questions about this architecture
1、how to enforce symmetric return ? enable snat ?
2、i deploy this architecture have to use Terraform script ? may i setup two the standalone firewalls and manual set up HA?
3、how to sync the configuration and session between the both firewalls ?
Customer hope if we can prepackage callHealthCheck.zip and failoverAAindex.zip, customer want to run the terraform and they need to run package.json first, but we havn't document for it now.
I am trying to deploy Fortigate AA in regon hongkong. It end with up an error messages
p.s in the vars.tf file . I modified instance_ami to the corresponding region.
variable "instance_ami" {
type = string
#default = "m-0xif6xxwhjlqhoaqjrr6"
default = "m-j6c1vzhmpllrt703ln0b"
"ErrorMessage": "VSwitch 'vsw-j6ch6iui7d25x1hvw4x0r' is in unsupported zone 'cn-hongkong-b' (allowed zones: cn-hongkong-c)"
I checked cn-hongkong-b zone. It do have this switch. But not know why Errormessages say it is unsupported zone.
shell@Alicloud:/fortigate-ha$ aliyun vpc DescribeVSwitches | jq '.VSwitches.VSwitch[] | "(.VSwitchId) (.ZoneId)"' | grep vsw-j6ch6iui7d25x1hvw4x0r/fortigate-ha$
"vsw-j6ch6iui7d25x1hvw4x0r cn-hongkong-b"
shell@Alicloud:
see full log below.
shell@Alicloud:~/fortigate-ha$ terraform apply
random_string.psk: Refreshing state... [id=9@0[1!$h{3S2dB[u]
random_string.random_name_post: Refreshing state... [id=gui]
alicloud_ram_policy.policy_vpc: Refreshing state... [id=FortiGateAAFailover-function-vpc-policy-gui]
data.alicloud_account.current: Refreshing state...
data.alicloud_regions.current_region_ds: Refreshing state...
alicloud_vpc.vpc: Refreshing state... [id=vpc-j6c1i27qprokf9el9n24e]
alicloud_ram_role.ram_role: Refreshing state... [id=FortiGateAAFailover-FunctionCompute-Role-gui]
alicloud_log_project.aafailoverLogging: Refreshing state... [id=fortigate-aafailover-log-gui]
data.alicloud_images.ecs_image: Refreshing state...
data.alicloud_instance_types.types_ds: Refreshing state...
data.alicloud_zones.default: Refreshing state...
data.template_file.setupPrimary: Refreshing state...
data.template_file.setupSecondary: Refreshing state...
alicloud_ram_role_policy_attachment.attach_vpc: Refreshing state... [id=role:FortiGateAAFailover-function-vpc-policy-gui:Custom:FortiGateAAFailover-FunctionCompute-Role-gui]
alicloud_log_store.aafailoverLogging-Store: Refreshing state... [id=fortigate-aafailover-log-gui:aa-failoverlog-store-gui]
alicloud_route_table.custom_route_tables[0]: Refreshing state... [id=vtb-j6cdqjgud8u7i28qes48n]
alicloud_route_table.custom_route_tables[1]: Refreshing state... [id=vtb-j6ck9zivjqtg7y18v8jz2]
alicloud_security_group.SecGroup_FC: Refreshing state... [id=sg-j6ce1ke70d9i54bifnip]
alicloud_vswitch.vsw2: Refreshing state... [id=vsw-j6csgegw97i68hb2kmvi3]
alicloud_vswitch.vsw: Refreshing state... [id=vsw-j6ch6iui7d25x1hvw4x0r]
alicloud_vswitch.vsw_internal_A: Refreshing state... [id=vsw-j6ct7r8vbaorgqp43ylm2]
alicloud_vswitch.vsw_internal_B: Refreshing state... [id=vsw-j6cvh4pxiil3ui56ouirc]
alicloud_security_group.SecGroup: Refreshing state... [id=sg-j6c5ew3n85euf1pdbtoz]
alicloud_log_store_index.log_store_index: Refreshing state... [id=fortigate-aafailover-log-gui:aa-failoverlog-store-gui]
alicloud_ram_policy.policy: Refreshing state... [id=FortiGateAAFailover-Logging-Policy-gui]
alicloud_security_group_rule.allow_all_tcp_egress: Refreshing state... [id=sg-j6c5ew3n85euf1pdbtoz:egress:tcp:1/65535:intranet:0.0.0.0/0:accept:1]
alicloud_security_group_rule.allow_all_tcp_ingress: Refreshing state... [id=sg-j6c5ew3n85euf1pdbtoz:ingress:tcp:1/65535:intranet:0.0.0.0/0:accept:1]
alicloud_security_group_rule.allow_c_class_ingress: Refreshing state... [id=sg-j6ce1ke70d9i54bifnip:ingress:tcp:1/65535:intranet:192.168.0.0/16:accept:1]
alicloud_security_group_rule.allow_a_class_ingress: Refreshing state... [id=sg-j6ce1ke70d9i54bifnip:ingress:tcp:1/65535:intranet:10.10.0.0/8:accept:1]
alicloud_security_group_rule.allow_b_class_ingress: Refreshing state... [id=sg-j6ce1ke70d9i54bifnip:ingress:tcp:1/65535:intranet:172.16.0.0/12:accept:1]
alicloud_security_group_rule.allow_all_tcp_egress_FC: Refreshing state... [id=sg-j6ce1ke70d9i54bifnip:egress:tcp:1/65535:intranet:0.0.0.0/0:accept:1]
alicloud_network_interface.PrimaryFortiGateInterface: Refreshing state... [id=eni-j6cfd1qug0hxgdtpeanc]
alicloud_network_interface.SecondaryFortigateInterface: Refreshing state... [id=eni-j6cecly8r9a9r9hrjyzf]
alicloud_route_table_attachment.custom_route_table_attachment_private[0]: Refreshing state... [id=vtb-j6cdqjgud8u7i28qes48n:vsw-j6ct7r8vbaorgqp43ylm2]
alicloud_route_table_attachment.custom_route_table_attachment_private[1]: Refreshing state... [id=vtb-j6ck9zivjqtg7y18v8jz2:vsw-j6cvh4pxiil3ui56ouirc]
alicloud_ram_role_policy_attachment.attach: Refreshing state... [id=role:FortiGateAAFailover-Logging-Policy-gui:Custom:FortiGateAAFailover-FunctionCompute-Role-gui]
alicloud_route_entry.custom_route_table_egress[0]: Refreshing state... [id=vtb-j6cdqjgud8u7i28qes48n:vrt-j6ccn8bkpx4ngo6u5i54v:0.0.0.0/0:NetworkInterface:eni-j6cfd1qug0hxgdtpeanc]
alicloud_route_entry.custom_route_table_egress[1]: Refreshing state... [id=vtb-j6ck9zivjqtg7y18v8jz2:vrt-j6ccn8bkpx4ngo6u5i54v:0.0.0.0/0:NetworkInterface:eni-j6cecly8r9a9r9hrjyzf]
alicloud_instance.SecondaryFortigate: Refreshing state... [id=i-j6ch4wa069moj2a1f3g5]
alicloud_instance.PrimaryFortigate: Refreshing state... [id=i-j6c6lt03725edmfqrp0d]
alicloud_network_interface_attachment.PrimaryFortigateattachment: Refreshing state... [id=eni-j6cfd1qug0hxgdtpeanc:i-j6c6lt03725edmfqrp0d]
alicloud_network_interface_attachment.SecondaryFortigateAttachment: Refreshing state... [id=eni-j6cecly8r9a9r9hrjyzf:i-j6ch4wa069moj2a1f3g5]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
description = "Created by terraform"
id = (known after apply)
internet_access = true
last_modified = (known after apply)
name = "FortiGateAAFailover-gui"
role = "acs:ram::5498321147060270:role/fortigateaafailover-functioncompute-role-gui"
service_id = (known after apply)
log_config {
vpc_config {
Plan: 5 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
alicloud_fc_service.fortigate-failover-service: Creating...
Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_fc_service.go:157: Resource alicloud_fc_service CreateService Failed!!! [SDK fc-go-sdk ERROR]:
{
"HttpStatus": 400,
"RequestId": "e8aa362d-57e4-4e54-9738-ed588e8a321b",
"ErrorCode": "InvalidArgument",
"ErrorMessage": "VSwitch 'vsw-j6ch6iui7d25x1hvw4x0r' is in unsupported zone 'cn-hongkong-b' (allowed zones: cn-hongkong-c)"
}
on main.tf line 283, in resource "alicloud_fc_service" "fortigate-failover-service":
283: resource "alicloud_fc_service" "fortigate-failover-service" {
shell@Alicloud:/fortigate-ha$ aliyun vpc DescribeVSwitches | jq '.VSwitches.VSwitch[] | "(.VSwitchId) (.ZoneId)"' | grep vsw-j6ch6iui7d25x1hvw4x0r/fortigate-ha$
"vsw-j6ch6iui7d25x1hvw4x0r cn-hongkong-b"
shell@Alicloud:
Comment has tpyos
Originally posted by @jamie-pate in 37e015d
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.