Skip to content

Commit

Permalink
Upgrade the dcl version to v1.26.0 (#6639) (#12965)
Browse files Browse the repository at this point in the history
* Upgrade DCL to v1.23.0

* add clouddeploy test files

* upgrade dcl to v1.25

* upgrade dcl to v1.26

* delete extra samples folder. test executionTimeout field in run target json

* add tags, and monitoring_config

* Add monitoringConfig to other files

* Add a test for GKEHub servicemesh and exclude Eventarc trigger channel field

* remove monitoring_config in handwritten tests and adding exclude for field in beta

Co-authored-by: Chris Hawk <hawk@google.com>
Co-authored-by: Ghaleb Al-habian <galhabian@google.com>
Co-authored-by: ghabian <ghabian@gmail.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
Co-authored-by: Chris Hawk <hawk@google.com>
Co-authored-by: Ghaleb Al-habian <galhabian@google.com>
Co-authored-by: ghabian <ghabian@gmail.com>
  • Loading branch information
4 people committed Nov 7, 2022
1 parent c9d420d commit 81a1e16
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .changelog/6639.txt
@@ -0,0 +1,16 @@
```release-note:enhancement
clouddeploy: Added support for Cloud Run Targets (beta)
```
```release-note:enhancement
clouddeploy: Added support for Deployment Verification standard strategy (beta)
```
```release-note:enhancement
clouddeploy: Added execution_configs.execution_timeout in target resource. (beta)
```
```release-note:enhancement
compute: machine_type field in compute instance resource now accepts short name.
```
```release-note:enhancement
orgpolicy: Changed spec.rules type from Array to Set in policy resource.
https://github.com/hashicorp/terraform-provider-google/issues/12363
```
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -3,7 +3,7 @@ go 1.18

require (
cloud.google.com/go/bigtable v1.16.0
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.19.0
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.26.0
github.com/apparentlymart/go-cidr v1.1.0
github.com/client9/misspell v0.3.4
github.com/davecgh/go-spew v1.1.1
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Expand Up @@ -71,8 +71,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM=
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.19.0 h1:4YAtk4xuOCxUSkGdwlDhkX7DTP4VwLZCoebGGEsU+U4=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.19.0/go.mod h1:i6Pmzp7aolLmJY86RaJ9wjqm/HFleMeN7Vl5uIWLwE8=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.26.0 h1:9RQhnEju2B+3njLTERnIeotRoI3GOQrN7kXA+n3iuJw=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.26.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
Expand Down Expand Up @@ -1463,3 +1463,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.26.0 h1:9RQhnEju2B+3njLTERnIeotRoI3GOQrN7kXA+n3iuJw=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.26.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k=
2 changes: 1 addition & 1 deletion google/resource_clouddeploy_delivery_pipeline.go
Expand Up @@ -181,7 +181,7 @@ func ClouddeployDeliveryPipelineConditionSchema() *schema.Resource {
"targets_present_condition": {
Type: schema.TypeList,
Computed: true,
Description: "Detalis around targets enumerated in the pipeline.",
Description: "Details around targets enumerated in the pipeline.",
Elem: ClouddeployDeliveryPipelineConditionTargetsPresentConditionSchema(),
},
},
Expand Down
25 changes: 17 additions & 8 deletions google/resource_clouddeploy_target.go
Expand Up @@ -183,6 +183,13 @@ func ClouddeployTargetExecutionConfigsSchema() *schema.Resource {
Description: "Optional. Cloud Storage location in which to store execution outputs. This can either be a bucket (\"gs://my-bucket\") or a path within a bucket (\"gs://my-bucket/my-dir\"). If unspecified, a default bucket located in the same region will be used.",
},

"execution_timeout": {
Type: schema.TypeString,
Computed: true,
Optional: true,
Description: "Optional. Execution timeout for a Cloud Build Execution. This must be between 10m and 24h in seconds format. If unspecified, a default timeout of 1h is used.",
},

"service_account": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -535,10 +542,11 @@ func expandClouddeployTargetExecutionConfigs(o interface{}) *clouddeploy.TargetE

obj := o.(map[string]interface{})
return &clouddeploy.TargetExecutionConfigs{
Usages: expandClouddeployTargetExecutionConfigsUsagesArray(obj["usages"]),
ArtifactStorage: dcl.StringOrNil(obj["artifact_storage"].(string)),
ServiceAccount: dcl.StringOrNil(obj["service_account"].(string)),
WorkerPool: dcl.String(obj["worker_pool"].(string)),
Usages: expandClouddeployTargetExecutionConfigsUsagesArray(obj["usages"]),
ArtifactStorage: dcl.StringOrNil(obj["artifact_storage"].(string)),
ExecutionTimeout: dcl.StringOrNil(obj["execution_timeout"].(string)),
ServiceAccount: dcl.StringOrNil(obj["service_account"].(string)),
WorkerPool: dcl.String(obj["worker_pool"].(string)),
}
}

Expand All @@ -561,10 +569,11 @@ func flattenClouddeployTargetExecutionConfigs(obj *clouddeploy.TargetExecutionCo
return nil
}
transformed := map[string]interface{}{
"usages": flattenClouddeployTargetExecutionConfigsUsagesArray(obj.Usages),
"artifact_storage": obj.ArtifactStorage,
"service_account": obj.ServiceAccount,
"worker_pool": obj.WorkerPool,
"usages": flattenClouddeployTargetExecutionConfigsUsagesArray(obj.Usages),
"artifact_storage": obj.ArtifactStorage,
"execution_timeout": obj.ExecutionTimeout,
"service_account": obj.ServiceAccount,
"worker_pool": obj.WorkerPool,
}

return transformed
Expand Down
1 change: 0 additions & 1 deletion google/resource_container_aws_cluster.go
Expand Up @@ -299,7 +299,6 @@ func ContainerAwsClusterControlPlaneSchema() *schema.Resource {
"tags": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Description: "Optional. A set of AWS resource tags to propagate to all underlying managed AWS resources. Specify at most 50 pairs containing alphanumerics, spaces, and symbols (.+-=_:@/). Keys can be up to 127 Unicode characters. Values can be up to 255 Unicode characters.",
Elem: &schema.Schema{Type: schema.TypeString},
},
Expand Down
10 changes: 10 additions & 0 deletions google/resource_eventarc_trigger.go
Expand Up @@ -108,6 +108,13 @@ func resourceEventarcTrigger() *schema.Resource {
Elem: EventarcTriggerTransportSchema(),
},

"conditions": {
Type: schema.TypeMap,
Computed: true,
Description: "Output only. The reason(s) why a trigger is in FAILED state.",
Elem: &schema.Schema{Type: schema.TypeString},
},

"create_time": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -412,6 +419,9 @@ func resourceEventarcTriggerRead(d *schema.ResourceData, meta interface{}) error
if err = d.Set("transport", flattenEventarcTriggerTransport(res.Transport)); err != nil {
return fmt.Errorf("error setting transport in state: %s", err)
}
if err = d.Set("conditions", res.Conditions); err != nil {
return fmt.Errorf("error setting conditions in state: %s", err)
}
if err = d.Set("create_time", res.CreateTime); err != nil {
return fmt.Errorf("error setting create_time in state: %s", err)
}
Expand Down
54 changes: 54 additions & 0 deletions website/docs/r/clouddeploy_delivery_pipeline.html.markdown
Expand Up @@ -60,6 +60,44 @@ resource "google_clouddeploy_delivery_pipeline" "primary" {
}
```
## Example Usage - verify_delivery_pipeline
tests creating and updating a delivery pipeline with deployment verification strategy
```hcl
resource "google_clouddeploy_delivery_pipeline" "primary" {
location = "us-west1"
name = "pipeline"
annotations = {
my_first_annotation = "example-annotation-1"
my_second_annotation = "example-annotation-2"
}
description = "basic description"
labels = {
my_first_label = "example-label-1"
my_second_label = "example-label-2"
}
project = "my-project-name"
serial_pipeline {
stages {
profiles = ["example-profile-one", "example-profile-two"]
target_id = "example-target-one"
}
stages {
profiles = []
target_id = "example-target-two"
}
}
provider = google-beta
}
```

## Argument Reference
Expand Down Expand Up @@ -116,10 +154,26 @@ The `stages` block supports:
(Optional)
Skaffold profiles to use when rendering the manifest for this stage's `Target`.

* `strategy` -
(Optional)
(Beta only) Optional. The strategy to use for a `Rollout` to this stage.

* `target_id` -
(Optional)
The target_id to which this stage points. This field refers exclusively to the last segment of a target name. For example, this field would just be `my-target` (rather than `projects/project/locations/location/targets/my-target`). The location of the `Target` is inferred to be the same as the location of the `DeliveryPipeline` that contains this `Stage`.

The `strategy` block supports:

* `standard` -
(Optional)
Standard deployment strategy executes a single deploy and allows verifying the deployment.

The `standard` block supports:

* `verify` -
(Optional)
Whether to verify a deployment.

## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:
Expand Down
50 changes: 50 additions & 0 deletions website/docs/r/clouddeploy_target.html.markdown
Expand Up @@ -23,6 +23,42 @@ description: |-

The Cloud Deploy `Target` resource

## Example Usage - run_target
tests creating and updating a cloud run target
```hcl
resource "google_clouddeploy_target" "primary" {
location = "us-west1"
name = "target"
annotations = {
my_first_annotation = "example-annotation-1"
my_second_annotation = "example-annotation-2"
}
description = "basic description"
execution_configs {
usages = ["RENDER", "DEPLOY"]
execution_timeout = "3600s"
}
labels = {
my_first_label = "example-label-1"
my_second_label = "example-label-2"
}
project = "my-project-name"
require_approval = false
run {
location = "projects/my-project-name/locations/us-west1"
}
provider = google-beta
}
```
## Example Usage - target
Creates a basic Cloud Deploy target
```hcl
Expand Down Expand Up @@ -103,6 +139,10 @@ The following arguments are supported:
(Optional)
Optional. Whether or not the `Target` requires approval.

* `run` -
(Optional)
(Beta only) Information specifying a Cloud Run deployment target.



The `anthos_cluster` block supports:
Expand All @@ -117,6 +157,10 @@ The `execution_configs` block supports:
(Optional)
Optional. Cloud Storage location in which to store execution outputs. This can either be a bucket ("gs://my-bucket") or a path within a bucket ("gs://my-bucket/my-dir"). If unspecified, a default bucket located in the same region will be used.

* `execution_timeout` -
(Optional)
Optional. Execution timeout for a Cloud Build Execution. This must be between 10m and 24h in seconds format. If unspecified, a default timeout of 1h is used.

* `service_account` -
(Optional)
Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) is used.
Expand All @@ -139,6 +183,12 @@ The `gke` block supports:
(Optional)
Optional. If true, `cluster` is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise. Only specify this option when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).

The `run` block supports:

* `location` -
(Required)
Required. The location where the Cloud Run Service should be located. Format is `projects/{project}/locations/{location}`.

## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/eventarc_trigger.html.markdown
Expand Up @@ -207,6 +207,9 @@ In addition to the arguments listed above, the following computed attributes are

* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/triggers/{{name}}`

* `conditions` -
Output only. The reason(s) why a trigger is in FAILED state.

* `create_time` -
Output only. The creation time.

Expand Down

0 comments on commit 81a1e16

Please sign in to comment.