-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2019 VMware, Inc. | ||
// SPDX-License-Identifier: Mozilla Public License 2.0 | ||
|
||
package avi | ||
|
||
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
|
||
func dataSourceAviTrustedHostProfile() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: ResourceAviTrustedHostProfileRead, | ||
Schema: map[string]*schema.Schema{ | ||
"configpb_attributes": { | ||
Type: schema.TypeSet, | ||
Computed: true, | ||
Elem: ResourceConfigPbAttributesSchema(), | ||
}, | ||
"host_list": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"name": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
}, | ||
"tenant_ref": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
}, | ||
"uuid": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// Copyright 2019 VMware, Inc. | ||
// SPDX-License-Identifier: Mozilla Public License 2.0 | ||
|
||
package avi | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"log" | ||
) | ||
|
||
func ResourceTrustedHostProfileSchema() map[string]*schema.Schema { | ||
return map[string]*schema.Schema{ | ||
"configpb_attributes": { | ||
Type: schema.TypeSet, | ||
Optional: true, | ||
Computed: true, | ||
Elem: ResourceConfigPbAttributesSchema(), | ||
}, | ||
"host_list": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, | ||
"name": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, | ||
"tenant_ref": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
}, | ||
"uuid": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Computed: true, | ||
}, | ||
} | ||
} | ||
|
||
func resourceAviTrustedHostProfile() *schema.Resource { | ||
return &schema.Resource{ | ||
Create: resourceAviTrustedHostProfileCreate, | ||
Read: ResourceAviTrustedHostProfileRead, | ||
Update: resourceAviTrustedHostProfileUpdate, | ||
Delete: resourceAviTrustedHostProfileDelete, | ||
Schema: ResourceTrustedHostProfileSchema(), | ||
Importer: &schema.ResourceImporter{ | ||
State: ResourceTrustedHostProfileImporter, | ||
}, | ||
} | ||
} | ||
|
||
func ResourceTrustedHostProfileImporter(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { | ||
s := ResourceTrustedHostProfileSchema() | ||
return ResourceImporter(d, m, "trustedhostprofile", s) | ||
} | ||
|
||
func ResourceAviTrustedHostProfileRead(d *schema.ResourceData, meta interface{}) error { | ||
s := ResourceTrustedHostProfileSchema() | ||
err := APIRead(d, meta, "trustedhostprofile", s) | ||
if err != nil { | ||
log.Printf("[ERROR] in reading object %v\n", err) | ||
} | ||
return err | ||
} | ||
|
||
func resourceAviTrustedHostProfileCreate(d *schema.ResourceData, meta interface{}) error { | ||
s := ResourceTrustedHostProfileSchema() | ||
err := APICreate(d, meta, "trustedhostprofile", s) | ||
if err == nil { | ||
err = ResourceAviTrustedHostProfileRead(d, meta) | ||
} | ||
return err | ||
} | ||
|
||
func resourceAviTrustedHostProfileUpdate(d *schema.ResourceData, meta interface{}) error { | ||
s := ResourceTrustedHostProfileSchema() | ||
var err error | ||
err = APIUpdate(d, meta, "trustedhostprofile", s) | ||
if err == nil { | ||
err = ResourceAviTrustedHostProfileRead(d, meta) | ||
} | ||
return err | ||
} | ||
|
||
func resourceAviTrustedHostProfileDelete(d *schema.ResourceData, meta interface{}) error { | ||
var err error | ||
if APIDeleteSystemDefaultCheck(d) { | ||
return nil | ||
} | ||
err = APIDelete(d, meta, "trustedhostprofile") | ||
if err != nil { | ||
log.Printf("[ERROR] in deleting object %v\n", err) | ||
} | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- | ||
Copyright 2021 VMware, Inc. | ||
SPDX-License-Identifier: Mozilla Public License 2.0 | ||
--> | ||
--- | ||
layout: "avi" | ||
page_title: "AVI: avi_trustedhostprofile" | ||
sidebar_current: "docs-avi-datasource-trustedhostprofile" | ||
description: |- | ||
Get information of Avi TrustedHostProfile. | ||
--- | ||
|
||
# avi_trustedhostprofile | ||
|
||
This data source is used to to get avi_trustedhostprofile objects. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "avi_trustedhostprofile" "foo_trustedhostprofile" { | ||
uuid = "trustedhostprofile-f9cf6b3e-a411-436f-95e2-2982ba2b217b" | ||
name = "foo" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* `name` - (Optional) Search TrustedHostProfile by name. | ||
* `uuid` - (Optional) Search TrustedHostProfile by uuid. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `configpb_attributes` - Protobuf versioning for config pbs. Field introduced in 31.1.1. Allowed in enterprise edition with any value, essentials edition with any value, basic edition with any value, enterprise with cloud services edition. | ||
* `host_list` - List of host ip(v4/v6) addresses or fqdns. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
* `name` - Trustedhostprofile name. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
* `tenant_ref` - Tenant ref for trusted host profile. It is a reference to an object of type tenant. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
* `uuid` - Trustedhostprofile uuid. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!-- | ||
Copyright 2021 VMware, Inc. | ||
SPDX-License-Identifier: Mozilla Public License 2.0 | ||
--> | ||
--- | ||
layout: "avi" | ||
page_title: "Avi: avi_trustedhostprofile" | ||
sidebar_current: "docs-avi-resource-trustedhostprofile" | ||
description: |- | ||
Creates and manages Avi TrustedHostProfile. | ||
--- | ||
|
||
# avi_trustedhostprofile | ||
|
||
The TrustedHostProfile resource allows the creation and management of Avi TrustedHostProfile | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "avi_trustedhostprofile" "foo" { | ||
name = "terraform-example-foo" | ||
tenant_ref = "/api/tenant/?name=admin" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `host_list` - (Required) List of host ip(v4/v6) addresses or fqdns. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
* `name` - (Required) Trustedhostprofile name. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
* `configpb_attributes` - (Optional) Protobuf versioning for config pbs. Field introduced in 31.1.1. Allowed in enterprise edition with any value, essentials edition with any value, basic edition with any value, enterprise with cloud services edition. | ||
* `tenant_ref` - (Optional) Tenant ref for trusted host profile. It is a reference to an object of type tenant. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
|
||
|
||
### Timeouts | ||
|
||
The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: | ||
|
||
* `create` - (Defaults to 40 mins) Used when creating the AMI | ||
* `update` - (Defaults to 40 mins) Used when updating the AMI | ||
* `delete` - (Defaults to 90 mins) Used when deregistering the AMI | ||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `uuid` - Trustedhostprofile uuid. Field introduced in 31.1.1. Allowed in enterprise edition with any value, enterprise with cloud services edition. | ||
|