From 2f1a60664ddf12ea55f3a19d1d5b062e0cebf020 Mon Sep 17 00:00:00 2001 From: The Magician Date: Wed, 7 Sep 2022 17:25:50 -0700 Subject: [PATCH] add connectionState to Apigee EndpointAttachment resource (#6459) (#12500) Signed-off-by: Modular Magician Signed-off-by: Modular Magician --- .changelog/6459.txt | 3 +++ google/resource_apigee_endpoint_attachment.go | 12 ++++++++++++ .../docs/r/apigee_endpoint_attachment.html.markdown | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 .changelog/6459.txt diff --git a/.changelog/6459.txt b/.changelog/6459.txt new file mode 100644 index 00000000000..af7d60c8a00 --- /dev/null +++ b/.changelog/6459.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +apigee: Added read-only field `connectionState` to `google_apigee_endpoint_attachment` +``` diff --git a/google/resource_apigee_endpoint_attachment.go b/google/resource_apigee_endpoint_attachment.go index 7dff464d5dc..a856b7055a9 100644 --- a/google/resource_apigee_endpoint_attachment.go +++ b/google/resource_apigee_endpoint_attachment.go @@ -65,6 +65,11 @@ in the format 'organizations/{{org_name}}'.`, ForceNew: true, Description: `Format: projects/*/regions/*/serviceAttachments/*`, }, + "connection_state": { + Type: schema.TypeString, + Computed: true, + Description: `State of the endpoint attachment connection to the service attachment.`, + }, "host": { Type: schema.TypeString, Computed: true, @@ -191,6 +196,9 @@ func resourceApigeeEndpointAttachmentRead(d *schema.ResourceData, meta interface if err := d.Set("service_attachment", flattenApigeeEndpointAttachmentServiceAttachment(res["serviceAttachment"], d, config)); err != nil { return fmt.Errorf("Error reading EndpointAttachment: %s", err) } + if err := d.Set("connection_state", flattenApigeeEndpointAttachmentConnectionState(res["connectionState"], d, config)); err != nil { + return fmt.Errorf("Error reading EndpointAttachment: %s", err) + } return nil } @@ -285,6 +293,10 @@ func flattenApigeeEndpointAttachmentServiceAttachment(v interface{}, d *schema.R return v } +func flattenApigeeEndpointAttachmentConnectionState(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + func expandApigeeEndpointAttachmentLocation(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { return v, nil } diff --git a/website/docs/r/apigee_endpoint_attachment.html.markdown b/website/docs/r/apigee_endpoint_attachment.html.markdown index 368e45efd5f..55269c8d7e7 100644 --- a/website/docs/r/apigee_endpoint_attachment.html.markdown +++ b/website/docs/r/apigee_endpoint_attachment.html.markdown @@ -108,6 +108,9 @@ In addition to the arguments listed above, the following computed attributes are * `host` - Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server. +* `connection_state` - + State of the endpoint attachment connection to the service attachment. + ## Timeouts