Skip to content

Commit

Permalink
Merge pull request #624 from duplocloud/release/0.10.37
Browse files Browse the repository at this point in the history
Release v0.10.37
  • Loading branch information
tahir-duplo authored Aug 8, 2024
2 parents e32e965 + 7fc7fe0 commit 3bbe9fa
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NAMESPACE=duplocloud

NAME=duplocloud
BINARY=terraform-provider-${NAME}
VERSION=0.10.36
VERSION=0.10.37
#mac
#OS_ARCH=darwin_amd64
#OS_ARCH=linux_amd64
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ provider "duplocloud" {

- `duplo_host` (String) This is the base URL to the Duplo REST API. It must be provided, but it can also be sourced from the `duplo_host` environment variable.
- `duplo_token` (String, Sensitive) This is a bearer token used to authenticate to the Duplo REST API. It must be provided, but it can also be sourced from the `duplo_token` environment variable.
- `http_timeout` (Number) Timeout for HTTP requests in seconds. Defaults to `30`.
- `ssl_no_verify` (Boolean) Disable SSL certificate verification. Defaults to `false`.
1 change: 1 addition & 0 deletions docs/resources/aws_apigateway_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ resource "duplocloud_aws_apigateway_event" "apigateway_event" {
- `api_key_required` (Boolean) Specify if the method requires an API key.
- `authorization_type` (String) Type of authorization used for the method. (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`)
- `authorizer_id` (String) Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS`.
- `content_handling` (String) How to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.
- `cors` (Boolean) Enable handling of preflight requests.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/aws_ecr_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ resource "duplocloud_aws_ecr_repository" "test-ecr" {

### Read-Only

- `arn` (String) Full ARN of the repository.
- `arn` (String) Full ARN of the ECR repository.
- `id` (String) The ID of this resource.
- `registry_id` (String) The registry ID where the repository was created.
- `repository_url` (String) The URL of the repository.
Expand Down
4 changes: 3 additions & 1 deletion docs/resources/infrastructure_setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ resource "duplocloud_infrastructure_setting" "settings" {
- `custom_data` (Block List, Deprecated) A complete list of configuration settings for this infrastructure, even ones not being managed by this resource. The custom_data argument is only applied on creation, and is deprecated in favor of the settings argument. (see [below for nested schema](#nestedblock--custom_data))
- `delete_unspecified_settings` (Boolean) Whether or not this resource should delete any settings not specified by this resource. **WARNING:** It is not recommended to change the default value of `false`. Defaults to `false`.
- `setting` (Block List) A list of configuration settings to manage, expressed as key / value pairs.

| Cloud | Key (string) | Value (string) |
|-----------|------------------------------|---------------------------------------------------------|
| All Cloud | MaximumK8sSessionDuration | int |
Expand All @@ -73,7 +74,8 @@ resource "duplocloud_infrastructure_setting" "settings" {
| Azure | Shared Image Gallery | string |
| Azure | EnableAzureAppGatewayIngress | bool |
| GCP | GkeMinPortsPerVm | int |
*Note: EksControlplaneLogs value can be set with combination of settings separated by ; with no spaces* (see [below for nested schema](#nestedblock--setting))

Note: EksControlplaneLogs value can be set with combination of settings separated by ; with no spaces (see [below for nested schema](#nestedblock--setting))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only
Expand Down
3 changes: 2 additions & 1 deletion duplocloud/data_source_duplo_plan_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func dataSourcePlanCertsRead(ctx context.Context, d *schema.ResourceData, m inte
}
// Populate the results from the list.
d.Set("certificates", flattenPlanCerts(all))

d.Set("plan_id", planID)
d.SetId(planID)

log.Printf("[TRACE] dataSourcePlanCertsRead(%s): end", planID)
Expand All @@ -106,6 +106,7 @@ func dataSourcePlanCertRead(ctx context.Context, d *schema.ResourceData, m inter
d.SetId(cert.CertificateArn)
d.Set("name", cert.CertificateName)
d.Set("arn", cert.CertificateArn)
d.Set("plan_id", planID)

log.Printf("[TRACE] dataSourcePlanCertRead(): end")
return nil
Expand Down
15 changes: 15 additions & 0 deletions duplocloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"os"
"strings"
"terraform-provider-duplocloud/duplosdk"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down Expand Up @@ -49,6 +51,12 @@ func Provider() *schema.Provider {
Optional: true,
Default: false,
},
"http_timeout": {
Description: "Timeout for HTTP requests in seconds.",
Type: schema.TypeInt,
Optional: true,
Default: 30,
},
},
ResourcesMap: map[string]*schema.Resource{
"duplocloud_oci_containerengine_node_pool": resourceOciContainerEngineNodePool(),
Expand Down Expand Up @@ -262,10 +270,17 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}
}

if sslNoVerify, ok := d.GetOk("ssl_no_verify"); ok && sslNoVerify.(bool) {
log.Printf("[TRACE] ssl_no_verify provided in the provider configuration.")
c.HTTPClient.Transport = &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
}

if httpTimeout, ok := d.GetOk("http_timeout"); ok {
timout := time.Duration(httpTimeout.(int)) * time.Second
log.Printf("[TRACE] http_timeout provided in the provider configuration. Timeout : %s", timout)
c.HTTPClient.Timeout = timout * time.Second
}

return c, diags
}
17 changes: 17 additions & 0 deletions duplocloud/resource_duplo_aws_apigateway_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ func AwsApiGatewayEventSchema() map[string]*schema.Schema {
"COGNITO_USER_POOLS",
}, false),
},
"content_handling": {
Description: "How to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.",
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
"CONVERT_TO_TEXT",
"CONVERT_TO_BINARY",
}, false),
},
"integration": {
Description: "Specify API gateway integration.",
Type: schema.TypeList,
Expand Down Expand Up @@ -165,6 +175,7 @@ func resourceAwsApiGatewayEventRead(ctx context.Context, d *schema.ResourceData,
d.Set("api_key_required", duplo.ApiKeyRequired)
d.Set("authorizer_id", duplo.AuthorizerId)
d.Set("authorization_type", duplo.AuthorizationType)
d.Set("content_handling", duplo.ContentHandling)
if duplo.Integration != nil {
d.Set("integration", []interface{}{
map[string]interface{}{
Expand Down Expand Up @@ -203,6 +214,9 @@ func resourceAwsApiGatewayEventCreate(ctx context.Context, d *schema.ResourceDat
if v, ok := d.GetOk("authorization_type"); ok && v != nil {
rq.AuthorizationType = v.(string)
}
if v, ok := d.GetOk("content_handling"); ok && v != nil {
rq.ContentHandling = v.(string)
}
if v, ok := d.GetOk("integration"); ok {
if s := v.([]interface{}); len(s) > 0 {
rq.Integration = expandAwsApiGatewayEventIntegration(s[0].(map[string]interface{}))
Expand Down Expand Up @@ -256,6 +270,9 @@ func resourceAwsApiGatewayEventUpdate(ctx context.Context, d *schema.ResourceDat
if v, ok := d.GetOk("authorization_type"); ok && v != nil {
rq.AuthorizationType = v.(string)
}
if v, ok := d.GetOk("content_handling"); ok && v != nil {
rq.ContentHandling = v.(string)
}
if v, ok := d.GetOk("integration"); ok {
if s := v.([]interface{}); len(s) > 0 {
rq.Integration = expandAwsApiGatewayEventIntegration(s[0].(map[string]interface{}))
Expand Down
2 changes: 1 addition & 1 deletion duplocloud/resource_duplo_aws_ecr_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func duploAwsEcrRepositorySchema() map[string]*schema.Schema {
ForceNew: true,
},
"arn": {
Description: "Full ARN of the repository.",
Description: "Full ARN of the ECR repository.",
Type: schema.TypeString,
Computed: true,
},
Expand Down
4 changes: 3 additions & 1 deletion duplocloud/resource_duplo_infrastructure_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func resourceInfrastructureSetting() *schema.Resource {
},
"setting": {
Description: `A list of configuration settings to manage, expressed as key / value pairs.
| Cloud | Key (string) | Value (string) |
|-----------|------------------------------|---------------------------------------------------------|
| All Cloud | MaximumK8sSessionDuration | int |
Expand All @@ -56,7 +57,8 @@ func resourceInfrastructureSetting() *schema.Resource {
| Azure | Shared Image Gallery | string |
| Azure | EnableAzureAppGatewayIngress | bool |
| GCP | GkeMinPortsPerVm | int |
*Note: EksControlplaneLogs value can be set with combination of settings separated by ; with no spaces*`,
Note: EksControlplaneLogs value can be set with combination of settings separated by ; with no spaces`,
Type: schema.TypeList,
Optional: true,
Elem: KeyValueSchema(),
Expand Down
2 changes: 1 addition & 1 deletion duplocloud/resource_duplo_plan_certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func resourcePlanCertificatesRead(ctx context.Context, d *schema.ResourceData, m

// Set the simple fields first.
d.Set("certificates", flattenPlanCertificates(duplo))

d.Set("plan_id", planID)
// Build a list of current state, to replace the user-supplied settings.
if v, ok := getAsStringArray(d, "specified_certificates"); ok && v != nil {
d.Set("certificate", flattenPlanCertificates(selectPlanCertificates(duplo, *v)))
Expand Down
1 change: 1 addition & 0 deletions duplosdk/aws_apigateway_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type DuploApiGatewayEvent struct {
ApiKeyRequired bool `json:"ApiKeyRequired,omitempty"`
AuthorizerId string `json:"AuthorizerId,omitempty"`
AuthorizationType string `json:"AuthorizationType,omitempty"`
ContentHandling string `json:"ContentHandling,omitempty"`
Integration *DuploApiGatewayEventIntegration `json:"Integration"`
}

Expand Down
2 changes: 1 addition & 1 deletion examples/aws-integration/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
aws = {
Expand Down
2 changes: 1 addition & 1 deletion examples/ecs/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/eks-integration/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
aws = {
Expand Down
2 changes: 1 addition & 1 deletion examples/emr/files/emr_auto_scaling/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/emr/files/emr_spot/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/emr/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ephemeral-storage/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/infrastructure/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/k8/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/service/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
duplocloud = {
version = "0.10.36" # RELEASE VERSION
version = "0.10.37" # RELEASE VERSION
source = "registry.terraform.io/duplocloud/duplocloud"
}
}
Expand Down

0 comments on commit 3bbe9fa

Please sign in to comment.