Skip to content

Commit 13562f7

Browse files
akinrosslhercot
authored andcommitted
[minor_change] Migration of tenant into plugin framework
1 parent d71688a commit 13562f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2625
-215
lines changed

aci/provider.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ func Provider() *schema.Provider {
7777
},
7878

7979
ResourcesMap: map[string]*schema.Resource{
80-
"aci_tenant": resourceAciTenant(),
81-
"aci_application_profile": resourceAciApplicationProfile(),
8280
"aci_contract": resourceAciContract(),
8381
"aci_contract_subject": resourceAciContractSubject(),
8482
"aci_contract_subject_filter": resourceAciSubjectFilter(),
@@ -320,8 +318,6 @@ func Provider() *schema.Provider {
320318
},
321319

322320
DataSourcesMap: map[string]*schema.Resource{
323-
"aci_tenant": dataSourceAciTenant(),
324-
"aci_application_profile": dataSourceAciApplicationProfile(),
325321
"aci_contract": dataSourceAciContract(),
326322
"aci_contract_subject": dataSourceAciContractSubject(),
327323
"aci_contract_subject_filter": dataSourceAciSubjectFilter(),

docs/data-sources/tenant.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
# Documentation generated by "gen/generator.go"; DO NOT EDIT.
3+
# In order to regenerate this file execute `go generate` from the repository root.
4+
# More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md).
5+
subcategory: "Application Management"
6+
layout: "aci"
7+
page_title: "ACI: aci_tenant"
8+
sidebar_current: "docs-aci-data-source-aci_tenant"
9+
description: |-
10+
Data source for ACI Tenant
11+
---
12+
13+
# aci_tenant #
14+
15+
Data source for ACI Tenant
16+
17+
## API Information ##
18+
19+
* Class: [fvTenant](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvTenant/overview)
20+
21+
* Supported in ACI versions: 1.0(1e) and later.
22+
23+
* Distinguished Name Format: `uni/tn-{name}`
24+
25+
## GUI Information ##
26+
27+
* Location: `Tenants`
28+
29+
## Example Usage ##
30+
31+
```hcl
32+
33+
data "aci_tenant" "example" {
34+
name = "test_name"
35+
}
36+
37+
```
38+
39+
## Schema ##
40+
41+
### Required ###
42+
43+
* `name` (name) - (string) The name of the Tenant object.
44+
45+
### Read-Only ###
46+
47+
* `id` - (string) The distinguished name (DN) of the Tenant object.
48+
* `annotation` (annotation) - (string) The annotation of the Tenant object.
49+
* `description` (descr) - (string) The description of the Tenant object.
50+
* `name_alias` (nameAlias) - (string) The name alias of the Tenant object.
51+
* `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation.
52+
* `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object.
53+
* `relation_to_tenant_monitoring_policy` - (map) A map of Relation To Tenant Monitoring Policy (ACI object [fvRsTenantMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsTenantMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)).
54+
* `annotation` (annotation) - (string) The annotation of the Relation To Tenant Monitoring Policy object.
55+
* `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the monitoring policy.
56+
* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later.
57+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
58+
* `value` (value) - (string) The value of the property.
59+
* `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later.
60+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
61+
* `value` (value) - (string) The value of the property.
62+
* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later.
63+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
64+
* `value` (value) - (string) The value of the property.
65+
* `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). This attribute is supported in ACI versions: 3.2(1l) and later.
66+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
67+
* `value` (value) - (string) The value of the property.

docs/resources/tenant.md

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
# Documentation generated by "gen/generator.go"; DO NOT EDIT.
3+
# In order to regenerate this file execute `go generate` from the repository root.
4+
# More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md).
5+
subcategory: "Application Management"
6+
layout: "aci"
7+
page_title: "ACI: aci_tenant"
8+
sidebar_current: "docs-aci-resource-aci_tenant"
9+
description: |-
10+
Manages ACI Tenant
11+
---
12+
13+
# aci_tenant #
14+
15+
Manages ACI Tenant
16+
17+
18+
19+
## API Information ##
20+
21+
* Class: [fvTenant](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvTenant/overview)
22+
23+
* Supported in ACI versions: 1.0(1e) and later.
24+
25+
* Distinguished Name Format: `uni/tn-{name}`
26+
27+
## GUI Information ##
28+
29+
* Location: `Tenants`
30+
31+
## Example Usage ##
32+
33+
The configuration snippet below creates a Tenant with only required attributes.
34+
35+
```hcl
36+
37+
resource "aci_tenant" "example" {
38+
name = "test_name"
39+
}
40+
41+
```
42+
The configuration snippet below shows all possible attributes of the Tenant.
43+
44+
!> This example might not be valid configuration and is only used to show all possible attributes.
45+
46+
```hcl
47+
48+
resource "aci_tenant" "full_example" {
49+
annotation = "annotation"
50+
description = "description_1"
51+
name = "test_name"
52+
name_alias = "name_alias_1"
53+
owner_key = "owner_key_1"
54+
owner_tag = "owner_tag_1"
55+
relation_to_tenant_monitoring_policy = {
56+
annotation = "annotation_1"
57+
monitoring_policy_name = aci_monitoring_policy.example.name
58+
annotations = [
59+
{
60+
key = "key_0"
61+
value = "value_1"
62+
}
63+
]
64+
tags = [
65+
{
66+
key = "key_0"
67+
value = "value_1"
68+
}
69+
]
70+
}
71+
annotations = [
72+
{
73+
key = "key_0"
74+
value = "value_1"
75+
}
76+
]
77+
tags = [
78+
{
79+
key = "key_0"
80+
value = "value_1"
81+
}
82+
]
83+
}
84+
85+
```
86+
87+
All examples for the Tenant resource can be found in the [examples](https://github.com/CiscoDevNet/terraform-provider-aci/tree/master/examples/resources/aci_tenant) folder.
88+
89+
## Schema ##
90+
91+
### Required ###
92+
93+
* `name` (name) - (string) The name of the Tenant object.
94+
95+
### Read-Only ###
96+
97+
* `id` - (string) The distinguished name (DN) of the Tenant object.
98+
99+
### Optional ###
100+
101+
* `annotation` (annotation) - (string) The annotation of the Tenant object.
102+
- Default: `orchestrator:terraform`
103+
* `description` (descr) - (string) The description of the Tenant object.
104+
* `name_alias` (nameAlias) - (string) The name alias of the Tenant object.
105+
* `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation.
106+
* `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object.
107+
* `relation_to_tenant_monitoring_policy` - (map) A map of Relation To Tenant Monitoring Policy (ACI object [fvRsTenantMonPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsTenantMonPol/overview)) pointing to Monitoring Policy (ACI Object [monEPGPol](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/monEPGPol/overview)) which can be configured using the [aci_monitoring_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/monitoring_policy) resource.
108+
#### Optional ####
109+
110+
* `annotation` (annotation) - (string) The annotation of the Relation To Tenant Monitoring Policy object.
111+
- Default: `orchestrator:terraform`
112+
* `monitoring_policy_name` (tnMonEPGPolName) - (string) The name of the monitoring policy.
113+
* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later.
114+
#### Required ####
115+
116+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
117+
* `value` (value) - (string) The value of the property.
118+
* `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later.
119+
#### Required ####
120+
121+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
122+
* `value` (value) - (string) The value of the property.
123+
* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later.
124+
#### Required ####
125+
126+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
127+
* `value` (value) - (string) The value of the property.
128+
* `tags` - (list) A list of Tags (ACI object [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview)). Tags can also be configured using a separate [aci_tag](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/tag) resource. This attribute is supported in ACI versions: 3.2(1l) and later.
129+
#### Required ####
130+
131+
* `key` (key) - (string) The key used to uniquely identify this configuration object.
132+
* `value` (value) - (string) The value of the property.
133+
134+
## Importing
135+
136+
An existing Tenant can be [imported](https://www.terraform.io/docs/import/index.html) into this resource with its distinguished name (DN), via the following command:
137+
138+
```
139+
terraform import aci_tenant.example uni/tn-{name}
140+
```
141+
142+
Starting in Terraform version 1.5, an existing Tenant can be imported
143+
using [import blocks](https://developer.hashicorp.com/terraform/language/import) via the following configuration:
144+
145+
```
146+
import {
147+
id = "uni/tn-{name}"
148+
to = aci_tenant.example
149+
}
150+
```
151+
152+
## Child Resources
153+
154+
- [aci_application_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_profile)
155+
- [aci_bridge_domain](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/bridge_domain)
156+
- [aci_certificate_store](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/certificate_store)
157+
- [aci_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract)
158+
- [aci_dhcp_relay_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/dhcp_relay_policy)
159+
- [aci_end_point_retention_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/end_point_retention_policy)
160+
- [aci_filter](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/filter)
161+
- [aci_igmp_snooping_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/igmp_snooping_policy)
162+
- [aci_imported_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/imported_contract)
163+
- [aci_l3_outside](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/l3_outside)
164+
- [aci_mld_snooping_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/mld_snooping_policy)
165+
- [aci_monitoring_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/monitoring_policy)
166+
- [aci_neighbor_discovery_interface_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/neighbor_discovery_interface_policy)
167+
- [aci_netflow_exporter_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_exporter_policy)
168+
- [aci_netflow_monitor_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_monitor_policy)
169+
- [aci_netflow_record_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/netflow_record_policy)
170+
- [aci_out_of_band_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract)
171+
- [aci_pim_route_map_policy](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/pim_route_map_policy)
172+
- [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile)
173+
- [aci_taboo_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/taboo_contract)
174+
- [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
data "aci_tenant" "example" {
3+
name = "test_name"
4+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
terraform {
2+
required_providers {
3+
aci = {
4+
source = "ciscodevnet/aci"
5+
}
6+
}
7+
}
8+
9+
provider "aci" {
10+
username = ""
11+
password = ""
12+
url = ""
13+
insecure = true
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
terraform {
2+
required_providers {
3+
aci = {
4+
source = "ciscodevnet/aci"
5+
}
6+
}
7+
}
8+
9+
provider "aci" {
10+
username = ""
11+
password = ""
12+
url = ""
13+
insecure = true
14+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
resource "aci_tenant" "full_example" {
3+
annotation = "annotation"
4+
description = "description_1"
5+
name = "test_name"
6+
name_alias = "name_alias_1"
7+
owner_key = "owner_key_1"
8+
owner_tag = "owner_tag_1"
9+
relation_to_tenant_monitoring_policy = {
10+
annotation = "annotation_1"
11+
monitoring_policy_name = aci_monitoring_policy.example.name
12+
annotations = [
13+
{
14+
key = "key_0"
15+
value = "value_1"
16+
}
17+
]
18+
tags = [
19+
{
20+
key = "key_0"
21+
value = "value_1"
22+
}
23+
]
24+
}
25+
annotations = [
26+
{
27+
key = "key_0"
28+
value = "value_1"
29+
}
30+
]
31+
tags = [
32+
{
33+
key = "key_0"
34+
value = "value_1"
35+
}
36+
]
37+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
resource "aci_tenant" "example" {
3+
name = "test_name"
4+
}

gen/definitions/classes.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ global:
88
fvTenant:
99
resource_name: "tenant"
1010
resource_identifier: "tn"
11+
exclude_children:
12+
- "cloudCertStore"
13+
ui_locations:
14+
- "Tenants"
15+
sub_category: "Application Management"
16+
migration_version: 1
17+
migration_blocks:
18+
fvRsTenantMonPol:
19+
relation_fv_rs_tenant_mon_pol: relation_to_tenant_monitoring_policy.monitoring_policy_name
20+
21+
fvRsTenantMonPol:
22+
resource_name: "relation_to_tenant_monitoring_policy"
1123

1224
fvAEPg:
1325
resource_name: "application_epg"

0 commit comments

Comments
 (0)