Skip to content

Commit 355a01f

Browse files
Staging (#145)
* CACIT-71 inline block added * CACIT-72 attribute renamed * CACIT-72 docs updated * CACIT-74 resource ds added * CACIT-75 logic added * CACIT-74 test file added * CACIT-76 parent_dn logic added * CACIT-77 logic added for ctrl * CACIT-77 docs and test file updated * CACIT-79 resource aaaDomain added * CACIT-78 index.html updated * removed relation * CACIT-83 made scope attr as list * Cacit 82 83 84 85 (#143) * CACIT-85 TGW in ctxProfile * CACIT-85 TGW in ctxProfile * CACIT-84 cloudSubnet zone update * CACIT-85 done * CACIT-85 fomatting Done * CACIT-71 inline block added * CACIT-72 attribute renamed * CACIT-72 docs updated * CACIT-74 resource ds added * CACIT-75 logic added * CACIT-74 test file added * CACIT-76 parent_dn logic added * CACIT-77 logic added for ctrl * CACIT-77 docs and test file updated * CACIT-79 resource aaaDomain added * CACIT-78 index.html updated * removed relation * CACIT-83 made scope attr as list * Cacit 82 83 84 85 (#143) * CACIT-85 TGW in ctxProfile * CACIT-85 TGW in ctxProfile * CACIT-84 cloudSubnet zone update * CACIT-85 done * CACIT-85 fomatting Done * Done
1 parent 8f18d89 commit 355a01f

File tree

167 files changed

+2638
-269
lines changed

Some content is hidden

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

167 files changed

+2638
-269
lines changed

aci/data_source_aci_aaadomain.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package aci
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/ciscoecosystem/aci-go-client/client"
7+
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
8+
)
9+
10+
func dataSourceAciSecurityDomain() *schema.Resource {
11+
return &schema.Resource{
12+
13+
Read: dataSourceAciSecurityDomainRead,
14+
15+
SchemaVersion: 1,
16+
17+
Schema: AppendBaseAttrSchema(map[string]*schema.Schema{
18+
19+
"name": &schema.Schema{
20+
Type: schema.TypeString,
21+
Required: true,
22+
},
23+
24+
"name_alias": &schema.Schema{
25+
Type: schema.TypeString,
26+
Optional: true,
27+
Computed: true,
28+
},
29+
}),
30+
}
31+
}
32+
33+
func dataSourceAciSecurityDomainRead(d *schema.ResourceData, m interface{}) error {
34+
aciClient := m.(*client.Client)
35+
36+
name := d.Get("name").(string)
37+
38+
rn := fmt.Sprintf("userext/domain-%s", name)
39+
40+
dn := fmt.Sprintf("uni/%s", rn)
41+
42+
aaaDomain, err := getRemoteSecurityDomain(aciClient, dn)
43+
44+
if err != nil {
45+
return err
46+
}
47+
setSecurityDomainAttributes(aaaDomain, d)
48+
return nil
49+
}

aci/data_source_aci_aaausercert.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func dataSourceAciX509CertificateRead(d *schema.ResourceData, m interface{}) err
5555
if err != nil {
5656
return err
5757
}
58+
d.SetId(dn)
5859
setX509CertificateAttributes(aaaUserCert, d)
5960
return nil
6061
}

aci/data_source_aci_cloudapp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func dataSourceAciCloudApplicationcontainerRead(d *schema.ResourceData, m interf
4949
if err != nil {
5050
return err
5151
}
52+
d.SetId(dn)
5253
setCloudApplicationcontainerAttributes(cloudApp, d)
5354
return nil
5455
}

aci/data_source_aci_cloudawsprovider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func dataSourceAciCloudAWSProviderRead(d *schema.ResourceData, m interface{}) er
9696
if err != nil {
9797
return err
9898
}
99+
d.SetId(dn)
99100
setCloudAWSProviderAttributes(cloudAwsProvider, d)
100101
return nil
101102
}

aci/data_source_aci_cloudcidr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func dataSourceAciCloudCIDRPoolRead(d *schema.ResourceData, m interface{}) error
5555
if err != nil {
5656
return err
5757
}
58+
d.SetId(dn)
5859
setCloudCIDRPoolAttributes(cloudCidr, d)
5960
return nil
6061
}

aci/data_source_aci_cloudctxprofile.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package aci
22

33
import (
44
"fmt"
5+
56
"github.com/ciscoecosystem/aci-go-client/client"
67
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
78
)
@@ -42,6 +43,7 @@ func dataSourceAciCloudContextProfileRead(d *schema.ResourceData, m interface{})
4243
if err != nil {
4344
return err
4445
}
46+
d.SetId(dn)
4547
setCloudContextProfileAttributes(cloudCtxProfile, d)
4648
return nil
4749
}

aci/data_source_aci_cloudepg.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func dataSourceAciCloudEPgRead(d *schema.ResourceData, m interface{}) error {
7979
if err != nil {
8080
return err
8181
}
82+
d.SetId(dn)
8283
setCloudEPgAttributes(cloudEPg, d)
8384
return nil
8485
}

aci/data_source_aci_cloudepselector.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func dataSourceAciCloudEndpointSelectorRead(d *schema.ResourceData, m interface{
5555
if err != nil {
5656
return err
5757
}
58+
d.SetId(dn)
5859
setCloudEndpointSelectorAttributes(cloudEPSelector, d)
5960
return nil
6061
}

aci/data_source_aci_cloudextepg.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func dataSourceAciCloudExternalEPgRead(d *schema.ResourceData, m interface{}) er
8585
if err != nil {
8686
return err
8787
}
88+
d.SetId(dn)
8889
setCloudExternalEPgAttributes(cloudExtEPg, d)
8990
return nil
9091
}

aci/data_source_aci_cloudextepselector.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func dataSourceAciCloudEndpointSelectorforExternalEPgsRead(d *schema.ResourceDat
6767
if err != nil {
6868
return err
6969
}
70+
d.SetId(dn)
7071
setCloudEndpointSelectorforExternalEPgsAttributes(cloudExtEPSelector, d)
7172
return nil
7273
}

0 commit comments

Comments
 (0)