代码拉取完成,页面将自动刷新
同步操作将从 HuaweiCloudDeveloper/huaweicloud-solution-building-high-availability-aigc-applications-with-stable-diffusion 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
{
"terraform": {
"required_providers": [
{
"huaweicloud": {
"source": "huawei.com/provider/huaweicloud",
"version": "1.40.1"
}
}
]
},
"provider": {
"huaweicloud": {
"cloud": "myhuaweicloud.com",
"endpoints": {
"iam": "iam.ap-southeast-3.myhuaweicloud.com",
"dns": "dns.ap-southeast-3.myhuaweicloud.com"
},
"insecure": true,
"region": "ap-southeast-3",
"auth_url": "https://iam.ap-southeast-3.myhuaweicloud.com/v3"
}
},
"variable": {
"vpc_name": {
"default": "high-availability-aigc-applications-demo",
"description": "虚拟私有云名称,该模板使用新建VPC,不允许重名。取值范围:1-54个字符,支持中文、英文字母、数字、_(下划线)、-(中划线)、.(点)。默认high-availability-aigc-applications-demo。",
"type": "string",
"nullable": false
},
"security_group_name": {
"default": "high-availability-aigc-applications-demo",
"description": "安全组名称,该模板新建安全组,安全组规则请参考部署指南进行配置。取值范围:1-64个字符,支持数字、字母、中文、_(下划线)、-(中划线)、.(点)。默认为high-availability-aigc-applications-demo。",
"type": "string",
"nullable": false
},
"ecs_name": {
"default": "high-availability-aigc-applications-demo",
"description": "弹性云服务器名称,不支持重名。命名方式为{ecs_name}-数字,取值范围:1-60个字符,支持中文、英文字母、数字、_(下划线)、-(中划线)、.(点)。默认high-availability-aigc-applications-demo。",
"type": "string",
"nullable": false
},
"image_bucket_name": {
"default": "",
"description": "OBS桶名称,全局唯一,用于自动上传WebUI生成的图片。取值范围:3-63个字符,支持小写字母、数字、中划线(-)、英文句号(.),禁止以中划线(-)或英文句号(.)开头及结尾。",
"type": "string",
"nullable": "false",
"validation": {
"condition": "${length(regexall(\"^[a-z0-9][a-z0-9-\\\\.]{1,61}[a-z0-9]$\",var.image_bucket_name))>0}",
"error_message": "Invalid input. Please re-enter."
}
},
"ecs_count": {
"default": 2,
"description": "弹性云服务器数量,取值范围:大于等于1,上限由用户配额决定,具体请参考部署指南。默认2。",
"type": "number",
"nullable": false,
"validation": {
"condition": "${length(regexall(\"^[1-9]\\\\d*$\",var.ecs_count))>0}",
"error_message": "Invalid input. Please re-enter."
}
},
"ecs_flavor": {
"default": "pi2.2xlarge.4",
"description": "弹性云服务器规格,需选取GPU加速型,规格请参考部署指南。默认为pi2.2xlarge.4(8vCPUs|32GiB|T4-16GiB)。",
"type": "string",
"nullable": false,
"validation": {
"condition": "${length(regexall(\"^([a-z][a-z0-9]{1,3}\\\\.)(([1-9][0-9]{0,1}x)large\\\\.)[1-9][0-9]{0,1}$\",var.ecs_flavor))>0}",
"error_message": "Invalid input. Please re-enter."
}
},
"ecs_password": {
"default": "",
"description": "弹性云服务器初始化密码,创建完成后,请参考部署指南及时重置密码。取值范围:长度为8-26个字符,密码至少包含大写字母、小写字母、数字和特殊字符(!@$%^-_=+[{()}]:,./?~#*)中的三种,Windows系统密码不能包含用户名或用户名的逆序,不能包含用户名中超过两个连续字符的部分。管理员账户默认root。",
"type": "string",
"nullable": false,
"sensitive": true
},
"elb_name": {
"default": "high-availability-aigc-applications-demo",
"description": "弹性负载均衡器ELB名称,取值范围:1-64个字符组成,支持中文、英文字母、数字、_(下划线)、-(中划线)、.(英文句号)。默认high-availability-aigc-applications-demo。",
"type": "string",
"nullable": "false"
},
"eip_bandwidth_size": {
"default": 300,
"description": "弹性公网带宽大小,该模板计费方式为按流量计费。取值范围:1-300Mbit/s。默认300Mbit/s。",
"type": "number",
"nullable": false,
"validation": {
"condition": "${length(regexall(\"^([1-9][0-9]{0,1}|[1-2][0-9]{2}|300)$\",var.eip_bandwidth_size))>0}",
"error_message": "Invalid input. Please re-enter."
}
},
"charging_mode": {
"default": "postPaid",
"description": "弹性云服务器ECS计费模式,默认自动扣费,可选值为:postPaid(按需计费)、prePaid(包年包月)。默认postPaid。",
"type": "string",
"nullable": false,
"validation": {
"condition": "${contains([\"postPaid\",\"prePaid\"], var.charging_mode)}",
"error_message": "Invalid input, please re-enter."
}
},
"charging_unit": {
"default": "month",
"description": "弹性云服务器ECS订购周期类型,仅当charging_mode为prePaid(包年/包月)生效,此时该参数为必填参数。取值范围:month(月),year(年)。默认month。",
"type": "string",
"nullable": false,
"validation": {
"condition": "${contains([\"month\",\"year\"], var.charging_unit)}",
"error_message": "Invalid input, please re-enter."
}
},
"charging_period": {
"default": 1,
"description": "弹性云服务器ECS订购周期,仅当charging_mode为prePaid(包年/包月)生效,此时该参数为必填参数。取值范围:charging_unit=month(周期类型为月)时,取值为1-9;charging_unit=year(周期类型为年)时,取值为1-3。默认订购1月。",
"type": "number",
"nullable": false,
"validation": {
"condition": "${length(regexall(\"^[1-9]$\",var.charging_period))>0}",
"error_message": "Invalid input, please re-enter."
}
},
"access_key_id": {
"default": "",
"description": "访问密钥ID(AK),识别访问用户的身份,取值范围:20,仅支持大写字母和数字,用于将生成的图像上传至OBS桶。请参考部署指南获取。",
"type": "string",
"nullable": false,
"sensitive": true,
"validation": {
"condition": "${length(regexall(\"^[A-Z0-9]{20}$\",var.access_key_id))>0}",
"error_message": "Invalid input, please re-enter."
}
},
"secret_access_key": {
"default": "",
"description": "秘密访问密钥(SK),对请求数据进行签名验证,取值范围:40,仅支持大小写字母和数字,用于将生成的图像上传至OBS桶。请参考部署指南获取。",
"type": "string",
"nullable": false,
"sensitive": true,
"validation": {
"condition": "${length(regexall(\"^[A-Za-z0-9]{40}$\",var.secret_access_key))>0}",
"error_message": "Invalid input, please re-enter."
}
}
},
"data": {
"huaweicloud_images_image": {
"ubuntu": {
"most_recent": true,
"name": "Ubuntu 20.04 server 64bit with Tesla Driver 460.73.01 and CUDA 11.2",
"visibility": "public"
}
}
},
"locals": {
"az": [
"ap-southeast-3a",
"ap-southeast-3b"
]
},
"resource": {
"huaweicloud_vpc": {
"vpc": {
"name": "${var.vpc_name}",
"cidr": "172.16.0.0/16"
}
},
"huaweicloud_vpc_subnet": {
"subnet": {
"depends_on": [
"local.az"
],
"availability_zone": "${local.az[0]}",
"name": "${var.vpc_name}-subnet",
"cidr": "172.16.1.0/24",
"gateway_ip": "172.16.1.1",
"vpc_id": "${huaweicloud_vpc.vpc.id}"
}
},
"huaweicloud_networking_secgroup": {
"secgroup": {
"name": "${var.security_group_name}"
}
},
"huaweicloud_networking_secgroup_rule": {
"allow_ping": {
"security_group_id": "${huaweicloud_networking_secgroup.secgroup.id}",
"description": "允许ping程序测试弹性云服务器的连通性",
"direction": "ingress",
"ethertype": "IPv4",
"protocol": "icmp",
"remote_ip_prefix": "0.0.0.0/0"
},
"aigc": {
"security_group_id": "${huaweicloud_networking_secgroup.secgroup.id}",
"description": "允许访问AIGC应用",
"direction": "ingress",
"ethertype": "IPv4",
"protocol": "tcp",
"ports": 7860,
"remote_ip_prefix": "0.0.0.0/0"
}
},
"huaweicloud_vpc_eip": {
"eip": {
"name": "${var.vpc_name}-eip",
"count": "${var.ecs_count}",
"bandwidth": {
"name": "${var.vpc_name}-bandwidth",
"share_type": "PER",
"size": "${var.eip_bandwidth_size}",
"charge_mode": "traffic"
},
"publicip": {
"type": "5_bgp"
},
"charging_mode": "postPaid"
},
"elb_eip": {
"name": "${var.vpc_name}-eip",
"bandwidth": {
"name": "${var.vpc_name}-bandwidth",
"share_type": "PER",
"size": 5,
"charge_mode": "bandwidth"
},
"publicip": {
"type": "5_bgp"
},
"charging_mode": "${var.charging_mode}",
"period_unit": "${var.charging_unit}",
"period": "${var.charging_period}"
}
},
"huaweicloud_compute_instance": {
"ecs": {
"depends_on": [
"local.az"
],
"count": "${var.ecs_count}",
"name": "${var.ecs_name}-${count.index+1}",
"availability_zone": "${local.az[count.index % 2]}",
"image_id": "${data.huaweicloud_images_image.ubuntu.id}",
"flavor_id": "${var.ecs_flavor}",
"security_group_ids": [
"${huaweicloud_networking_secgroup.secgroup.id}"
],
"system_disk_type": "SAS",
"system_disk_size": 100,
"admin_pass": "${var.ecs_password}",
"delete_disks_on_termination": true,
"network": {
"uuid": "${huaweicloud_vpc_subnet.subnet.id}"
},
"eip_id": "${huaweicloud_vpc_eip.eip[count.index].id}",
"charging_mode": "${var.charging_mode}",
"period_unit": "${var.charging_unit}",
"period": "${var.charging_period}",
"user_data": "#!/bin/bash\necho 'root:${var.ecs_password}' | chpasswd\nwget -P /tmp/ https://documentation-samples-4.obs.ap-southeast-3.myhuaweicloud.com/solution-as-code-moudle/building-high-availability-aigc-applications-with-stable-diffusion/userdata/aigc-applications.sh\nchmod 777 /tmp/aigc-applications.sh\nsh -x /tmp/aigc-applications.sh ${var.access_key_id} ${var.secret_access_key} ${var.image_bucket_name} >> /home/aigc.log\nrm -rf /tmp/aigc-applications.sh"
}
},
"huaweicloud_obs_bucket": {
"image_bucket": {
"acl": "private",
"bucket": "${var.image_bucket_name}",
"multi_az": true
}
},
"huaweicloud_lb_loadbalancer": {
"elb": {
"name": "${var.elb_name}",
"vip_subnet_id": "${huaweicloud_vpc_subnet.subnet.subnet_id}"
}
},
"huaweicloud_lb_listener": {
"listener_http": {
"loadbalancer_id": "${huaweicloud_lb_loadbalancer.elb.id}",
"protocol": "HTTP",
"protocol_port": "7860"
}
},
"huaweicloud_lb_member": {
"member": {
"address": "${huaweicloud_compute_instance.ecs[count.index].access_ip_v4}",
"count": "${var.ecs_count}",
"pool_id": "${huaweicloud_lb_pool.group_http.id}",
"protocol_port": 7860,
"subnet_id": "${huaweicloud_vpc_subnet.subnet.subnet_id}",
"weight": 1
}
},
"huaweicloud_lb_monitor": {
"monitor_http": {
"delay": 5,
"max_retries": 3,
"pool_id": "${huaweicloud_lb_pool.group_http.id}",
"timeout": 3,
"type": "HTTP",
"url_path": "/"
}
},
"huaweicloud_lb_pool": {
"group_http": {
"lb_method": "ROUND_ROBIN",
"listener_id": "${huaweicloud_lb_listener.listener_http.id}",
"name": "group_http",
"protocol": "HTTP"
}
},
"huaweicloud_vpc_eip_associate": {
"eip": {
"port_id": "${huaweicloud_lb_loadbalancer.elb.vip_port_id}",
"public_ip": "${huaweicloud_vpc_eip.elb_eip.address}"
}
}
},
"output": {
"说明": {
"depends_on": [
"huaweicloud_vpc_eip.elb_eip"
],
"value": "请在浏览器上输入网址:http://${huaweicloud_vpc_eip.elb_eip.address}:7860/,即可访问WebUI界面。"
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。