Skip to content

Commit

Permalink
[ignore] Changes made to docs to accommodate target_dn
Browse files Browse the repository at this point in the history
  • Loading branch information
shrsr committed Apr 24, 2024
1 parent 38b4fc7 commit d66746d
Show file tree
Hide file tree
Showing 33 changed files with 256 additions and 302 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ data "aci_annotation" "example_application_epg" {
### Required ###

* `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources:
- Too many parent DNs to display, see model documentation for all possible parents of [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview).
- [aci_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) ([fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview))
- [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) ([fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview))
- [aci_endpoint_tag_ip](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/endpoint_tag_ip) ([fvEpIpTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEpIpTag/overview))
Expand All @@ -74,7 +75,6 @@ data "aci_annotation" "example_application_epg" {
- [aci_certificate_authority](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/certificate_authority) ([pkiTP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiTP/overview))
- [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) ([rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview))
- [aci_contract_interface](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract_interface) ([vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview))
- [aci_out_of_band_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract) ([vzOOBBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzOOBBrCP/overview))
* `key` (key) - (string) The key used to uniquely identify this configuration object.

### Read-Only ###
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/relation_to_fallback_route_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Data source for Relation To Fallback Route Group
data "aci_relation_to_fallback_route_group" "example_l3_outside" {
parent_dn = aci_l3_outside.example.id
target_dn = aci_vrf_fallback_route_group.test.id
target_dn = "aci_vrf_fallback_route_group.test.id"
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ data "aci_tag" "example_application_epg" {
### Required ###

* `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources:
- Too many parent DNs to display, see model documentation for all possible parents of [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview).
- [aci_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) ([fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview))
- [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) ([fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview))
- [aci_endpoint_tag_ip](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/endpoint_tag_ip) ([fvEpIpTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEpIpTag/overview))
Expand All @@ -74,7 +75,6 @@ data "aci_tag" "example_application_epg" {
- [aci_certificate_authority](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/certificate_authority) ([pkiTP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiTP/overview))
- [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) ([rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview))
- [aci_contract_interface](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract_interface) ([vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview))
- [aci_out_of_band_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract) ([vzOOBBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzOOBBrCP/overview))
* `key` (key) - (string) The key used to uniquely identify this configuration object.

### Read-Only ###
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ All examples for the Annotation resource can be found in the [examples](https://
### Required ###

* `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources:
- Too many parent DNs to display, see model documentation for all possible parents of [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview).
- [aci_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) ([fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview))
- [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) ([fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview))
- [aci_endpoint_tag_ip](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/endpoint_tag_ip) ([fvEpIpTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEpIpTag/overview))
Expand All @@ -83,7 +84,6 @@ All examples for the Annotation resource can be found in the [examples](https://
- [aci_certificate_authority](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/certificate_authority) ([pkiTP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiTP/overview))
- [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) ([rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview))
- [aci_contract_interface](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract_interface) ([vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview))
- [aci_out_of_band_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract) ([vzOOBBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzOOBBrCP/overview))
* `key` (key) - (string) The key used to uniquely identify this configuration object.
* `value` (value) - (string) The value of the property.

Expand Down
6 changes: 3 additions & 3 deletions docs/resources/relation_to_fallback_route_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The configuration snippet below creates a Relation To Fallback Route Group with
resource "aci_relation_to_fallback_route_group" "example_l3_outside" {
parent_dn = aci_l3_outside.example.id
target_dn = aci_vrf_fallback_route_group.test.id
target_dn = "aci_vrf_fallback_route_group.test.id"
}
```
Expand All @@ -49,7 +49,7 @@ The configuration snippet below shows all possible attributes of the Relation To
resource "aci_relation_to_fallback_route_group" "full_example_l3_outside" {
parent_dn = aci_l3_outside.example.id
annotation = "annotation"
target_dn = aci_vrf_fallback_route_group.test.id
target_dn = "aci_vrf_fallback_route_group.test.id"
annotations = [
{
key = "key_0"
Expand Down Expand Up @@ -81,7 +81,7 @@ All examples for the Relation To Fallback Route Group resource can be found in t
* `id` - (string) The distinguished name (DN) of the Relation To Fallback Route Group object.

### Optional ###

* `annotation` (annotation) - (string) The annotation of the Relation To Fallback Route Group object.
- Default: `orchestrator:terraform`

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ All examples for the Tag resource can be found in the [examples](https://github.
### Required ###

* `parent_dn` - (string) The distinguished name (DN) of the parent object, possible resources:
- Too many parent DNs to display, see model documentation for all possible parents of [tagTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagTag/overview).
- [aci_application_epg](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/application_epg) ([fvAEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvAEPg/overview))
- [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) ([fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview))
- [aci_endpoint_tag_ip](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/endpoint_tag_ip) ([fvEpIpTag](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEpIpTag/overview))
Expand All @@ -83,7 +84,6 @@ All examples for the Tag resource can be found in the [examples](https://github.
- [aci_certificate_authority](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/certificate_authority) ([pkiTP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/pkiTP/overview))
- [aci_route_control_profile](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/route_control_profile) ([rtctrlProfile](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/rtctrlProfile/overview))
- [aci_contract_interface](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/contract_interface) ([vzCPIf](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzCPIf/overview))
- [aci_out_of_band_contract](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/out_of_band_contract) ([vzOOBBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzOOBBrCP/overview))
* `key` (key) - (string) The key used to uniquely identify this configuration object.
* `value` (value) - (string) The value of the property.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

data "aci_relation_to_fallback_route_group" "example_l3_outside" {
parent_dn = aci_l3_outside.example.id
target_dn = aci_vrf_fallback_route_group.test.id
target_dn = "aci_vrf_fallback_route_group.test.id"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resource "aci_relation_to_fallback_route_group" "full_example_l3_outside" {
parent_dn = aci_l3_outside.example.id
annotation = "annotation"
target_dn = aci_vrf_fallback_route_group.test.id
target_dn = "aci_vrf_fallback_route_group.test.id"
annotations = [
{
key = "key_0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

resource "aci_relation_to_fallback_route_group" "example_l3_outside" {
parent_dn = aci_l3_outside.example.id
target_dn = aci_vrf_fallback_route_group.test.id
target_dn = "aci_vrf_fallback_route_group.test.id"
}
6 changes: 3 additions & 3 deletions gen/definitions/properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ l3extRsOutToFBRGroup:
tDn: "The distinguished name of the VRF Fallback Route Group object."
test_values:
resource_required:
target_dn: aci_vrf_fallback_route_group.test.id
target_dn: "aci_vrf_fallback_route_group.test.id"
datasource_required:
target_dn: aci_vrf_fallback_route_group.test.id
target_dn: "aci_vrf_fallback_route_group.test.id"
datasource_non_existing:
target_dn: aci_vrf_fallback_route_group.test.id
target_dn: "aci_vrf_fallback_route_group.test.id"
parents:
- class_name: "l3extOut"
parent_dependency: "fvTenant"
Expand Down
43 changes: 3 additions & 40 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ func LookupTestValue(classPkgName, propertyName string, testVars map[string]inte
if strVal, ok := val.(string); ok {
if isMultiLine(propertyName, classPkgName, definitions) {
lookupValue = processMultiLine(strVal)
} else if strings.Contains(strVal, "_dn") {
fmt.Println(propertyName, strVal)
lookupValue = fmt.Sprintf(`%s`, strVal)
} else {
lookupValue = fmt.Sprintf(`"%s"`, strVal)
}
Expand Down Expand Up @@ -855,48 +858,8 @@ type Model struct {
DnFormats []interface{}
TargetProperties map[string]Property
TargetNamedProperties map[string]Property
Properties map[string]Property
NamedProperties map[string]Property
Children map[string]Model
Configuration map[string]interface{}
TestVars map[string]interface{}
Definitions Definitions
ResourceNameAsDescription string
PkgName string
Label string
Name string
RnFormat string
RnPrepend string
Comment string
ResourceClassName string
ResourceName string
ResourceNameDocReference string
ChildResourceName string
ExampleDataSource string
ExampleResource string
ExampleResourceFull string
SubCategory string
RelationshipClass string
RelationshipResourceName string
Versions string
TestType []TestClassification
ChildClasses []string
ContainedBy []string
Contains []string
DocumentationDnFormats []string
DocumentationParentDns []string
DocumentationExamples []string
DocumentationChildren []string
ResourceNotes []string
ResourceWarnings []string
DatasourceNotes []string
DatasourceWarnings []string
Parents []string
UiLocations []string
RnFormatMap map[string]string
RnFormatMapWithWrapperClass map[string]string
IdentifiedBy []interface{}
DnFormats []interface{}
PlatformFlavors map[string][]interface{}
MultiParentFormats map[string]MultiParentFormat
MultiParentFormatsTestTypes map[string]string
Expand Down
33 changes: 8 additions & 25 deletions gen/templates/resource_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ PreCheck: func() {
{{- end }}
{{- end }}
{{- end}}
{{- range $key, $value := $.default}}{{$contains := definedInMap $key $.resource_required}}
{{- if not $contains}}
resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"),
{{- end}}
{{- end}}
{{- if $.resource_required }}
{{- range $key, $value := $.default}}{{$contains := definedInMap $key $.resource_required}}
{{- if not $contains}}
Expand Down Expand Up @@ -596,14 +591,14 @@ const testConfig{{$.resourceClassName}}MinDependencyWith{{capitalize .class_name
resource "aci_{{$.resourceName}}" "test" {
{{- if ne .parent_dn ""}}
parent_dn = {{.parent_dn}}
{{- end}}
{{- range $key, $value := $.resource_required}}
{{- if eq $key "target_dn" }}
{{$key}} = {{$value}}
{{- else }}
{{$key}} = "{{$value}}"
{{- end }}
{{- end}}
{{- end}}
}
`

Expand All @@ -622,13 +617,8 @@ resource "aci_{{$.resourceName}}" "test" {
{{- end}}
{{- end}}
{{- range $key, $value := $.all}}
{{- if or (contains $value "<<EOT -----BEGIN_CERTIFICATE-----") ( contains $value "<<EOT -----BEGIN_PRIVATE_KEY-----") }}
{{$key}} = {{ $value | spaceToNewLine }}
{{- else}}
{{- if not (definedInList $.exclude_attributes $key) }}
{{$key}} = "{{$value}}"
{{- end}}
{{- end}}
}
`

Expand All @@ -647,10 +637,6 @@ resource "aci_{{$.resourceName}}" "test" {
{{- end}}
{{- end}}
{{- range $key, $value := $.default}}
{{- if or (contains $value "<<EOT -----BEGIN_CERTIFICATE-----") ( contains $value "<<EOT -----BEGIN_PRIVATE_KEY-----") }}
{{$key}} = {{ $value | spaceToNewLine }}
{{- else}}
{{- if not (definedInList $.exclude_attributes $key) }}
{{$key}} = "{{$value}}"
{{- end}}
}
Expand Down Expand Up @@ -702,7 +688,7 @@ const testConfig{{$.resourceClassName}}ChildrenRemoveOneDependencyWith{{capitali
resource "aci_{{$.resourceName}}" "test" {
{{- if ne .parent_dn ""}}
parent_dn = {{.parent_dn}}
{{- end}}
{{- end}}
{{- range $key, $value := $.resource_required}}
{{- if eq $key "target_dn" }}
{{$key}} = {{$value}}
Expand All @@ -712,13 +698,13 @@ resource "aci_{{$.resourceName}}" "test" {
{{- end}}
{{- range $key, $value := $.children}}
{{$key}} = [ {{$child := index $value 1 }}
{
{
{{- range $child_key, $child_value := $child}}
{{$child_key}} = "{{$child_value}}"
{{- end}}
},
},
]
{{- end}}
{{- end}}
}
`

Expand Down Expand Up @@ -752,8 +738,7 @@ resource "aci_{{$.resourceName}}" "test" {

const testConfig{{.resourceClassName}}All = `
resource "aci_{{$.resourceName}}" "test" {
{{- range $key, $value := $.resource_required}}
{{- $contains := definedInMap $key $.all}}
{{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.all}}
{{- if not $contains}}
{{$key}} = "{{$value}}"
{{- end}}
Expand All @@ -766,8 +751,7 @@ resource "aci_{{$.resourceName}}" "test" {

const testConfig{{.resourceClassName}}Reset = `
resource "aci_{{$.resourceName}}" "test" {
{{- range $key, $value := $.resource_required}}
{{- $contains := definedInMap $key $.default}}
{{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.default}}
{{- if not $contains}}
{{$key}} = "{{$value}}"
{{- end}}
Expand Down Expand Up @@ -812,8 +796,7 @@ resource "aci_{{$.resourceName}}" "test" {
{{$key}} = "{{$value}}"
{{- end}}
{{- range $key, $value := $.children}}
{{$key}} = [
{{- $child := index $value 1}}
{{$key}} = [ {{$child := index $value 1 }}
{
{{- range $child_key, $child_value := $child}}
{{$child_key}} = "{{$child_value}}"
Expand Down
2 changes: 1 addition & 1 deletion gen/templates/testvars.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ parents:
{{- else -}}
test_type: {{$testType}}
{{- end}}
{{- end}}
{{- end}}

{{- $index := 0}}{{- $key := .TargetResourceClassName}}
{{- if ne $key "" }}
Expand Down
1 change: 1 addition & 0 deletions gen/testvars/l3extRsOutToFBRGroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ parents:
parent_dependency: "fvTenant"
parent_dn: "aci_l3_outside.test.id"
class_in_parent: false
test_type: apic

targets:
- class_name: "fvFBRGroup"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions internal/provider/resource_aci_certificate_authority.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d66746d

Please sign in to comment.