Skip to content

Commit

Permalink
add connectionState to Apigee EndpointAttachment resource (#6459) (#1…
Browse files Browse the repository at this point in the history
…2500)

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Sep 8, 2022
1 parent a0f1aaf commit 2f1a606
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/6459.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
apigee: Added read-only field `connectionState` to `google_apigee_endpoint_attachment`
```
12 changes: 12 additions & 0 deletions google/resource_apigee_endpoint_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/apigee_endpoint_attachment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2f1a606

Please sign in to comment.