Skip to content

Commit 3071950

Browse files
authored
Merge pull request #990 from duplocloud/hotfix/0.11.7
Hotfix Release v0.11.7
2 parents 0f2e752 + 686ef9d commit 3071950

39 files changed

+820
-116
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ NAMESPACE=duplocloud
88

99
NAME=duplocloud
1010
BINARY=terraform-provider-${NAME}
11-
VERSION=0.11.6
11+
VERSION=0.11.7
1212
#mac
1313
#OS_ARCH=darwin_amd64
1414
#OS_ARCH=linux_amd64

docs/data-sources/aws_launch_template.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ description: |-
2020
- `name` (String)
2121
- `tenant_id` (String)
2222

23+
### Optional
24+
25+
- `version` (String) Any of the existing version of the launch template
26+
2327
### Read-Only
2428

2529
- `ami` (String)
2630
- `default_version` (String)
2731
- `id` (String) The ID of this resource.
2832
- `instance_type` (String)
2933
- `latest_version` (String)
30-
- `version` (String) Any of the existing version of the launch template
3134
- `version_description` (String)
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "duplocloud_system_features Data Source - terraform-provider-duplocloud"
4+
subcategory: ""
5+
description: |-
6+
7+
---
8+
9+
# duplocloud_system_features (Data Source)
10+
11+
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Read-Only
19+
20+
- `app_configs` (List of Object) (see [below for nested schema](#nestedatt--app_configs))
21+
- `aws_regions` (List of String)
22+
- `default_aws_account` (String)
23+
- `default_aws_partition` (String)
24+
- `default_aws_region` (String)
25+
- `default_infra_cloud` (String)
26+
- `devops_manager_hostname` (String)
27+
- `disable_oob_data` (Boolean)
28+
- `duplo_shell_fqdn` (String)
29+
- `eks_versions` (List of Object) (see [below for nested schema](#nestedatt--eks_versions))
30+
- `enabled_flags` (List of String)
31+
- `gcp_disable_duplo_prefix` (Boolean)
32+
- `gcp_disable_tenant_prefix` (Boolean)
33+
- `id` (String) The ID of this resource.
34+
- `is_aws_admin_jit_enabled` (Boolean)
35+
- `is_aws_cloud_enabled` (Boolean)
36+
- `is_azure_cloud_enabled` (Boolean)
37+
- `is_billing_enabled` (Boolean)
38+
- `is_compliance_enabled` (Boolean)
39+
- `is_duplo_ops_enabled` (Boolean)
40+
- `is_google_cloud_enabled` (Boolean)
41+
- `is_katkit_enabled` (Boolean)
42+
- `is_on_prem_enabled` (Boolean)
43+
- `is_otp_needed` (Boolean)
44+
- `is_siem_enabled` (Boolean)
45+
- `is_signup_enabled` (Boolean)
46+
- `is_tags_based_resource_mgmt_enabled` (Boolean)
47+
- `s3_bucket_name_prefix` (String)
48+
- `tags_based_managed_resources` (List of String)
49+
- `tenant_name_max_length` (Number)
50+
51+
<a id="nestedatt--app_configs"></a>
52+
### Nested Schema for `app_configs`
53+
54+
Read-Only:
55+
56+
- `key` (String)
57+
- `type` (String)
58+
- `value` (String)
59+
60+
61+
<a id="nestedatt--eks_versions"></a>
62+
### Nested Schema for `eks_versions`
63+
64+
Read-Only:
65+
66+
- `default_version` (String)
67+
- `supported_versions` (List of String)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "duplocloud_asg_instance_refresh Resource - terraform-provider-duplocloud"
4+
subcategory: ""
5+
description: |-
6+
duplocloud_asg_instance_refresh triggers the instance refresh of asg in duplo
7+
---
8+
9+
# duplocloud_asg_instance_refresh (Resource)
10+
11+
duplocloud_asg_instance_refresh triggers the instance refresh of asg in duplo
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "duplocloud_tenant" "myapp" {
17+
account_name = "myapp"
18+
plan_id = "default"
19+
}
20+
21+
22+
resource "duplocloud_asg_instance_refresh" "name" {
23+
tenant_id = duplocloud_tenant.myapp.tenant_id
24+
asg_name = "asg-name"
25+
refresh_identifier = "1" #any identifier values can be used
26+
max_healthy_percentage = 100
27+
min_healthy_percentage = 90
28+
}
29+
```
30+
31+
<!-- schema generated by tfplugindocs -->
32+
## Schema
33+
34+
### Required
35+
36+
- `asg_name` (String) The fullname of the asg
37+
- `tenant_id` (String) The GUID of the tenant that the asg will be created in.
38+
39+
### Optional
40+
41+
- `auto_rollback` (Boolean) Automatically rollback if instance refresh fails
42+
- `instance_warmup` (Number) Number of seconds until a newly launched instance is configured and ready to use. Default behavior is to use the Auto Scaling Group's health check grace period.
43+
- `max_healthy_percentage` (Number) Amount of capacity in the Auto Scaling group that can be in service and healthy, or pending, to support your workload when an instance refresh is in place, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `100`.
44+
- `min_healthy_percentage` (Number) Amount of capacity in the Auto Scaling group that must remain healthy during an instance refresh to allow the operation to continue, as a percentage of the desired capacity of the Auto Scaling group. Defaults to `90`.
45+
- `refresh_identifier` (String) To identify refresh or invoke a refresh
46+
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
47+
48+
### Read-Only
49+
50+
- `id` (String) The ID of this resource.
51+
52+
<a id="nestedblock--timeouts"></a>
53+
### Nested Schema for `timeouts`
54+
55+
Optional:
56+
57+
- `create` (String)
58+
- `delete` (String)
59+
- `update` (String)

docs/resources/aws_launch_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ resource "duplocloud_aws_launch_template" "lt" {
3636
- `instance_type` (String) Asg instance type to be used to update the version from the current version
3737
- `name` (String) The fullname of the asg group
3838
- `tenant_id` (String) The GUID of the tenant that the launch template will be created in.
39-
- `version` (String) Any of the existing version of the launch template
4039

4140
### Optional
4241

4342
- `ami` (String) Asg ami to be used to update the version from the current version
4443
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
44+
- `version` (String) Any of the existing version of the launch template
4545
- `version_description` (String) The version of the launch template
4646

4747
### Read-Only
@@ -68,7 +68,7 @@ Import is supported using the following syntax:
6868
# Example: Importing an existing AWS launch template
6969
# - *TENANT_ID* is the tenant GUID
7070
# - *NAME* is the name of the AWS launch template
71-
# - *VERSION* available version of launch template
71+
# - *VERSION* available version of launch template , it is optional, use if needed to import specific version of available launch template
7272

7373
terraform import duplocloud_aws_launch_template.lt *TENANT_ID*/launch-template/*NAME*/*VERSION*
7474
```

docs/resources/duplo_service_lbconfigs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ resource "duplocloud_duplo_service_lbconfigs" "myservice" {
4545
health_check {
4646
healthy_threshold = 4
4747
unhealthy_threshold = 4
48-
timeout = 50
49-
interval = 30
48+
timeout = 30
49+
interval = 50
5050
http_success_codes = "200-399"
5151
}
5252
}
@@ -69,8 +69,8 @@ resource "duplocloud_duplo_service_lbconfigs" "myservice2" {
6969
health_check {
7070
healthy_threshold = 4
7171
unhealthy_threshold = 4
72-
timeout = 50
73-
interval = 30
72+
timeout = 30
73+
interval = 50
7474
http_success_codes = "200-399"
7575
}
7676
}

docs/resources/gcp_node_pool.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "duplocloud_gcp_node_pool Resource - terraform-provider-duplocloud"
44
subcategory: ""
55
description: |-
6-
duplocloud_gcp_k8_node_pools manages a GCP Node Pool in Duplo.
6+
duplocloud_gcp_node_pool manages a GCP Node Pool in Duplo.
77
---
88

99
# duplocloud_gcp_node_pool (Resource)
1010

11-
`duplocloud_gcp_k8_node_pools` manages a GCP Node Pool in Duplo.
11+
`duplocloud_gcp_node_pool` manages a GCP Node Pool in Duplo.
1212

1313
## Example Usage
1414

@@ -18,10 +18,10 @@ resource "duplocloud_tenant" "myapp" {
1818
plan_id = "default"
1919
}
2020
21-
21+
#Example for upgrade strategy NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED
2222
resource "duplocloud_gcp_node_pool" "myNodePool" {
2323
tenant_id = duplocloud_tenant.myapp.tenant_id
24-
name = "myNodePool"
24+
name = "mynodepool"
2525
is_autoscaling_enabled = false
2626
accelerator {
2727
accelerator_count = "2"
@@ -35,11 +35,6 @@ resource "duplocloud_gcp_node_pool" "myNodePool" {
3535
gpu_driver_version = "DEFAULT"
3636
}
3737
}
38-
upgrade_settings {
39-
strategy = "NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED"
40-
max_surge = 4
41-
max_unavailable = 2
42-
}
4338
zones = ["us-east1-c"]
4439
location_policy = "BALANCED"
4540
auto_upgrade = true

docs/resources/k8_helm_repository.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ resource "duplocloud_k8_helm_repository" "repo" {
2626
interval = "06m00s"
2727
url = "https://helm.github.com"
2828
}
29+
30+
31+
resource "duplocloud_k8_helm_repository" "repo" {
32+
name = "repo-name"
33+
interval = "06m00s"
34+
url = "oci://registry-1.docker.io/bitnamicharts"
35+
tenant_id = duplocloud_tenant.myapp.tenant_id
36+
insecure = true
37+
pass_credentials = true
38+
helm_provider = "generic"
39+
suspend = true
40+
type = "oci"
41+
42+
}
2943
```
3044

3145
<!-- schema generated by tfplugindocs -->
@@ -39,8 +53,13 @@ resource "duplocloud_k8_helm_repository" "repo" {
3953

4054
### Optional
4155

56+
- `helm_provider` (String) The provider attribute in the spec block of a HelmRepository specifies the cloud example: generic, aws, gcp, azure
57+
- `insecure` (Boolean) Set to skip TLS certificate verification when accessing the repository.
4258
- `interval` (String) The interval associated to helm repository Defaults to `5m0s`.
59+
- `pass_credentials` (Boolean) Pass credentials even to a different host than the one used in url
60+
- `suspend` (Boolean) Used to pause the reconciliation of the repository by the controller.
4361
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
62+
- `type` (String) The Helm repository type. Possible values are default for a Helm HTTP/S repository, or oci for an OCI Helm repository.
4463

4564
### Read-Only
4665

duplocloud/data_source_duplo_aws_launch_template.go

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package duplocloud
22

33
import (
4+
"strings"
5+
46
"github.com/duplocloud/terraform-provider-duplocloud/duplosdk"
5-
"strconv"
67

8+
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
79
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
810
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
911
)
@@ -25,6 +27,7 @@ func dataSourceAwsLaunchTemplate() *schema.Resource {
2527
"version": {
2628
Description: "Any of the existing version of the launch template",
2729
Type: schema.TypeString,
30+
Optional: true,
2831
Computed: true,
2932
},
3033
"default_version": {
@@ -54,9 +57,18 @@ func dataSourceAwsLaunchTemplate() *schema.Resource {
5457

5558
func datasourceAwsLaunchTemplateRead(d *schema.ResourceData, m interface{}) error {
5659
tenantId := d.Get("tenant_id").(string)
57-
asgName := d.Get("name").(string)
58-
ver := "1"
60+
name := d.Get("name").(string)
61+
ver := d.Get("version").(string)
62+
asgName := name
63+
var err duplosdk.ClientError
5964
c := m.(*duplosdk.Client)
65+
if !strings.Contains(name, "duploservices") {
66+
asgName, err = c.GetResourceName("duploservices", tenantId, name, false)
67+
if err != nil {
68+
diag.FromErr(err)
69+
}
70+
}
71+
6072
rp, err := c.GetAwsLaunchTemplate(tenantId, asgName)
6173
if err != nil {
6274
if err.Status() == 404 {
@@ -69,40 +81,11 @@ func datasourceAwsLaunchTemplateRead(d *schema.ResourceData, m interface{}) erro
6981
d.SetId("")
7082
return nil
7183
}
72-
d.SetId(tenantId + "/launch-template/" + asgName + "/" + ver)
84+
d.SetId(tenantId + "/launch-template/" + asgName)
7385

74-
fErr := flattenLaunchTemplateData(d, rp, ver)
86+
fErr := flattenLaunchTemplate(d, rp, ver)
7587
if fErr != nil {
7688
return err
7789
}
7890
return nil
7991
}
80-
81-
func flattenLaunchTemplateData(d *schema.ResourceData, rp *[]duplosdk.DuploLaunchTemplateResponse, ver string) error {
82-
83-
var name, cver, insType, verDesc, dver, imgId string
84-
max := 0
85-
for _, v := range *rp {
86-
if strconv.Itoa(int(v.VersionNumber)) == ver {
87-
name = v.LaunchTemplateName
88-
cver = strconv.Itoa(int(v.VersionNumber))
89-
}
90-
if v.DefaultVersion {
91-
dver = strconv.Itoa(int(v.VersionNumber))
92-
}
93-
if max < int(v.VersionNumber) {
94-
max = int(v.VersionNumber)
95-
insType = v.LaunchTemplateData.InstanceType.Value
96-
verDesc = v.VersionDescription
97-
imgId = v.LaunchTemplateData.ImageId
98-
}
99-
}
100-
d.Set("instance_type", insType)
101-
d.Set("version_description", verDesc)
102-
d.Set("name", name)
103-
d.Set("version", cver)
104-
d.Set("latest_version", strconv.Itoa(max))
105-
d.Set("default_version", dver)
106-
d.Set("ami", imgId)
107-
return nil
108-
}

0 commit comments

Comments
 (0)