Skip to content

Commit ce062d6

Browse files
authored
feat: Implement LIST functionality for domain mapping resource (#222)
2 parents da5e24c + 4c6e4fe commit ce062d6

File tree

9 files changed

+713
-6
lines changed

9 files changed

+713
-6
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "scc_domain_mapping List Resource - SAP Cloud Connector"
4+
subcategory: ""
5+
description: |-
6+
SAP Cloud Connector Domain mapping list resource.
7+
This list resource retrieves all domain mappings for a specific region_host and subaccount
8+
accessible via the configured SAP Cloud Connector instance.
9+
---
10+
11+
# scc_domain_mapping (List Resource)
12+
13+
SAP Cloud Connector **Domain mapping** list resource.
14+
15+
This list resource retrieves all domain mappings for a specific region_host and subaccount
16+
accessible via the configured SAP Cloud Connector instance.
17+
18+
## Example Usage
19+
20+
```terraform
21+
# This feature requires Terraform v1.14.0 or later (Stable as of 2026)
22+
# List resources must be defined in .tfquery.hcl files.
23+
24+
# Generic template for a list block
25+
list "scc_domain_mapping" "<label_name>" {
26+
# (Required) Provider instance to use
27+
provider = provider_name
28+
29+
# Filter configuration defined by the provider
30+
config {
31+
# Provider-specific filter arguments...
32+
}
33+
}
34+
35+
# List block to discover all SCC domain mappings
36+
# Returns only the resource identities (IDs/Labels) by default.
37+
list "scc_domain_mapping" "all" {
38+
provider = scc
39+
40+
# (Required)
41+
config {
42+
region_host = "cf.us10.hana.ondemand.com"
43+
subaccount = "3ecb7280-c7d4-4db6-b7da-7af3cdb13505"
44+
}
45+
}
46+
47+
# List block to discover SCC domain mapping with full resource details
48+
# Setting include_resource = true returns full resource objects (e.g., virtual_domain)
49+
list "scc_domain_mapping" "with_resource" {
50+
provider = scc
51+
include_resource = true
52+
53+
# (Required)
54+
config {
55+
region_host = "cf.us10.hana.ondemand.com"
56+
subaccount = "3ecb7280-c7d4-4db6-b7da-7af3cdb13505"
57+
}
58+
}
59+
```
60+
61+
<!-- schema generated by tfplugindocs -->
62+
## Schema
63+
64+
### Required
65+
66+
- `region_host` (String) The host URL of the region (e.g., cf.us10.hana.ondemand.com).
67+
- `subaccount` (String) The GUID of the SAP subaccount.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This feature requires Terraform v1.14.0 or later (Stable as of 2026)
2+
# List resources must be defined in .tfquery.hcl files.
3+
4+
# Generic template for a list block
5+
list "scc_domain_mapping" "<label_name>" {
6+
# (Required) Provider instance to use
7+
provider = provider_name
8+
9+
# Filter configuration defined by the provider
10+
config {
11+
# Provider-specific filter arguments...
12+
}
13+
}
14+
15+
# List block to discover all SCC domain mappings
16+
# Returns only the resource identities (IDs/Labels) by default.
17+
list "scc_domain_mapping" "all" {
18+
provider = scc
19+
20+
# (Required)
21+
config {
22+
region_host = "cf.us10.hana.ondemand.com"
23+
subaccount = "3ecb7280-c7d4-4db6-b7da-7af3cdb13505"
24+
}
25+
}
26+
27+
# List block to discover SCC domain mapping with full resource details
28+
# Setting include_resource = true returns full resource objects (e.g., virtual_domain)
29+
list "scc_domain_mapping" "with_resource" {
30+
provider = scc
31+
include_resource = true
32+
33+
# (Required)
34+
config {
35+
region_host = "cf.us10.hana.ondemand.com"
36+
subaccount = "3ecb7280-c7d4-4db6-b7da-7af3cdb13505"
37+
}
38+
}
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
---
2+
version: 2
3+
interactions:
4+
- id: 0
5+
request:
6+
proto: HTTP/1.1
7+
proto_major: 1
8+
proto_minor: 1
9+
content_length: 0
10+
transfer_encoding: []
11+
trailer: {}
12+
host: https://redacted.instance.url
13+
remote_addr: ""
14+
request_uri: ""
15+
body: ""
16+
form: {}
17+
headers:
18+
Accept:
19+
- '*/*'
20+
Authorization:
21+
- redacted
22+
Content-Type:
23+
- application/json
24+
url: https://redacted.instance.url/api/v1/connector/version
25+
method: GET
26+
response:
27+
proto: HTTP/1.1
28+
proto_major: 1
29+
proto_minor: 1
30+
transfer_encoding: []
31+
trailer: {}
32+
content_length: 20
33+
uncompressed: false
34+
body: '{"version":"2.18.2"}'
35+
headers:
36+
Cache-Control:
37+
- max-age=3600
38+
Content-Length:
39+
- "20"
40+
Content-Type:
41+
- application/json
42+
Date:
43+
- Tue, 27 Jan 2026 05:28:41 GMT
44+
Server:
45+
- nginx/1.27.4
46+
Set-Cookie:
47+
- redacted
48+
Strict-Transport-Security:
49+
- max-age=31536000; includeSubDomains; preload;
50+
X-Csrf-Token:
51+
- redacted
52+
X-Vcap-Request-Id:
53+
- de8d9885-4b04-4018-677f-636b82fec061
54+
status: 200 OK
55+
code: 200
56+
duration: 790.981626ms
57+
- id: 1
58+
request:
59+
proto: HTTP/1.1
60+
proto_major: 1
61+
proto_minor: 1
62+
content_length: 0
63+
transfer_encoding: []
64+
trailer: {}
65+
host: https://redacted.instance.url
66+
remote_addr: ""
67+
request_uri: ""
68+
body: ""
69+
form: {}
70+
headers:
71+
Accept:
72+
- '*/*'
73+
Authorization:
74+
- redacted
75+
Content-Type:
76+
- application/json
77+
url: https://redacted.instance.url/api/v1/configuration/subaccounts/cf.eu12.hana.ondemand.com/304492be-5f0f-4bb0-8f59-c982107bc878/domainMappings
78+
method: GET
79+
response:
80+
proto: HTTP/1.1
81+
proto_major: 1
82+
proto_minor: 1
83+
transfer_encoding: []
84+
trailer: {}
85+
content_length: 331
86+
uncompressed: false
87+
body: '[{"virtualDomain":"testterraformvirtualdomain","internalDomain":"testterraforminternaldomain","_links":{"self":{"href": "https://redacted.url/path"}}}]'
88+
headers:
89+
Cache-Control:
90+
- no-store
91+
Content-Length:
92+
- "331"
93+
Content-Type:
94+
- application/json
95+
Date:
96+
- Tue, 27 Jan 2026 05:28:41 GMT
97+
Server:
98+
- nginx/1.27.4
99+
Set-Cookie:
100+
- redacted
101+
Strict-Transport-Security:
102+
- max-age=31536000; includeSubDomains; preload;
103+
X-Csrf-Token:
104+
- redacted
105+
X-Vcap-Request-Id:
106+
- 1885a3e6-c9a0-4f15-4936-cffc83677ec2
107+
status: 200 OK
108+
code: 200
109+
duration: 276.493208ms
110+
- id: 2
111+
request:
112+
proto: HTTP/1.1
113+
proto_major: 1
114+
proto_minor: 1
115+
content_length: 0
116+
transfer_encoding: []
117+
trailer: {}
118+
host: https://redacted.instance.url
119+
remote_addr: ""
120+
request_uri: ""
121+
body: ""
122+
form: {}
123+
headers:
124+
Accept:
125+
- '*/*'
126+
Authorization:
127+
- redacted
128+
Content-Type:
129+
- application/json
130+
url: https://redacted.instance.url/api/v1/connector/version
131+
method: GET
132+
response:
133+
proto: HTTP/1.1
134+
proto_major: 1
135+
proto_minor: 1
136+
transfer_encoding: []
137+
trailer: {}
138+
content_length: 20
139+
uncompressed: false
140+
body: '{"version":"2.18.2"}'
141+
headers:
142+
Cache-Control:
143+
- max-age=3600
144+
Content-Length:
145+
- "20"
146+
Content-Type:
147+
- application/json
148+
Date:
149+
- Tue, 27 Jan 2026 05:28:41 GMT
150+
Server:
151+
- nginx/1.27.4
152+
Set-Cookie:
153+
- redacted
154+
Strict-Transport-Security:
155+
- max-age=31536000; includeSubDomains; preload;
156+
X-Csrf-Token:
157+
- redacted
158+
X-Vcap-Request-Id:
159+
- 76015a62-2fe0-47b5-6817-507401a2dcec
160+
status: 200 OK
161+
code: 200
162+
duration: 359.292209ms
163+
- id: 3
164+
request:
165+
proto: HTTP/1.1
166+
proto_major: 1
167+
proto_minor: 1
168+
content_length: 0
169+
transfer_encoding: []
170+
trailer: {}
171+
host: https://redacted.instance.url
172+
remote_addr: ""
173+
request_uri: ""
174+
body: ""
175+
form: {}
176+
headers:
177+
Accept:
178+
- '*/*'
179+
Authorization:
180+
- redacted
181+
Content-Type:
182+
- application/json
183+
url: https://redacted.instance.url/api/v1/configuration/subaccounts/cf.eu12.hana.ondemand.com/304492be-5f0f-4bb0-8f59-c982107bc878/domainMappings
184+
method: GET
185+
response:
186+
proto: HTTP/1.1
187+
proto_major: 1
188+
proto_minor: 1
189+
transfer_encoding: []
190+
trailer: {}
191+
content_length: 331
192+
uncompressed: false
193+
body: '[{"virtualDomain":"testterraformvirtualdomain","internalDomain":"testterraforminternaldomain","_links":{"self":{"href": "https://redacted.url/path"}}}]'
194+
headers:
195+
Cache-Control:
196+
- no-store
197+
Content-Length:
198+
- "331"
199+
Content-Type:
200+
- application/json
201+
Date:
202+
- Tue, 27 Jan 2026 05:28:42 GMT
203+
Server:
204+
- nginx/1.27.4
205+
Set-Cookie:
206+
- redacted
207+
Strict-Transport-Security:
208+
- max-age=31536000; includeSubDomains; preload;
209+
X-Csrf-Token:
210+
- redacted
211+
X-Vcap-Request-Id:
212+
- a0476498-e5d5-4723-7246-841c0f9a3183
213+
status: 200 OK
214+
code: 200
215+
duration: 337.528167ms

0 commit comments

Comments
 (0)