Skip to content

PR #630

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

Merged
merged 29 commits into from
Jun 9, 2021
Merged

PR #630

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fc274cc
修改拼写错误 favorate -> favorite, 解决 https://registry.terraform.io/provide…
May 28, 2021
1e046f5
添加支持 clb 创建目标工作组的逻辑,添加相应函数的参数
May 31, 2021
d761221
修复新添加的命令行参数错误,Elem字段使用 schema.Resource指针
May 31, 2021
feab631
添加安全组对内网clb的支持(注释掉对当前网络是否为内网的判断)
May 31, 2021
d0ba33b
添加支持开启和关闭CLB安全组默认放通的配置
May 31, 2021
50805fc
添加terraform支持external CLB创建AZ实例
May 31, 2021
db39be6
添加clb创建目标工作组中,调用create后的update操作中的 port 字段
May 31, 2021
09a6db1
添加create中调用update操作时,设置load_balancer_pass_to_target
May 31, 2021
c460e68
修改在 resourceTencentCloudClbInstanceUpdate 中对 LoadBalancerPassToTarget…
Jun 1, 2021
0ec89d4
修改支持internal CLB的security group 中description注释部分
Jun 2, 2021
37314e6
添加调用 CreateClusterInstances时,传入imageId参数来指定镜像,以及对镜像的验证,满足 img-xxx 的格式
Jun 2, 2021
8afa773
回退版本(添加镜像),该文件不再维护
Jun 2, 2021
8a14a18
修改命令行参数的key, os -> img_id
Jun 2, 2021
c34706f
修改tke资源is_non_static_ip_mode描述不当的错误, static -> non-static
Jun 2, 2021
d9de732
添加Update操作对Port的支持
Jun 4, 2021
c28a839
需求 支持external CLB创建多AZ实例 Description添加master_zone及查询结果相应的字段
Jun 4, 2021
690bfcc
添加测试用命,及 hcl 测试说明文档注释
Jun 4, 2021
335ff4d
添加测试用命,及 hcl 测试说明文档注释
Jun 4, 2021
00338f9
添加创建多实例,开启和关闭CLB安全组默认放通测试用例
Jun 4, 2021
1eedd4a
完善测试文件
Jun 4, 2021
bcadc56
添加AS的参数 MultiZoneSubnetPolicy ,支持多可用区(子网)打散
Jun 7, 2021
1e76485
merge the upstream and solve the conflicts
Jun 9, 2021
405baac
gendoc
Jun 9, 2021
4197fbf
change changelog.md
Jun 9, 2021
aacbd13
# This is a combination of 2 commits.
May 28, 2021
c9ae243
修改拼写错误 favorate -> favorite, 解决 https://registry.terraform.io/provide…
Jun 9, 2021
93cd83f
Merge branch 'master' of https://github.com/ivandksun/terraform-provi…
Jun 9, 2021
c61068d
change changelog.md: tencentcloud_container_cluster_instance -> tence…
Jun 9, 2021
8e41ec7
change CHANGELOG.md version info
Jun 9, 2021
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
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
## 1.56.9 (Unreleased)
## 1.56.10 (Unreleased)
## 1.56.9 (Jun 09, 2021)

BUG FIXES:

* Resource `tencentcloud_instance` fix words spell, in tencendcloud/resource_tc_instance.go L45, data.tencentcloud_availability_zones.my_favorate_zones.zones.0.name change to data.tencentcloud_availability_zones.my_favorite_zones.zones.0.name".
* Resource `tencentcloud_kubernetes_clusters` fix the description of is_non_static_ip_mode

ENHANCEMENTS:

* Resource `tencentcloud_clb_target_group` add create target group.
* Resource `tencentcloud_clb_instance` add internal CLB supports security group.
* Resource `tencentcloud_clb_instance` add supports open and close CLB security group, default is open.
* Resource `tencentcloud_clb_instance` add external CLB create multi AZ instance.
* Resource `tencentcloud_kubernetes_cluster` add supports params of img_id to assign image.
* Resource `tencentcloud_as_scaling_group` add MultiZoneSubnetPolicy.

## 1.56.8 (May 26, 2021)

ENHANCEMENTS:
Expand Down
40 changes: 23 additions & 17 deletions tencentcloud/data_source_tc_as_scaling_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ func dataSourceTencentCloudAsScalingGroups() *schema.Resource {
Computed: true,
Description: "Tags of the scaling group.",
},
"multi_zone_subnet_policy": {
Type: schema.TypeString,
Computed: true,
Description: "Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.",
},
},
},
},
Expand Down Expand Up @@ -241,23 +246,24 @@ func dataSourceTencentCloudAsScalingGroupRead(d *schema.ResourceData, meta inter
}

mapping := map[string]interface{}{
"scaling_group_id": scalingGroup.AutoScalingGroupId,
"scaling_group_name": scalingGroup.AutoScalingGroupName,
"configuration_id": scalingGroup.LaunchConfigurationId,
"status": scalingGroup.AutoScalingGroupStatus,
"instance_count": scalingGroup.InstanceCount,
"max_size": scalingGroup.MaxSize,
"min_size": scalingGroup.MinSize,
"vpc_id": scalingGroup.VpcId,
"subnet_ids": helper.StringsInterfaces(scalingGroup.SubnetIdSet),
"zones": helper.StringsInterfaces(scalingGroup.ZoneSet),
"default_cooldown": scalingGroup.DefaultCooldown,
"desired_capacity": scalingGroup.DesiredCapacity,
"load_balancer_ids": helper.StringsInterfaces(scalingGroup.LoadBalancerIdSet),
"termination_policies": helper.StringsInterfaces(scalingGroup.TerminationPolicySet),
"retry_policy": scalingGroup.RetryPolicy,
"create_time": scalingGroup.CreatedTime,
"tags": tags,
"scaling_group_id": scalingGroup.AutoScalingGroupId,
"scaling_group_name": scalingGroup.AutoScalingGroupName,
"configuration_id": scalingGroup.LaunchConfigurationId,
"status": scalingGroup.AutoScalingGroupStatus,
"instance_count": scalingGroup.InstanceCount,
"max_size": scalingGroup.MaxSize,
"min_size": scalingGroup.MinSize,
"vpc_id": scalingGroup.VpcId,
"subnet_ids": helper.StringsInterfaces(scalingGroup.SubnetIdSet),
"zones": helper.StringsInterfaces(scalingGroup.ZoneSet),
"default_cooldown": scalingGroup.DefaultCooldown,
"desired_capacity": scalingGroup.DesiredCapacity,
"load_balancer_ids": helper.StringsInterfaces(scalingGroup.LoadBalancerIdSet),
"termination_policies": helper.StringsInterfaces(scalingGroup.TerminationPolicySet),
"retry_policy": scalingGroup.RetryPolicy,
"create_time": scalingGroup.CreatedTime,
"tags": tags,
"multi_zone_subnet_policy": scalingGroup.MultiZoneSubnetPolicy,
}
if scalingGroup.ForwardLoadBalancerSet != nil && len(scalingGroup.ForwardLoadBalancerSet) > 0 {
forwardLoadBalancers := make([]map[string]interface{}, 0, len(scalingGroup.ForwardLoadBalancerSet))
Expand Down
41 changes: 41 additions & 0 deletions tencentcloud/data_source_tc_clb_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func dataSourceTencentCloudClbInstances() *schema.Resource {
Optional: true,
Description: "Used to save results.",
},
"master_zone": {
Type: schema.TypeString,
Optional: true,
Description: "Master available zone id.",
},
"clb_list": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -154,6 +159,31 @@ func dataSourceTencentCloudClbInstances() *schema.Resource {
Computed: true,
Description: "Max bandwidth out, only applicable to open CLB. Valid value ranges is [1, 2048]. Unit is MB.",
},
"zone_id": {
Type: schema.TypeInt,
Computed: true,
Description: "Available zone unique id(numerical representation), This field maybe null, means cannot get a valid value.",
},
"zone": {
Type: schema.TypeString,
Computed: true,
Description: "Available zone unique id(string representation), This field maybe null, means cannot get a valid value.",
},
"zone_name": {
Type: schema.TypeString,
Computed: true,
Description: "Available zone name, This field maybe null, means cannot get a valid value.",
},
"zone_region": {
Type: schema.TypeString,
Computed: true,
Description: "Region that this available zone belong to, This field maybe null, means cannot get a valid value.",
},
"local_zone": {
Type: schema.TypeBool,
Computed: true,
Description: "Whether this available zone is local zone, This field maybe null, means cannot get a valid value.",
},
},
},
},
Expand All @@ -180,6 +210,9 @@ func dataSourceTencentCloudClbInstancesRead(d *schema.ResourceData, meta interfa
if v, ok := d.GetOk("network_type"); ok {
params["network_type"] = v.(string)
}
if v, ok := d.GetOk("master_zone"); ok {
params["master_zone"] = v.(string)
}

clbService := ClbService{
client: meta.(*TencentCloudClient).apiV3Conn,
Expand Down Expand Up @@ -221,6 +254,14 @@ func dataSourceTencentCloudClbInstancesRead(d *schema.ResourceData, meta interfa
mapping["internet_charge_type"] = *clbInstance.NetworkAttributes.InternetChargeType
mapping["internet_bandwidth_max_out"] = *clbInstance.NetworkAttributes.InternetMaxBandwidthOut
}
if clbInstance.MasterZone != nil {
mapping["zone_id"] = *clbInstance.MasterZone.ZoneId
mapping["zone"] = *clbInstance.MasterZone.Zone
mapping["zone_name"] = *clbInstance.MasterZone.ZoneName
mapping["zone_region"] = *clbInstance.MasterZone.ZoneRegion
mapping["local_zone"] = *clbInstance.MasterZone.LocalZone
}

if clbInstance.Tags != nil {
tags := make(map[string]interface{}, len(clbInstance.Tags))
for _, t := range clbInstance.Tags {
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/data_source_tc_kubernetes_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func tkeClusterInfo() map[string]*schema.Schema {
"is_non_static_ip_mode": {
Type: schema.TypeBool,
Computed: true,
Description: "Indicates whether static ip mode is enabled.",
Description: "Indicates whether non-static ip mode is enabled.",
},
"kube_proxy_mode": {
Type: schema.TypeString,
Expand Down
5 changes: 5 additions & 0 deletions tencentcloud/extension_as.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,8 @@ const (
SCALING_GROUP_IN_ACTIVITY_STATUS = "IN_ACTIVITY"
SCALING_GROUP_NOT_IN_ACTIVITY_STATUS = "NOT_IN_ACTIVITY"
)

const (
MultiZoneSubnetPolicyPriority = "PRIORITY"
MultiZoneSubnetPolicyEquality = "EQUALITY"
)
17 changes: 17 additions & 0 deletions tencentcloud/resource_tc_as_scaling_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ func resourceTencentCloudAsScalingGroup() *schema.Resource {
Computed: true,
Description: "The time when the AS group was created.",
},
"multi_zone_subnet_policy": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateAllowedStringValue([]string{MultiZoneSubnetPolicyPriority,
MultiZoneSubnetPolicyEquality}),
Description: "Multi zone or subnet strategy, Valid values: PRIORITY and EQUALITY.",
},
},
}
}
Expand Down Expand Up @@ -303,6 +310,10 @@ func resourceTencentCloudAsScalingGroupCreate(d *schema.ResourceData, meta inter
}
}

if v, ok := d.GetOk("multi_zone_subnet_policy"); ok {
request.MultiZoneSubnetPolicy = helper.String(v.(string))
}

var id string
if err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
ratelimit.Check(request.GetAction())
Expand Down Expand Up @@ -408,6 +419,7 @@ func resourceTencentCloudAsScalingGroupRead(d *schema.ResourceData, meta interfa
_ = d.Set("termination_policies", helper.StringsInterfaces(scalingGroup.TerminationPolicySet))
_ = d.Set("retry_policy", scalingGroup.RetryPolicy)
_ = d.Set("create_time", scalingGroup.CreatedTime)
_ = d.Set("multi_zone_subnet_policy", scalingGroup.MultiZoneSubnetPolicy)

if scalingGroup.ForwardLoadBalancerSet != nil && len(scalingGroup.ForwardLoadBalancerSet) > 0 {
forwardLoadBalancers := make([]map[string]interface{}, 0, len(scalingGroup.ForwardLoadBalancerSet))
Expand Down Expand Up @@ -521,6 +533,11 @@ func resourceTencentCloudAsScalingGroupUpdate(d *schema.ResourceData, meta inter
}
}

if d.HasChange("multi_zone_subnet_policy") {
updateAttrs = append(updateAttrs, "multi_zone_subnet_policy")
request.MultiZoneSubnetPolicy = helper.String(d.Get("multi_zone_subnet_policy").(string))
}

if err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
ratelimit.Check(request.GetAction())

Expand Down
Loading